just playing around:
(#(1 2 3) asSet) difference: (#(1 2 3 4 5) asSet) a Set()
(#(1 2 3 9) asSet) intersection: (#(1 2 3 4 5) asSet) a Set(1 2 3)
(#(1 2 3 9) asSet) copyWithoutAll: (#(1 2 3 4 5) asSet) a Set(9)
(#(1 2 3 4 5) asSet) copyWithoutAll: (#(1 2 3 9) asSet) a Set(5 4)
(#(1 2 3 4 5) asSet) union: (#(1 2 3 9) asSet) a Set(1 2 3 4 5 9)
I think you'dlike aSet (4 5 9)
| set1 set2 difference |
set1 := #(1 2 3 9) asSet.
set2 := #(1 2 3 4 5) asSet.
difference := (set1 union: set2) copyWithoutAll: (set1 intersection: set2)
or
| set1 set2 difference |
set1 := #(1 2 3 9) asSet.
set2 := #(1 2 3 4 5) asSet.
difference := (set1 copyWithoutAll: set2) addAll: (set2 copyWithoutAll: set1)
That's just a quick try...
Cédrick
2007/12/12, itsme213 <
[hidden email]>:What collection type / message should I use for set difference? I can't seem
to find any :-(
Sophie