News for hackers. Stuff that matters.
Re:Crafting Code in Clojure by danneu on Friday February 01, 2013 @09:37PM (#5154891)
I think accumulating an initialized variable in an imperative #each loop is decidedly unidiomatic, just something we tend to do until we really embrace things like #map, #partition, #select, #reduce, etc. (And what a glorious day that is!)

I reckon what makes his first example somewhat unidiomatic is the arbitrary lambda and the use & inner return from the #taps block.

His updated example is just good ol tacit Ruby. But then again the amount of times I see an #each block with inner logic used instead of a simple point-free one-liner in Ruby really just proves your point.

There are no comments on this comment yet.