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

Re: [Scheme-reports] What happened to (UNQUOTE <expression> ...)

On Tue, May 3, 2011 at 3:37 AM, Peter Bex <Peter.Bex@x> wrote:
This is a huge change in how macros behave.  Currently a macro can only
expand into one form.  This is also why the splicing "inside" quasiquote
is so weird.

quasiquote is still expanding into only one form -- the outer-most quasiquote is doing all the work.

``,,(list 1 2) ==> (quasiquote (unquote 1 2))  

...is ONE macro invocation.     The next one, if the above form is to be expanded further as is will (should) fail.
Note that Pete Siebel's Practical Common Lisp has an excellent example of a ONCE macro (a tool for macros to guarantee argument expressions are evaluated only once) that relies on the ability to have (unquote <multiple things> ...)  nested inside a quasiquote form.   This macro is a great test for your quasiquote implementation (because it does something useful!).

Scheme-reports mailing list