Re: How to Return Vector of Vectors

2011-07-22 Thread Ken Wesson
On Fri, Jul 22, 2011 at 8:47 AM, octopusgrabbus wrote: > > On Jul 21, 10:15 pm, Ken Wesson wrote: >> On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson wrote: >> > On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus >> > wrote: >> >> And do you have a suggestion for a functional way? > > Is all-csv-rows

Re: How to Return Vector of Vectors

2011-07-22 Thread octopusgrabbus
On Jul 21, 10:15 pm, Ken Wesson wrote: > On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson wrote: > > On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus > > wrote: > >> And do you have a suggestion for a functional way? Is all-csv-rows being re-bound with the results of [] and then returned as the fun

Re: How to Return Vector of Vectors

2011-07-22 Thread Ulises
An alternative is to use partition together with interleave: user> (partition 2 (interleave [ 1 2 ] [ \a \b ])) ((1 \a) (2 \b)) Combined with (map vec ...) you should get: user> (map vec (partition 2 (interleave [ 1 2 ] [ \a \b ]))) ([1 \a] [2 \b]) user> U -- You received this message because

Re: How to Return Vector of Vectors

2011-07-22 Thread octopusgrabbus
Thanks for the example. On Jul 21, 10:15 pm, Ken Wesson wrote: > On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson wrote: > > On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus > > wrote: > >> And do you have a suggestion for a functional way? > > > Yes. Change > > > (doseq [one-full-csv-row all-csv-ro

Re: How to Return Vector of Vectors

2011-07-21 Thread Ken Wesson
On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson wrote: > On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus > wrote: >> And do you have a suggestion for a functional way? > > Yes. Change > > (doseq [one-full-csv-row all-csv-rows] >  (let [accumail-csv-row one-full-csv-row >        q-param (zipmap accum

Re: How to Return Vector of Vectors

2011-07-21 Thread Ken Wesson
On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus wrote: > And do you have a suggestion for a functional way? Yes. Change (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (

Re: How to Return Vector of Vectors

2011-07-21 Thread octopusgrabbus
And do you have a suggestion for a functional way? On Jul 21, 8:05 pm, Islon Scherer wrote: > Simple: conj doesn't mutate the vector, it returns a new vector. > Clojure is a (mostly) immutable language, you're trying to solve the > problem in a imperative way, you should solve it in a functional

Re: How to Return Vector of Vectors

2011-07-21 Thread Islon Scherer
Simple: conj doesn't mutate the vector, it returns a new vector. Clojure is a (mostly) immutable language, you're trying to solve the problem in a imperative way, you should solve it in a functional way. On Jul 21, 7:48 pm, octopusgrabbus wrote: > (def accumail-url-keys ["CA", "STREET", "STREET2"

How to Return Vector of Vectors

2011-07-21 Thread octopusgrabbus
(def accumail-url-keys ["CA", "STREET", "STREET2", "CITY", "STATE", "ZIP", "YR", "BILL_NO", BILL_TYPE"]) (defn ret-params "Generates all q-parameters and returns them in a vector of vectors." [all-csv-rows] (let [param-vec [[]] ] (doseq [one-full-csv-row all-csv-rows]