[squeak-dev] Re: intersection: method for dictionaries flaky

Joshua Gargus schwa at fastmail.us
Tue Jul 28 15:56:11 UTC 2009


Igor Stasenko wrote:
> so, if Dictionary is a subclass of Set, then , as any Set it should
> conform with Set rules, i.e.:
>
> (setA difference: setB) = (setB difference: setA)
>   

Forgive a small nitpick that doesn't affect your argument:  set
difference is not symmetric, neither in set theory nor in the
implementation in Collection.

#(1 2 3 4 5) difference: #(4 5 6 7 8)
gives #(1 2 3)

and #(4 5 6 7 8) difference: #(1 2 3 4 5)
gives #(6 7 8)

Cheers,
Josh


> and
> (setA union: setB) = (setB union:setA)
>
> where setA, setB could be any (sub)instance of Set.
>
> And if its not (as in fact Dictionary behaves), then it should not
> belong to Set hierarchy.
>
>
>   
>> HashedCollection
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-June/117894.html
>>
>> Nicolas
>>
>>     
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090728/a4892b7f/attachment.htm


More information about the Squeak-dev mailing list