[racket-dev] `letrec' and continuations

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri May 20 16:42:52 EDT 2011

On Fri, May 20, 2011 at 4:39 PM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> -- I think my preferred solution would be to wrap letrec so that continuations grabbed during the setup set up a continuation mark that labels them as 'dangerous'. When you reinvoke them, the existence of the mark tells you that the reference cells should be reinitialized (probably only the ones on the control flow from the continuation point).
>
> -- An alternative could be to stick a lexical identifier into letrec declarations that gets removed from the scope once the letrec is established. It would reappear when you invoke a continuation from the RHS and thus you'd know to reini the ref cells. BUT, this requires a mechanism that is not expressible at the surface of Racket. And it's odd.

I think the key missing piece here is that Matthew wants to avoid
having the reference cells *at all*.  If you use `let*', you don't get
any reference cells.
-- 
sam th
samth at ccs.neu.edu



Posted on the dev mailing list.