[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macroexpand-1

From: Mark H Weaver
Subject: Re: macroexpand-1
Date: Tue, 29 May 2018 11:01:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)


Catonano <address@hidden> writes:

> in the NEWS file, I read:
> ...
> ** Removed function: `macroexpand-1'
> It is unclear how to implement `macroexpand-1' with syntax-case, though
> PLT Scheme does prove that it is possible.
> what's the problem with macroexpand-1 and syntax-case ?

In Guile 1.x, 'macroexpand-1' performed a single macro expansion step at
the top-level form of an expression, using its old non-hygienic macro
expander.  There are several problems with trying to provide such an
interface in a Hygienic macro expander, and especially in the
'syntax-case' expander with its support for 'datum->syntax'.  For one
thing, our modern macro expander doesn't even work with the plain
S-expressions which 'macroexpand-1' accepted and produced.  It works
with "syntax objects", which effectively annotate every identifier with
extra information needed to determine which binding it references, and
also extra information needed to implement 'datum->syntax'.  This in
turn requires detailed knowledge of the lexical environment in which
expansion is taking place, whereas 'macroexpand-1' provides no way for
the user to provide this information.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]