two element vectors implement MapEntry, (into {} x) x needs to be
something that seq can be called on and will return a seq of MapEntrys


On Mon, Jun 1, 2009 at 10:39 AM, samppi <rbysam...@gmail.com> wrote:
>
> Why does using a list with into and a map throw an exception, while
> using a vector is fine?
>
> Clojure 1.0.0-
> user=> (def a (list :a 1))
> #'user/a
> user=> (into {} [a])
> java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to
> java.util.Map$Entry (NO_SOURCE_FILE:0)
> user=> (def b [:a 1])
> #'user/b
> user=> (into {} [b])
> {:a 1}
>
>
> >
>



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

--~--~---------~--~----~------------~-------~--~----~
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