[r6rs-discuss] Expansion process

R. Kent Dybvig dyb at cs.indiana.edu
Thu Feb 22 16:48:19 EST 2007


I'm responding as a user/implementor, not speaking for the editors.

> - It seems wrong that
>    (define VAR EXP)
> would defer expanding EXP, while
>    (set! VAR EXP)
> expands EXP immediately.

> Note: This is relevant if we're expanding a <toplevel body> -
> *or* this proposal is accepted:
> http://lists.r6rs.org/pipermail/r6rs-discuss/2007-January/001333.html

If (set! VAR EXP) appears as one of the top-level forms of a
<toplevel body>, the EXP in (set! VAR EXP) is deferred; in fact,
the entire set! form is deferred, because it's treated like
(define dummy (begin (set! VAR EXP) (unspecified))).

> - Deferring lambdas rather than define allows repls and load to
> work more consistently.  Consider:

The expansion process is designed to make program bodies consistent with
library and lambda bodies.  They may or may not be consistent with a
particular implementation's repl model, but repl behavior is not specified
by R5.92RS.

Kent



More information about the r6rs-discuss mailing list