This past weekend, I attended Amit Rathore's ProClojure boot camp to learn the Clojure programming language. Back in the 80's, I had quite a bit of exposure to Lisp but haven't had cause to use those techniques since. Clojure is essentially Lisp reinvented for the JVM. I'm already using Scala which blends both OOP and Functional Programming styles - and I've dabbled in Erlang and Haskell over the last few years.
The day started early (I'm not a morning person at the best of times but needing to be in Mountain View around 8am on a Saturday was hard!) and Amit explained that we would be work in pairs all day and to emphasize that he gave us five minutes to get to know our partner well enough to introduce them to the group, rather than us each introducing ourselves. A very nice touch! The plan for the day was one person drives in the morning and then you switch for the afternoon. The course was very much hands on so the pairing really helped us focus on programming together and learning from each other, as well as learning from Amit!
In the morning we focused on basics and building versions of some of the built-in functions so that we could understand the core techniques. In the afternoon we focused on more advanced techniques, including quite a bit of time on macros (which allow you to build sophisticated Domain Specific Languages on top of Clojure).
I really enjoyed the day. Amit (and his colleague Siva) were excellent hosts at Runa (who use Clojure in production). Some of the material used in the course was drawn from Amit's book: Clojure in Action (which I bought as soon as I got home and I'm thoroughly enjoying).
As I've said several times in the past, I highly recommend learning other languages to give you a new perspective on the language you use every day for work (even better if you can use multiple languages in your day job!).
I've decided to post the two files I created during the course, which are a mix of Clojure functions and notes that I took, so that you can get a sense of the language:
- exercises.clj - general exercises from the morning that focused on basic Clojure
- expenses.clj - more advanced examples (several focusing on filtering an expense report)
I hope you enjoy the examples and find Clojure to be intriguing!
And just in case you think Clojure is too different to CFML and too 'niche', bear in mind that CFML also treats functions as first class citizens that you can pass around and call in different contexts - and I've shown some functional programming examples in the past on my blog with CFML!

5 responses so far ↓
1 Elliott Sprehn // May 4, 2010 at 1:58 AM
Have you looked at OCaml? That's my favorite language of the functional persuasion. :)
2 Sean Corfield // May 4, 2010 at 9:48 AM
OCaml looks a lot like SURE which was the functional language I designed and implemented in the mid-80's for my PhD research - but then it's also inspired by ML :)
3 Brian Panulla // May 27, 2010 at 10:04 AM
4 Sean Corfield // May 27, 2010 at 11:22 AM
5 nickik // Sep 27, 2010 at 2:36 PM
@Sean Corfield now there is erjang check it out, i don't know how far the are but I think the are pretty far.
Leave a Comment