Support of algebraic operations on sets

Bert Freudenberg bert at freudenbergs.de
Fri Jun 15 15:23:38 UTC 2007


Heh, you're the second one requesting it. Well, so maybe it should be  
added:

symmetricDifference: aCollection
	^ (self difference: aCollection), (aCollection difference: self)

- Bert -


On Jun 15, 2007, at 17:05 , Ron Teitelbaum wrote:

> Hey where's symmetricDifference?
>
> Ron Teitelbaum
>
>> -----Original Message-----
>> From: Bert Freudenberg
>>
>>
>> Because they are included in the standard Collection protocol, no
>> special need to implement them for Sets:
>>
>> #(1 2 3) asSet union: #(3 4 5) asSet "a Set(1 2 3 4 5)"
>>
>> #(1 2 3) asSet intersection: #(3 4 5) asSet "a Set(3)"
>>
>> #(1 2 3) asSet difference: #(3 4 5) asSet "a Set(1 2)"
>>
>> You should start using the protocol browser.
>>
>> - Bert -
>>
>>
>
>
>





More information about the Squeak-dev mailing list