3 ms·
I'm not 100% certain you got the point, which is that in Clojure (and Haskell and I'm sure others) recursion is used "whenever possible" but given a choice you
by jerf 16y ago
I'm not 100% certain you got the point, which is that in Clojure (and Haskell and I'm sure others) recursion is used "whenever possible" but given a choice you should use the pre-rolled recursions available in the various combinators, not implement it yourself directly.
fold, map, filter, and a wide variety of other things are all recursive, but the recursion can and should be factored away. A "map" is utterly clear what is going on. The handwritten recursive version of a map requires a bit of analysis to be quite sure there's nothing tricky in the function being mapped, especially as the function being mapped gets large.