[r6rs-discuss] macroexpand
On 9/22/06, Dan Muresan <dan-r6rs_at_omnigia.com> wrote:
>
> I meant this would be another instance in which Scheme loses the power of
> *Lisp* macros, of course...
>
Because of the concern of lexical scoping, Scheme macros are more than
just symbolic expansions. Each symbol -- or name -- carries a meaning
with it, a meaning that was assigned either at macro definition time
or at macro invocation time.
This meaning information enables R5RS hygienic macros to work, as well
as other sophisticated macro systems like syntactic closures. I
believe SYNTAX-CASE works likewise, with its notion of a "syntax
object" encapsulating both a datum and the meaning it has in a
particular lexical context.
For these reasons it's not sufficient to consider the expansion of a
macro as just a list of symbols, as is the case in Common Lisp (which
largely punts on these issues). You have to include the meaning
information along with the symbols -- and what would be the external
representation of that? How would you define a way of examining or
manipulating it?
I believe it is outside the realm of the R6RS standard, just as the
specifics of implementing lexical closures in the form of procedures
are outside the standard.
--Jeff
Received on Fri Sep 22 2006 - 13:59:18 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC