On Fri, Aug 7, 2009 at 5:04 PM, tsuraan <tsur...@gmail.com> wrote:

>
> Most languages I've used define a zip method, where you can take two
> lists and get a list of the pairs of elements in those lists.  So,
> (zip '(1 2 3) '(4 5 6)) would give ([1 4] [2 5] [3 6]).  Does clojure
> have a core function like that?  I've been poking around, but all I'm
> finding is zipmap, which is close but it builds a map instead of a
> list of pairs.  Writing my own isn't a big deal, but it seems like
> something that has to be in the core somewhere.
>
>
Yea!  A clojure question I can answer, instead of just ask!  Woohoo!

You can replace zip with map list, like:
user=> (map list [ 1 2 3] [4 5 6])
((1 4) (2 5) (3 6))
user=>

Brian

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