On Tue, Aug 2, 2011 at 4:43 PM, Trastabuga <lisper...@gmail.com> wrote:

> I just came across the issue of getting the StackOverflowError in the
> function reading long file and recursively building a list of data.
> After I replaced function name with "recur" the problem went away.
> Hence a couple of questions. It's the programmer's responsibility to
> put recur instead of function names where tail-recursion is available?
> (Kind of obvious, but then why the compiler wouldn't detect it?)
> If tail-recursion is not available and function name has to be called,
> how do I deal with stack overflow in this case?
>

Clojure does not have tail call optimization. You must use recur,
trampoline, or redesign your code around lazy sequences.

David

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to