[r6rs-discuss] Expansion order [was: Now, where were we?]
Christian Sloma
c_sloma at gmx.de
Tue Feb 24 16:05:03 EST 2009
On Tuesday 24 February 2009 21:51:45 Andre van Tonder wrote:
> On Tue, 24 Feb 2009, Christian Sloma wrote:
> > On Tuesday 24 February 2009 21:01:58 Andre van Tonder wrote:
> >> On Tue, 24 Feb 2009, Christian Sloma wrote:
> >>>> Where is the burden on macro-free programs? (This is not meant to be
> >>>> argumentative---I am genuinely trying to understand this criticism).
> >>>
> >>> Just one example: R6RS disallows the mixing of expression and
> >>> definitions in libraries.
> >>
> >> This restriction has nothing to do with macros, though. Expressions
> >> could have been allowed easily, as you will see if you consider that
> >> even in R6RS you can get the effect of an interleaved expression by
> >> simply making it the RHS of a dummy definition.
> >
> > Note that it *has* to be inside a define, as the define marks the body to
> > be delayed until all off the other definitions are evaluated.
>
> The expansion process for <library body> could have been declared to be
> exactly the same as the expansion process for <top-level body>, which
> allows interleaved expressions that are not inside a define. The fact that
> it wasn't so defined was just an arbitrary design choice.
It could have been and it should have (IMHO) been, but it was not :) which is
exactly what we are talking about here: the ability to reference macros before
they are defined negatively impacts code that does not even use macros.
More information about the r6rs-discuss
mailing list