Hi Pierre,

> On May 20, 2015, at 3:35 PM, Pierre Thibault <[email protected]> 
> wrote:
> 
> Is possible to use the operator '@' alone? In the Joy Of Clojure book it is 
> presented as '~@'. I would like an example.

There are multiple contexts in which @ could be used. One is syntactic sugar 
for the deref function; @x is just (deref x), where x is some reference type 
like an atom.

~@, unquote-splice, is an entirely different beast. It is used inside 
syntax-quote (a backtick, `) in macros to mean “take all of these forms and put 
them into this form”, e.g.:

(let [xs ‘(1 2 3 4)]
  `(+ ~@xs))

turns into:

(+ 1 2 3 4)

… so the difference between it and just ~ is the “splicing”; regular unquote 
(~) would get you:

(+ [1 2 3 4])


hth
lvh


> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> <http://groups.google.com/group/clojure?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to