Incongruent hash

David N. Smith dnsmith at watson.ibm.com
Mon Feb 9 22:49:14 UTC 1998


At 12:10 -0500 2/9/98, Eliot & Linda wrote:
>Travis or Kerrin Griggs wrote:
>>
>> Eliot & Linda wrote:
>>
>> > I shouldn't have spoken so soon.  I've just noticed that in VisualWorks
>> >         1 at 1 = 1
>> > but
>> >         (1 at 1) hash ~= 1 hash
>> > :(
>> >
>> > One more thing to fix...
>>
>> So, how are you going to fix it? I find use in being able to perform the
>> four basic math ops between Points and simple Numbers, but I have never
>> had reason to find out if 1 at 1 was equal to 1, and not only that, I don't
>> think it should be. This (again) seems like we're playing slave to a
>> flawed class heirarchy (not that I have any great alternatives to offer).
>
>I don't think it is anything to do with a flawed class hierarchy.
>Smalltalk's behaviour is independent of the class hierarchy (provided
>one removes isKindOf:).  Its to do with the coercion framework between
>numbers and points.  It seems reasonable to be able to do
>    1 at 2 * 3
>
>Then one has to weigh surprise against complexity in extending this to
>    1 at 2 = 1
>
>Since its certainly possible to implement an acceptably efficient hash
>that preserves n asPoint hash = n hash and gives good distribution for
>points with x ~= y I would choose least surprise.
>
>_______________,,,^..^,,,_______________
>Eliot

I disagree: a point is NOT a magnitude.

Dave


_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author
and not of his employer.





More information about the Squeak-dev mailing list