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: Clojure
@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.
LikeLike