Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-24 Thread Moritz Heidkamp
Hi Alex, On 24 February 2015 00:13 CET, Alex Shinn wrote: You may be falling short of the issue described by SRFI 45, which is that in all known Scheme implementations: (define (loop) (delay (force (loop (force (loop)) leaks memory. In R7RS this becomes (define (loop)

Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-24 Thread Moritz Heidkamp
Hi John, On 24 February 2015 00:59 CET, John Cowan wrote: Lazy-map isn't lazy, so you are basically generating an eager list processing each element, and discarding the whole mess. that's not true, where did you get this idea? One way to try for yourself: (lazy-head (lazy-drop 10

Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-24 Thread cowan
Moritz Heidkamp scripsit: Lazy-map isn't lazy, so you are basically generating an eager list processing each element, and discarding the whole mess. that's not true, where did you get this idea? A brain fart on my part. I was thinking of lazy (left) folds, which have to realize all the

Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-24 Thread Alex Shinn
On Tue, Feb 24, 2015 at 7:17 PM, Moritz Heidkamp mor...@twoticketsplease.de wrote: Hi Alex, On 24 February 2015 00:13 CET, Alex Shinn wrote: You may be falling short of the issue described by SRFI 45, which is that in all known Scheme implementations: (define (loop) (delay (force

[Chicken-users] Strange memory leak with lazy-seq

2015-02-23 Thread Kooda
Hi! I’ve been playing with lazy-seq for the past few days and found a very strange behaviour: The heap of the following program keeps growing rapidly in csi, running the same program after compilation seems to slow down the growth quite a lot but the heap isn’t constant as I was expecting it to

Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-23 Thread John Cowan
Kooda scripsit: (define (complex-stream seq) (lazy-map identity seq)) Lazy-map isn't lazy, so you are basically generating an eager list processing each element, and discarding the whole mess. -- John Cowan http://www.ccil.org/~cowanco...@ccil.org Where the wombat has

Re: [Chicken-users] Strange memory leak with lazy-seq

2015-02-23 Thread Alex Shinn
On Mon, Feb 23, 2015 at 9:57 PM, Kooda ko...@upyum.com wrote: Hi! I’ve been playing with lazy-seq for the past few days and found a very strange behaviour: The heap of the following program keeps growing rapidly in csi, running the same program after compilation seems to slow down the