Re: Recursions under lazy-seq - how does it work?

2009-11-25 Thread Gabi
Very interesting indeed. I am not sure I understand completely, but by intuition I presume that the recursive call actually creates a new heap allocated LazySeq (with the function definition inside) . So is there some help from the compiler for this? How does the recursive call suddenly transfers

Re: Recursions under lazy-seq - how does it work?

2009-11-25 Thread David Brown
On Wed, Nov 25, 2009 at 09:40:44AM -0800, Gabi wrote: Very interesting indeed. I am not sure I understand completely, but by intuition I presume that the recursive call actually creates a new heap allocated LazySeq (with the function definition inside) . So is there some help from the compiler

Re: Recursions under lazy-seq - how does it work?

2009-11-25 Thread Gabi
Ok. Now I get it. Cool stuff On Nov 25, 4:18 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Nov 25, 9:10 am, Gabi bugspy...@gmail.com wrote: For example why doesn't the following repeatedly never crash? (defn repeatedly   [f] (lazy-seq (cons (f) (repeatedly f Because the

Re: Recursions under lazy-seq - how does it work?

2009-11-25 Thread John Harrop
On Wed, Nov 25, 2009 at 12:40 PM, Gabi bugspy...@gmail.com wrote: Very interesting indeed. I am not sure I understand completely, but by intuition I presume that the recursive call actually creates a new heap allocated LazySeq (with the function definition inside) . Not quite; it creates a