Given a function, vectors or arrays, and level specification as input. What is the simplest way in Clojure to output pairwise threading of the function? Given two vectors I first tried
(vec (interleave [:a :b] [1 2]))
[:a 1 :b 2]
For arrays I used
(vec (map interleave [[:a :b] [:c :d]] [[1 2] [3 4]]))
[(:a 1 :b 2) (:c 3 :d 4)]
which doesn't exactly output an array. Is this the right way to go for pairwise threading of a function?
Here's a sample of what I am trying to do
Input 1: [+ [[1 2] [3 4]] [[1 2] [3 4]] 2]
Output 1: [[2 4] [6 8]]
Input 2: [+ [1 2 3 4] [1 2 3 4]]
Output2: [2 4 6 8]