On Tue, 2009-09-15 at 19:45 -0400, Aaron W. Hsu wrote:
> Keep in mind that the desired semantics in a perfect world are closer to
> the internal library body in R6RS or the top-level program semantics, and
> the semantics of the REPL are an unfortunate necessity because we must
> evaluate every form that we encounter as we encounter it. It is much nicer
> to be able to evaluate each definition in the same scope and have LETREC
> or LETREC* semantics.
This is why I argue that the proper time for expansion of macro calls
is the first time the code containing them is executed. That is the
only way you achieve LETREC or LETREC* - like semantics that are
consistent between macro invocations and function calls.
The semantics of the REPL are not an "unfortunate necessity." They
are a clear proof that the "Right Thing" in terms of semantic
consistency is not served by a separation of phases.
If you design for a separation of phases anyway, then your design
is going to have semantic inconsistencies. *That* is the
unfortunate necessity.
> Thus, the fact that we have an immediate evaluation
> limitation on the REPL should not be unnecessarily extended to places
> where we need not limit our code so. BEGIN is such a case. Because we get
> an *entire* BEGIN clause as a single unit, we can take advantage of
> evaluating them all as they really ought to be evaluated, rather than
> condescending to a less ideal REPL semantics.
I think that you have used the word "condescending" in a very ironic
way here.
Bear
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss