[plt-scheme] to define, or to let

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Mar 21 12:54:08 EST 2004

On Mar 21, Matthew Flatt wrote:
> 3. Changing MzScheme's `letrec' to match R5RS.
> 
> I don't know.
> 
> Originally, `letrec*' was included in MzScheme so that programmers
> could explicitly request the current behavior. But I only saw the
> is-an-error difference, and not the time-of-assignment difference,
> so I defined `letrec' as an alias for `letrec*'. Of course, no one
> used `letrec*', so it was dropped.
> 
> For v300, we could restore `letrec*' and make `letrec' compliant
> with R5RS. But we would also need something like `begin*' to have
> internal definitions expand to `letrec*' (since R5RS requires
> `letrec'), and that's where it starts to get painful.
> [...]

It seems like some people like the practicality of letrec* and some
like the standard-ity of r5rs-letrec, and something like what Felix
suggested last night would make everyone happy -- make the R5RS
language as conforming as possible, and keep MzScheme the same
otherwise.  This way it is possible to use either world, and Anton can
get ready for running code on a jvm easier etc.  So in case there is
any addition of a proper letrec code, I think it would make more sense
to either:

1. Add r5rs' letrec as `letrec-', make the r5rs language provide it as
   `letrec' and the original as `letrec*'.

2. Add a `letrec-is-letrec*' parameter that will be true by default,
   turn it off in r5rs.

This is, of course, assuming that it is important enough to care
about.  (And I am silent in that department.)

(Maybe a similar trick could even be used for evaluating arguments in
a different order in the r5rs language, except that I can't see how
that can be done efficiently.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.