Pharo By Example
only in this topic
Open this post in threaded view
On page 88 and 89, "hash" is referenced, in terms of "it should be implemented", alongside of ">" and "<" methods.
Then on 168 and 169, "hash" comes up again, in terms of being overridden.
It's not explained, however, what "hash" should do. The best clue is
"If you override =, you should consider overriding hash. If instances of
your class are ever used as keys in a Dictionary, then you should make sure that instances that are considered to be equal have the same hash value:"
That gives a strong hint, but it could really use some elaboration.
Sbe-discussion mailing list
Return to Pharo By Example
1 view|%1 views
Free forum by Nabble
Edit this page