News for hackers. Stuff that matters.
Re:Slashdot Book Reviews: Programming Clojure by jrockway on Monday May 17, 2010 @06:54PM (#1355853)
Anyone else dislike the color #ff0f93 more than #ff0e95?
Re:Slashdot Book Reviews: Programming Clojure by tzs on Monday May 17, 2010 @07:23PM (#1355926)
How is that comparable? The word 'recur' suggests recursion, so using it to mean you do NOT want recursion seems to be kind of odd. Does it make sense to you?
Re:Slashdot Book Reviews: Programming Clojure by lmkg on Monday May 17, 2010 @07:37PM (#1355958)
The 'recur' operator was meant as a replacement for the lack of tail-recursive optimization in the JVM, and is often seen as a recursion operator, not an iteration operator, especially by people coming from a functional background. People from an imperative background seem to understand it as a type of limited GOTO, with only a single place it can go to; people from a functional background see it as similar to calling the function you're in by name, but mentioning the recursion explicitly for compiler optimizations.

Recur seems to be maligned by people on both sides of the recursion/iteration divide. I rather like it, in no small part because I think the divide is silly. Iteration is the same as recursion, both semantically (especially if you have tail-call optimization) and syntactically (especially if you can have multiple loop variables). Recur blurs the distinction. If you think the distinction is important, it's confounding; if you think the distinction is silly, it's unifying.

Re:Slashdot Book Reviews: Programming Clojure by apgwoz on Monday May 17, 2010 @08:21PM (#1356022)
recursion is the same as iteration in a tail-call optimized environment. Granted, the JVM isn't tail-call optimized, but whatever.