[plt-scheme] to define, or to let

From: Bradd W. Szonye (bradd+plt at szonye.com)
Date: Sun Mar 21 17:18:43 EST 2004

Matthew Flatt wrote:
> Some responses to various parts of the thread:
> 1. Evaluation order is a different issue from allowing access to
>    previously-bound variables in the right-hand side of a `letrec'
>    binding.
> The former is in the spirit of adding hash tables, etc. These are
> extras that you can rely on in MzScheme, but not in plain R5RS.

It's not quite the same as adding hash tables. Fixed evaluation order is
a "quiet extension"; hash tables are not. That makes the extension a bit
risky for users, especially for students (who may not understand the
difference between vendor-standard behavior and language-standard
behavior), maintainers, porters, etc.

Note that I'm not arguing against the extension; the benefits may
outweigh the risks. However, it would be a good idea to document "quiet"
extensions like this in their own section, to highlight the risks

> The latter is a case of MzScheme ignoring "is an error" in the
> standard. I think there's only one other case like this: if an
> expression in a `begin' sequence returns multiple values, MzScheme
> always allows it (except for the last expression, where it depends on
> the dynamic context).

That's a good reason to provide a (customizable) warning, if it's not
too burdensome.

> 2. Internal defines versus `letrec'.
> I agree that `letrec*' is a more natural target for a sequence of
> internal definitions.

Add me to the growing list of people who like this idea.

> 3. Changing MzScheme's `letrec' to match R5RS.
> I don't know.

Personally, I think it would be better to change R6RS to match MzScheme
(and the many other Schemes that work like it).
Bradd W. Szonye

Posted on the users mailing list.