Re: reducing multiple sets

2010-05-23 Thread mikel
Thanks - I can see I have still got a way to go. mike On May 23, 2:38 am, Michael Gardner wrote: > On May 22, 2010, at 10:00 AM, mikel wrote: > > > Trying to get from here: > > #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } } > > to here: > > #{[3 2] [5 4] [4 3] [2 2] [3 3] }

Re: reducing multiple sets

2010-05-22 Thread ka
1:6 user=> (use '[clojure.set]) nil 1:7 user=> (reduce union #{} #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } } ) #{[3 2] [4 3] [5 4] [2 2] [3 3]} 1:8 user=> Thx -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: reducing multiple sets

2010-05-22 Thread Michael Gardner
On May 22, 2010, at 10:00 AM, mikel wrote: > Trying to get from here: > #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } } > to here: > #{[3 2] [5 4] [4 3] [2 2] [3 3] } > that is, combining the set of sets into one set. (apply clojure.set/union #{#{[3 2] [5 4] [3 3]} #{[4 3]

Re: reducing multiple sets

2010-05-22 Thread Stuart Halloway
'into' is one easy way: (reduce into #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } }) => #{[3 2] [4 3] [5 4] [2 2] [3 3]} Stu Hi, from a newbie!! Any help appreciated Trying to get from here: #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } } to here

reducing multiple sets

2010-05-22 Thread mikel
Hi, from a newbie!! Any help appreciated Trying to get from here: #{#{[3 2] [5 4] [3 3] } #{[4 3] [5 4] [3 3] } #{[3 2] [2 2] [3 3] } } to here: #{[3 2] [5 4] [4 3] [2 2] [3 3] } that is, combining the set of sets into one set. -- You received this message because you are subscribed to the Google