[squeak-dev] #= ==> #hash issues

Chris Muller asqueaker at gmail.com
Thu Nov 15 21:32:09 UTC 2018


> Isn't this extremely simple to fix?
>
> #= is implemented in terms of start, step, and last.
>
> So why not implement #hash as
>
> ^(start hash bitXor: step hash) bitXor: self last hash
>
> Then in the postscript do a
>
> HashedCollection rehashAll
>
> and that should be it, right?
>
> I did a quick check using
>
> Dictionary allInstances select: [ :dict | dict keys anySatisfy: #isInterval]
>
> and the system seems fine after that.

You forgot about the universe that lies beyond the fringes of the
image.  There be persistent data files out there.  And users.
Possibly with systems that rely on Interval>>#hash.

But since most applications don't use non-Integer based Intervals
(since Interval doesn't really support them, by design, I guess),
there's no reason whatsoever to decimate the universe when Eliot's
simply fixes the corner case that no one is using anyway.

+1 to Eliots suggestion to fix Interval>>#hash.

 - Chris


More information about the Squeak-dev mailing list