Re: Wrapping an expression inside a function

2011-09-16 Thread Ulises
> Not the right answer. I tried to use the apply function with no > success. > How can I wrap the expression inside a function. Why not use partition and interleave? user> (partition 2 (interleave [:a :b] [:c :d])) ((:a :c) (:b :d)) U -- You received this message because you are subscribed to

Re: Wrapping an expression inside a function

2011-09-16 Thread Meikel Brandmeyer (kotarak)
Hi, the use of a apply should work. Also note the (partial conj []) is not necessary. vector works as well. user=> (defn columns [& xs] (apply map vector xs)) #'user/columns user=> (columns [:a :b] [:c :d]) ([:a :c] [:b :d]) Sincerely Meikel -- You received this message because you are subscr

Wrapping an expression inside a function

2011-09-16 Thread rakesh
Given a list of vectors, I want to return a list of vector whose elements are grouped by index. For example: Given [:a :b] [:c :d] => [:a :c] [:b :d] For this, I wrote the expression (map (partial conj []) [:a :b] [:c :d]) => [:a :c] [:b :d] It returned the right answer. Now I want wrap the above