Mike Gran <spk...@yahoo.com> writes:

>   (quasiquote (sym unquote func))
>   `(sym unquote func)
>
> Is this a valid use of unquote?
>
> I get that (cons 'a (list 'b 'c)) == (list 'a 'b 'c), but, I'm not sure
> if unquote should be valid in that sort of construction.

As has already been pointed out, since ,foo is literally the same as
(unquote foo), (a . (unquote foo)) = (a unquote foo) has to be literally
the same as (a . ,foo). This is actually a source of one of my favourite
Scheme implementation bugs (favourite since it is common, subtle, but harmless)

Try a few scheme implementations and see how many error on

`#(1 2 3 unquote foo)

because of implementing vector quasiquotation under the hood as list
quasiquotation.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"

Reply via email to