Clojure: Stages of Enlightenment.

Sunday, October 07, 2012 8:14 PM

I’ve tentatively identified seven stages of enlightenment in Clojure sequence processing.

  • Uses recursion
  • Uses recur
  • Uses loop/recur
  • Uses Clojure API functions such as filter and map
  • Uses reduce
  • Uses all Clojure API functions and understands implications.  At this point you can consider yourself a 4clojure 1st Dan.
  • Uses clojure.set as well

There may be higher levels, but Jay Fields hasn’t blogged about them yet.

Technorati Tags:
Comments
Gravatar
# re: Clojure: Stages of Enlightenment.
Posted by Colin on 10/8/2012 3:28 AM
- minimise use of if/else,cond,case in favour of predicates and filters
- minimise use of lets and anonymous functions (in favour of ->,->>)
Gravatar
# re: Clojure: Stages of Enlightenment.
Posted by lispling on 10/9/2012 8:16 PM
@Colin: Why do you thing lets are inferior to using ->/->>? In general I think let increases code clarity while ->/->> usually result in shorter code that may not be as readable as a longer version of code.

Sure, if you just want to apply a sequence of functions to something, ->/->> are obvious and easy to understand. But once the expressions get more complicated I prefer to take a step back and define intermediate results in a let-binding.
Something to add?

Talking sense? Talking rubbish? Something I'm missing? Let me know!

Fields denoted with a "*" are required.

 (will not be displayed)

 
Please add 1 and 8 and type the answer here:

Preview Your Comment