Part I: Eager to Process
A key innovation in Clojure (versus earlier Lisps) is the abstraction of sequence processing functions away from the list type, to the more general sequence interface. This polymorphic abstraction lets what would otherwise be a large library of functions operating on a single collection type (list), grow in power to operate over more collection types, including maps, sets, vectors, and many others.
The clojure.core sequence processing facilities borrow great ideas from earlier Lisps and Haskell too. Conversely, ClojureScript’s collections library can be viewed as a successor to Clojure’s own. By exploring a little bit of this surrounding terrain, we gain a much clearer understanding of Clojure’s elegant and powerful collection processing.
In this first 45-minute presentation, we’ll introduce a toy problem and we’ll solve it a few different ways at the REPL. From very basic beginnings, we’ll introduce sequence processing and collection-sequence duality. We’ll progress smoothly to higher-order functions and beyond (I don’t want to ruin the surprise mkay?) Along the way we’ll meet a number of foundational Clojure functions and forms.
If you’ve read a Clojure book (mainly the first few chapters) and you’ve written some code, you have everything you need to understand this talk. Intermediate Clojurists, may also come away with some new insights.
Bill Burcham has earned his living for almost three decades now, making software. He’s liked Lisp best for even longer than that. As many have pointed out: Lisp feels like something discovered—not something invented. There is something essential in Lisp.
When he’s not engaged in a media fast, Bill can be reached @billburcham