Re: reducing terms in vector

2010-10-28 Thread Eric Schulte
I don't know if use of `partial' is considered idiomatic, but I think it's the clearest in cases like this. user> (def all-pairs '([ [1 2] [3 4] [5 6] ] [[5 6] [7 8] [9 0]]) ) #'user/all-pairs user> (apply map (partial map +) all-pairs) ((6 8) (10 12) (14 6)) -- Eric Ulises writes: >> A littl

Re: reducing terms in vector

2010-10-28 Thread Ulises
> A little stuck on how to do this efficiently.  I have data that looks > like this > > ( [ [1 2] [3 4] [5 6] ... ]  [ [5 6] [7 8] [9 0] ... ] ...) > > I am trying to sum the vector pairs, e.g > > [6 8] [10 12] [14 6] Try: user> (def all-pairs '([ [1 2] [3 4] [5 6] ] [[5 6] [7 8] [9 0]]) ) #'use

reducing terms in vector

2010-10-28 Thread Glen Rubin
Hi! A little stuck on how to do this efficiently. I have data that looks like this ( [ [1 2] [3 4] [5 6] ... ] [ [5 6] [7 8] [9 0] ... ] ...) I am trying to sum the vector pairs, e.g [6 8] [10 12] [14 6] thx! -- You received this message because you are subscribed to the Google Groups "Clo