Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Stateless Iteration without tail-recursion
2 points by Immortalin on Oct 30, 2014 | hide | past | favorite
Is there a way to do stateless iteration in the lisp family of languages (e.g. clojure) without having to resort to tail recursion? The syntax for tail-recursion is much more verbose than the non-tail-recursive variant but it is essential in order to prevent stack overflows. The loop + recur combination in clojure makes this problem even worse and thus I am trying to find away around it. The closest I can find is the 'for' statement in Lua which is supposedly stateless.

http://www.lua.org/pil/7.3.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: