Inside Clojure's Collection Model

16 Mar 2016

What are the Clojure collection types? Most Clojurists would say lists, vectors, maps, and sets are all you need. You might add seqs too - they are collection abstractions (views) which can be backed by...

Read More

Polymorphic performance

27 Apr 2015

There was a question recently on the Clojure mailing list about when to use multimethods vs protocols vs case vs cond:

There are situations where I want to dispatch functions using based on...

Read More

Clojure Tip - "contains?"

27 Jan 2015

There are a number of questions and gotchas that come up over and over in Clojure forums. I thought it might be useful to write some of them up. I initially planned to write them...

Read More

Sequences

02 Jan 2015

Sequences are the key abstraction that connects two of the most important parts of Clojure - immutable persistent collections and the sequence library. Lisp has a deep tradition of list-oriented transformation functions. In Clojure, these...

Read More

Creating a reducible repeat

21 Dec 2014

One fun ticket (CLJ-1603) that I worked on recently involved retrofitting some existing sequence “generator” functions to be directly reducible. Specifically, the clojure.core functions cycle, iterate, and repeat. I’ll just talk about repeat in...

Read More

Creating an interpose transducer

18 Dec 2014

Continuing from yesterday’s post, I wanted to cover the interpose transducer from CLJ-1601.

The sequence version of interpose is a straightforward combination of other existing sequence functions (repeat, interleave, and drop). It’s implemented...

Read More

Creating a distinct transducer

17 Dec 2014

I wanted to talk in this post about implementing some new transducer impls for existing sequence functions which is based on CLJ-1601. If you haven’t checked into transducers yet, it’s probably best if you...

Read More

Boxed math warnings

15 Dec 2014

In Java, there are two forms of numbers - primitive and boxed (Object) forms. This distinction may be resolved some day with value types, but for now that’s just the reality of the JVM...

Read More