ataggart <alex.tagg...@gmail.com> writes:

> Vectors also permit evaluation of the literal collection's elements:
>
> user=> [(+ 1 2) (+ 3 4)]
> [3 7]
> user=> '((+ 1 2) (+ 3 4))
> ((+ 1 2) (+ 3 4))

That's a false distinction. You used `quote' rather than
`list'. Macroexpand your form to see:

,----
| user> (quote ((+ 1 2) (+ 3 4)))
| ((+ 1 2) (+ 3 4))
`----

Quote is not a list constructor. It simply returns what the reader had
constructed without evaluating it, and in this case, the reader had
constructed a list.

What you should have supplanted the vector literal reader with was the
`list' function:

,----
| user> (list (+ 1 2) (+ 3 4))
| (3 7)
| user> (vector (+ 1 2) (+ 3 4))
| [3 7]
`----

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to