Clojure and The Joy of Seqs

July 3, 2020

Introduction

Recently I've seen some great posts out there on creating sequences in Clojure and wanted to throw out a few of my own solutions as well as give some detailed explanations for those new to Clojure and the idea of creating lazy seqs, especially using the iterate function.

Continue reading →

A Polynomial Macro

July 10, 2017

Introduction

In this edition of the blog I am going to cover a very cool macro for conveniently defining polynomials that is also very performant. It's also a great example of how macros work and when you might want to use one.

Continue reading →

Clojure Rising

June 19, 2017

#Still Here, Still Doing Clojure It's been a while since I've added to my blog over at fn-code. If you were to speculate that this is because I am no longer a Clojurian, you would be very wrong. In fact, from my perspective Clojure adoption and usage is alive, well, and growing in both my own life and in the community.

As far as the lack of blogging goes, here's a summary of what's been going on with me:

Continue reading →

Another Tetris Clone in Clojure

April 7, 2016

##Introduction Recently I was looking at a problem involving extracting and transposing submatrices of data within a larger data grid. Somehow this got me thinking how easy it would be to rotate tetrominos using Clojure. In case you are wondering, it is super easy:

(defn rotate-ccw [shape] 
  (apply mapv vector (map rseq shape)))

(defn rotate-cw [shape] 
  (apply mapv (comp vec rseq vector) shape))
Continue reading →

Clojure: Getting Started

December 1, 2015

Introduction

Often people will ask me how to get started in Clojure. Most often they have a Java background, but sometimes they are coming from C++, Python, or some other popular language. Either way, I rehash the same story and spent a bunch of time finding and consolidating the same links as the last time someone asked me this question.

Continue reading →