Hacker News new | ask | show | jobs
by cgag 4902 days ago
The JVM still doesn't do tail call optimization but Clojure has a special form, recur, that you can only use in tail position and doesn't use consume stack space. An example: https://gist.github.com/4493547 (loop is like let but works with recur).

A simple one from the standard lib is last: https://github.com/clojure/clojure/blob/master/src/clj/cloju...