Support of algebraic operations on sets

sig siguctua at gmail.com
Sat Jun 16 09:25:02 UTC 2007


On 16/06/07, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On Jun 16, 2007, at 9:10 , nicolas cellier wrote:
> > So creating a HashedCollection above both Set and Dictionary would
> > be an
> > interesting alternative.
>
> Possibly, yes. The main reason for Dictionary to inherit from Set is
> to reuse the hashing.
>
> The current inconsistencies come from Dictionary being a subclass of
> Set, but not behaving as a proper Set. One manifestation of that is
> #union: which relies on #asSet actually answering a collection with
> Set semantics.

A Set overrides a #union:, which is not using #asSet for this
operation anymore.

>
> Not having Dictionary be a Set subclass seems a lot cleaner to me
> than trying to patch it up with more overrides.
>
Honestly i can't see what must be overriden in Dictionary to make it
consistent with Set.
It's all about Association, which makes Dictionary to not comform with
sets semantics.
Maybe it's because i considering a Dictionary as set of keys with
associated values instead of collection of arbitrary elements, where
each one of them having unique key.

> - Bert -
>
>
>
>



More information about the Squeak-dev mailing list