Suppose I have two collections:

(def x [1 2])
(def y [[\a \b] [\d \e] [\f \g]])

And want to iterate over them in the following manner:

user=> (map list x (transpose y))
((1 (\a \d \f))
(2 (\b \e \g)))

Where this is the transpose fn:

(defn transpose
  [in]
  (partition (count in) (apply interleave in)))

Is there any other nice way to do this without relying on some home-
grown fn?

Cheers
Eugen

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