[Top][All Lists]

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

Re: macroexpand-1

From: Catonano
Subject: Re: macroexpand-1
Date: Tue, 29 May 2018 21:01:06 +0200


2018-05-29 17:01 GMT+02:00 Mark H Weaver <address@hidden>:

> Hi,
> 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.
>        Mark

I have been reading this document about the scheme higienic macros

I stopped reading it when I read that the implementation relies on a
previously bootstrapped version of another macro expansion implementation.

So I have a general overview of the issue

But Racket has some facilities to step and debug macros, as you can see here

Aren' t Racket macros higienyc ?

In this question I've been promptly suggested a quick solution to perform a
single macro expansion step

reply via email to

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