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 (loop))))
> >   (force (loop))
> >
> > leaks memory.  In R7RS this becomes
> >
> >   (define (loop) (delay-force (loop)))
> >
> > which is required by the standard not to leak.
> >
> > I'm not sure why you don't observe a leak in the
> > second example.
>
> Kooda and I discussed this issue on IRC yesterday and in fact, the first
> version doesn't leak when compiled either (he mixed up results when
> writing this email). So either the CHICKEN compiler is the first Scheme
> implementation to not leak memory in this case or something else is
> going on :-)
>

Well, if lazy-seq doesn't actually use delay + force then it's
not an exception :)

I double checked, and for the code I wrote with delay + force,
Chicken leaks both interpreted and compiled.

-- 
Alex
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to