[squeak-dev] true hash

Bert Freudenberg bert at freudenbergs.de
Thu May 10 10:41:13 UTC 2012


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 -


More information about the Squeak-dev mailing list