into expects that because it is implemented with conj.
> (conj {} [:foo :bar])
{:foo :bar}
On Wednesday, March 26, 2014 4:41:16 PM UTC-4, Michael Gardner wrote:
>
> For reasons unclear to me, (into {} ...) expects a sequence of 2-element
> *vectors*, not just 2-element collections. partition returns a seq of
> lists, not vectors, which is why you're getting that exception. You could
> try (into {} (map vec (partition 2 2 "12"))) instead.
>
> On Mar 26, 2014, at 15:36 , Andy Smith
> <[email protected]<javascript:>>
> wrote:
>
> > Hi all,
> >
> > I was wondering why this doesn't create a map 1 -> 2 :
> >
> > (into {} (partition 2 2 "12"))
> >
> > Must be yet another misunderstanding of mine.
> >
> > Thanks
> >
> > Andy
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to [email protected]<javascript:>
> > 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] <javascript:>
> > 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] <javascript:>.
> > For more options, visit 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.