[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 9:42 PM, Andrzej <ndrwrdck@x> wrote:
1. (one I mentioned before) Is it just me who thinks that it is a bad
idea to have same quasiquote forms expand correctly in one context and
fail in another?
You're referring to the fact that "(unquote 1 2)" is sometimes legal or not, depending on what's surrounding it, right?
I might agree if I thought UNQUOTE and UNQUOTE-SPLICING were actual syntactic forms, like QUOTE or DEFINE-SYNTAX. But really, they're just literal identifiers which QUASIQUOTE looks for when it walks its input form (like ELSE and => for COND).
2a. As a performance optimization. Imagine that "macro-apply" expands
to some complex _expression_. It is usually cheaper to evaluate:
(some-procedure (macro-apply some-contents))
(some-procedure (macro-apply-car some-contents) (macro-apply-cadr
some-contents) (macro-apply-caddr some-contents))
Interesting idea. Note that if you merely move the name SOME-PROCEDURE into the argument list of MACRO-APPLY, then the macro can return just one form and achieve the same effect.
Scheme-reports mailing list