Incongruent hash

Travis Griggs tgriggs at keyww.com
Tue Feb 10 00:29:04 UTC 1998



David N. Smith wrote:

> 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.

And I agree, or, er, uh, I disagree too.

Travis Griggs
Key Technology
tgriggs at keyww.com
To Smalltalk - And Beyond!





More information about the Squeak-dev mailing list