[Goodie] OrderedSet and OrderedDictionary

Derek Brans brans at nerdonawire.com
Thu Jun 12 19:36:59 UTC 2003


>
> Why not just inherit from OrderedCollection and override the basic add-
> methods (and at:put: and such) to test for the element's presence?
>
> Otherwise there's not much point in making it ordered.
>

I've done it both ways now (subclassing OrderedCollection and subclassing
Set).  One of the powerful things that Set provides is a fast lookup of an
object using hashing.  This is useful for dictionaries.

What is the best way to combine "order" with "quick lookup" in a single
Collection without keeping essentially two pointers to each element?

Derek

> --
> Brian T. Rice
> LOGOS Research and Development
> http://tunes.org/~water/
>
>
>




More information about the Squeak-dev mailing list