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] }
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
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]
'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
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