[R6RS] modules

R. Kent Dybvig dyb
Tue Aug 24 12:33:44 EDT 2004

> When is this substitution applied? To the result of a macro expansion?

No, the substitution would be applied to all code within the scope
of a require form.

(I'm assuming the two-level mechanism used by our implementation of
syntax-case in which the code within the scope of a binding form is
wrapped with a substitution mapping the bound identifiers to labels and
the code is expanded in an environment mapping labels to compile-time

> In other words, does the macro expander know that it's expanding
> `def-f-fun' from the module N, and therefore any `x' (from M) that is
> introduced by `def-f-fun' should be replaced with a compile-time `x'
> (from M)?

No, it's much simpler than that.  The expander just needs to know
whether it is expanding a transformer or not and be sensitive to the
run-time/expand-time marks on some substitutions.


More information about the R6RS mailing list