[squeak-dev] DateAndTime hashing

Chris Muller asqueaker at gmail.com
Mon Jan 7 19:36:10 UTC 2019


>> > > Name: Kernel-eem.1198
>> > > Author: eem
>> > > Time: 24 November 2018, 1:44:47.526422 pm
>> > > UUID: 100137c4-2514-4b7f-9064-3dcdfe7d8cc9
>> > > Ancestors: Kernel-eem.1197
>> > >
>> > > Redefine LargePositiveInteger hash for compatibility between 32-bit
>> > > and 64-bit systems.
>>
>> Shouldn't the condition should be  ^self digitLength <= 4, instead of 8?
>
>
> Of c course not.  It should be that all integers of 64-bits or less are their rowen hashes.
>>
>>
>> See?
>>
>> 32-bit image
>>    1073741824 hash =    230045764
>>
>> 64-bit image
>>    1073741824 hash  = 1073741824
>
>
> No.  You must be using an un-updated image.  Here's what I get:
>
> Smalltalk wordSize 4
> (2 raisedTo: 63) hash = (2 raisedTo: 63) true
> (SmallInteger maxVal + 1) hash = (SmallInteger maxVal + 1) true
>
>
> Smalltalk wordSize 8
> (2 raisedTo: 63) hash = (2 raisedTo: 63) true
> (SmallInteger maxVal + 1) hash = (SmallInteger maxVal + 1) true

Whew!  You're right, and I knew I wasn't running an updated image, I
thought I could read and understand such little code while watching
some NFL playoff game, but I misread it.  :/   Sorry.

>> I must be missing something.  I can't believe we didn't notice this
>> and went into trunk before asking this question...
>
>
> Um, please.  I /did/ ask the question, I /did/ test.  I /do know/ that the idea is for integers of 64-bits or less be their own hashes.  Your result clearly indicates that you're using some erroneous configuration.

My question was directed at Dave and his question, not you (e.g.,
going in trunk and THEN asking about hash).  But, I can see how you
thought that by my not inlining properly, sorry.  I put a TON of hours
into testing UTCDateAndtime over the holidays.  I had to.

Best,
  Chris


More information about the Squeak-dev mailing list