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

Re: Request for potential addition

This page is part of the web mail archives of SRFI 53 from before July 7th, 2015. The new archives for SRFI 53 contain all messages, not just those from before July 7th, 2015.



On Fri, 26 Mar 2004 campbell@xxxxxxxxxxxxxxxxxxxxxxxxxxx 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
SYNTAX-BIND.  
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.