guile-user
[Top][All Lists]
Advanced

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

Re: Unquote syntax


From: Ian Price
Subject: Re: Unquote syntax
Date: Wed, 01 Jan 2014 17:08:31 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Mike Gran <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]