guile-user
[Top][All Lists]
Advanced

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

Unquote syntax


From: Mike Gran
Subject: Unquote syntax
Date: Tue, 31 Dec 2013 19:28:04 -0800 (PST)


Hi-

With Guile 2.0.9, I'm struggling with unquote syntax.

First, assume that there is already a defined function named 'func'.

I expect the following to be equal, and they are.


  (cons 'sym func)

  (quasiquote (sym . (unquote func)))  `(sym . ,func)

Guile writes them both as 


 (sym . #<procedure func (x)>)

But, the following is also equivalent, which is a surprise to me.

  (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.


Thanks,


-Mike Gran



reply via email to

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