Request for potential addition campbell@xxxxxx (26 Mar 2004 23:28 UTC)
Re: Request for potential addition Andre van Tonder (27 Mar 2004 02:23 UTC)

Re: Request for potential addition Andre van Tonder 27 Mar 2004 02:23 UTC

On Fri, 26 Mar 2004 wrote:

> I have occasionally found myself wanting to expand a macro in another.
> Now, it wouldn't work to just write the macro I wish to expand in CPS
> or as a syntax computation, because it needs to be an arbitrary macro.
> I'm not _entirely_ sure if this is a good idea yet, but I think it may
> be: I request that a SYNTAX-EXPAND (or whatever it be named) be added
> to the current specification:
> (SYNTAX-EXPAND <form>)                           ;syntactic computation
>     Expand FORM completely and syntactically return the expanded form.
> ('Syntactically return' is probably not the right term, but whatever.)
> It of course cannot be implemented as a regular syntactic computation,
> so it needs lower-level macro system support.
> Again, I haven't thought much about how good an idea this is, but it
> has proven to be useful to me in the past.

In a way, this is the problem that syntax-computations was designed to
solve, although of course you can only expand a syntactic computation and
not an arbitrary macro using SYNTAX-RUN, or in intermediate steps of
Of course it would be useful to be able to do this for arbitrary macros,
but I do not feel qualified to specify this and dealing with the potential
subtleties of hygiene, phase separation (?), etc, that may be involved.