Reputation: 4793
For the following clojure code,
(def a 1)
'(a)
[a]
why '(a) = (a)
and [a] = [1]
?
Upvotes: 1
Views: 95
Reputation: 1593
The quote applies itself to the content of the list as well.
'(a)
;; ~ (quote (a))
;; ~ (list 'a)
;; => (a)
Use (list a)
instead.
(list a)
;; => (1)
;; this works too
`(~a)
;; => (1)
See http://clojure.org/special_forms#quote
Upvotes: 4