[plt-scheme] Re: call/cc, set!, and fluid-let
At Tue, 14 Jun 2005 13:29:18 -0400, Matthias Felleisen wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
> On Jun 14, 2005, at 1:10 PM, Doug Orleans wrote:
>
> > For list-related administrative tasks:
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> > John Clements writes:
> >> On Jun 14, 2005, at 11:50 AM, David Van Horn wrote:
> >>> John Clements wrote:
> >>>> I claim that
> >>>> (let/cc k M0 .... (k N))
> >>>> is equivalent to
> >>>> (begin M0 ... N)
> >>>> if there are no references to k in any of M0 ... or N.
> >>>
> >>> Almost. One of these will consume all available memory, the other
> >>> will not.
> >>>
> >>> (let loop () (let/ec k (k (loop))))
> >>> (let loop () (begin (loop)))
> >>
> >> Feh! Not Safe-for-space.
> >
> > Is there a reason that the argument of a continuation application is
> > not in tail position? Is it just that you can't (always) tell
> > syntactically when a continuation is being applied? If there were
> > special syntax for continuation application, would this work?
>
> Yes. -- Matthias
Yes to the first probably. You may want to read "lambda, the ultimate
goto". The same principles apply here (and would even if you had a
special continuation apply form).
Robby