4 ms·
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 spac
by cgag 14y 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 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/clojure/core.clj#L245 https://github.com/clojure/clojure/blob/master/src/clj/cloju...