[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mark H Weaver
Tue, 29 May 2018 11:01:35 -0400
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.
- macroexpand-1, Catonano, 2018/05/21
- Re: macroexpand-1,
Mark H Weaver <=