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

Igor Stasenko siguctua at gmail.com
Tue Jul 28 15:58:52 UTC 2009


2009/7/28 Joshua Gargus <schwa at fastmail.us>:
> 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)
>

oops, i meant intersection.

> 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
>
>
>
>
>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list