[plt-scheme] to define, or to let

From: Bradd W. Szonye (bradd+plt at szonye.com)
Date: Sat Mar 20 19:41:03 EST 2004

On Sat, Mar 20, 2004 at 12:21:45PM -0500, Eli Barzilay wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> On Mar 20, Richard C. Cobbe wrote:
> > (letrec ((a E1)
> >          (b E2))
> >   E3)
> > 
> > where E1, E2, and E3 are arbitrary expressions.
> > 
> > R5RS states that evaluating E1 cannot require the value of b, and
> > that evaluating E2 cannot require the value of a.  If such
> > dependencies exist, the results are undefined.  (It's entirely
> > possible that MzScheme does define the results in this case; I don't
> > remember, and I'm in the middle of rebuilding DrScheme so I can't
> > check the helpdesk.)
> It does allow E2 to depend on a's value.

Sort of, although it's somewhat dangerous (and non-portable) to assume
that the Scheme interpreter will do it that way. Also, you can get very
strange behavior if you capture a continuation inside E1 or E2.
(Specifically, if you re-enter E2, the interpreter may set! A back to
the value of E1, if it's been changed, as noted in a recent discussion
on comp.lang.scheme.)
Bradd W. Szonye

Posted on the users mailing list.