Dear Clojurists,

Two questions:

Question #1

I want to write a vararg function that does something like this:

(map vector [1 2 3] [4 5 6])
which yields
([1 4] [2 5] [3 6])

I try to capture this as a function:

(defn rotate[& x] (map vector x))

but

(rotate [1 2 3] [4 5 6])

yields

([[1 2 3]] [[4 5 6]]) instead of ([1 4] [2 5] [3 6])

What am I doing wrong?

Question #2

Question #1 was somewhat of a diversion. What I actually want my
function to look like is something like this:

(defn rotate[x] (map vector x))

where the x passed in is a vector of vectors e.g. [[4 2 3] [ 9 8 7]]

so

(rotate [[1 2 3] [4 5 6]])

would yield

([1 4] [2 5] [3 6])

How can I achieve this?

Many thanks for this great language.

-Julien

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