2

simple question here. how do i go from having the two vectors [1 2 3] [5 7 9] to having this: [1 5] [2 7] [3 9]?

I tried this: (map concat [1 2 3] [ 4 5 6]), but i get "don't know how to create ISeq from: java.lang.Long "

animalcroc
  • 283
  • 4
  • 13
  • 1
    You have to use the code snippet provided by KobbyPemson, because what you want is to create small vectors out of the big one. So what you want to do is to take the two vectors and create a new one. This is done the way Kobby does. – n2o Feb 19 '14 at 15:16
  • possible duplicate of [matrix transposition in clojure](http://stackoverflow.com/questions/10347315/matrix-transposition-in-clojure) – amalloy Feb 19 '14 at 17:34
  • possible duplicate of [Processing pairs of values from two sequences in Clojure](http://stackoverflow.com/questions/1009037/processing-pairs-of-values-from-two-sequences-in-clojure) – soulcheck Feb 19 '14 at 19:06
  • Note that this operation is often called "zip", e.g. the [python function](http://docs.python.org/2/library/functions.html#zip) (also see [What is zip?](http://stackoverflow.com/questions/1115563/what-is-zip-functional-programming)). – John Wiseman Feb 19 '14 at 22:28

1 Answers1

5

Use map vector instead

(map vector [1 2 3] [5 7 9])
KobbyPemson
  • 2,519
  • 1
  • 18
  • 33