Support of algebraic operations on sets

Bert Freudenberg bert at freudenbergs.de
Sat Jun 16 09:12:26 UTC 2007


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.

Not having Dictionary be a Set subclass seems a lot cleaner to me  
than trying to patch it up with more overrides.

- Bert -





More information about the Squeak-dev mailing list