Shouldn't 2 hash = 2.0 hash? [LONG]
Tim Cuthbertson
timcuth at bellsouth.net
Fri Dec 3 00:05:56 UTC 1999
Snip...
>
>I disagree. A number of Smalltalk classes depend upon the '='/hash
property. Either '=' should be defined to be identity with the default
hash, or it should be redefined so as to assure the '='/hash
concordance.
>
>
Kent Beck's book on design patterns for Smalltalk is very specific in
stating that ANYTIME you define "=" you must also define a hash that
makes it work the way you intend. A reverse way of saying this is that
you should never depend on the inherited meaning(s) of equality.
Tim
More information about the Squeak-dev
mailing list
|