Hello, I've been looking at implementation of Associtation and LookupKey (its
superclass).
In LookupKey, there is LookupKey>>#= and LookupKey>>#hash both implemented
to use key (compare keys and use hash of key), but in Association,
Association>>#= compares both key and value, but hash is not changed there,
so only hash of key is used, therefore it does not correspond to
implementation of method = ... shouldn't it?
To demonstrate:
(1 -> #a) = (1 -> #b).
�� is false but
(1 -> #a) hash = (1 -> #b) hash.
�� is true
I also noticed similar discussion for Doplhin smalltalk
http://forum.world.st/Association-gt-gt-hash-td3368868.html where guys state
it is all right, but I still do not see why.
Jan
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
|
������ | Guille Polito Research Engineer Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - http://www.cnrs.fr Phone: +33 06 52 70 66 13 |