A warning on HandMorph|handleMouseOver:

Bob Arning arning at charm.net
Thu Sep 30 02:58:43 UTC 1999


On Wed, 29 Sep 1999 23:33:22 -0300 "Leandro Caniglia" <caniglia at dm.uba.ar> wrote:
>IMO this behavior is opposite to the stability of the system for one simple
>reason: the programmer who creates a Morph subclass must be aware of the
>fact that each morph is going to be included in a Dictionary and thus she
>must provide an infallible hash method.

Well, the problem extends a bit beyond that. ANY object whose hash can change over time (i.e. its hash is a function of mutable attributes) is a candidate for bad behavior in hashed collections (Set, Dictionary, whatever). If it gets inserted when its hash is one thing and you later try to see if it is there when its hash is something else, you have problems. The obvious solutions are not very nice. Who has a good one?

Cheers,
Bob





More information about the Squeak-dev mailing list