Re: Is there any way to dereference %1 %2 etc?

2009-01-14 Thread Stuart Halloway
It doesn't make sense to mix map and println. If you want side effects, use doseq instead of map: (doseq [{a :a} [ {:a 1 :b 11} {:a 2 :b 22} {:a 3 :b 33}]] (println a)) {:a 1, :b 11} {:a 2, :b 22} {:a 3, :b 33} If you don't want side effects, use str instead of println (you could also use id

Is there any way to dereference %1 %2 etc?

2009-01-14 Thread wubbie
(map #(println %) [1 2 3 4]) prints 1 2 3 and 4 But what if the vector element is a hash with [ {:a 1 :b 11} {:a 2 :b 22} {:a 3 :b 33}]? can we dereference :a using %1, like (:a %1)? If not, any alternative? maybe destructuring or something? thanks -sun --~--~-~--~~~-