Re: Converting list to Map

2010-06-27 Thread Mike Meyer
On Sat, 26 Jun 2010 15:54:34 -0700 (PDT) hsarvell wrote: > I tried to find something in core / on Google to do this but didn't, > here is what I have anyway: > > (defn lst-to-map [lst] >(reduce > (fn [hsh chunk] > (assoc hsh (first chunk) (last chunk))) > (hash-map) >

Converting list to Map

2010-06-27 Thread hsarvell
I tried to find something in core / on Google to do this but didn't, here is what I have anyway: (defn lst-to-map [lst] (reduce (fn [hsh chunk] (assoc hsh (first chunk) (last chunk))) (hash-map) (partition 2 lst))) Is there an easier/shorter way? -- You received th