[bitc-dev] Capture problem with by-ref

Jonathan S. Shapiro shap at eros-os.com
Tue Mar 11 10:41:06 EDT 2008


On Tue, 2008-03-11 at 15:08 +0100, Pierre THIERRY wrote:
> Scribit Jonathan S. Shapiro dies 11/03/2008 hora 09:09:
> >   (define (outer x:'a)
> >     (define (capture xc:(by-ref 'a))
> >       (lambda (y)
> >          (pair y, x)))
> > 
> > Note that "x" is in the call frame of OUTER, it is aliased by "xc", "xc"
> > is in turn captured by the lambda, and the lambda escapes.
> 
> I miss to see where xc aliases x.

That might be because I screwed up the example. Here is a simpler,
better example:

  (define (outer x:(by-ref 'a))
    (lambda (y)
      (pair y, x)))

The problem is that any invocation of OUTER captures x.

Do we agree that this new example illustrates the problem correctly? I
think yours does too, but this is simpler.



More information about the bitc-dev mailing list