Re: java.lang.StackOverflowError when calling function name instead of recur

2011-08-03 Thread Ken Wesson
On Tue, Aug 2, 2011 at 4:47 PM, David Nolen dnolen.li...@gmail.com wrote: 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

java.lang.StackOverflowError when calling function name instead of recur

2011-08-02 Thread Trastabuga
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

Re: java.lang.StackOverflowError when calling function name instead of recur

2011-08-02 Thread David Nolen
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

Re: java.lang.StackOverflowError when calling function name instead of recur

2011-08-02 Thread yair
To add a bit to this, the JVM does not support tail call recursion. As I understand it, Clojure compiles into bytecode that effectively turns the recurs into an iterative process. Scala does something similar but automatically (i.e. you don't have to use a specific keyword). The advantage to