[squeak-dev] true hash

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu May 10 11:21:38 UTC 2012


2012/5/10 Bert Freudenberg <bert at freudenbergs.de>:
>
> On 10.05.2012, at 01:40, Chris Muller wrote:
>
>>> How do these clients suddenly
>>> acquire new hashes for nil, true and false?
>>
>> I should add, it's already happened.  In 2009 Levente changed
>> Object>>#identityHash to answer the scaledIdentityHash.
>
> Not in Squeak. Our IdentityDictionary uses scaledIdentityHash nowadays, but identityHash itself is left alone, answering the primitive value directly.
>
> You may be thinking of Pharo, where you now need to use basicIdentityHash to get the primitive hash, and identityHash answers the more useful scaled value. Be aware though that Pharo also manipulates SmallInteger hashes where Squeak doesn't (yet, anyway).
>
> Did I mention it's a bad idea to depend on actual hash values? ;)
>
> - Bert -
>

Sure, I already changed various Number>>hash and could as well change
Point hash to follow recommendations from Andres valloud book hashing
in smalltalk...

Nicolas


More information about the Squeak-dev mailing list