News for hackers. Stuff that matters.
Re:Ask HN: Thinking in Functional programming by apgwoz on Monday July 20, 2009 @10:19AM (#714418)
I think I'd normally say "read SICP" but Clojure discourages recursion in favor of it's looping constructs (due to the non-ability to optimize it on the JVM I'm guessing).

That said, SICP will still teach you to think in terms of HOFs and functions as abstractions, so it'll definitely help out. And it's free online, so the only investment is time.

Re:Ask HN: Thinking in Functional programming by sctb on Monday July 20, 2009 @12:35PM (#714645)
I believe that you can replace directly recursive tail-calls with the `recur' special form to achieve an iterative function manually. If the function is truly recursive, then Clojure will likely behave much as any Scheme would.
Re:Ask HN: Thinking in Functional programming by apgwoz on Tuesday July 21, 2009 @09:25AM (#716167)
I haven't looked at the code that gets generated by `recur`, but I'm guessing it creates a trampoline, and it looks a bit limiting. (e.g. you can't recur with variadic functions) That said, probably all of the excercises in SICP could be done with `recur` and `loop,` with a few minor changes. Thanks for the tip.