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

Chris Cunningham cunningham.cb at gmail.com
Fri Oct 26 22:21:20 UTC 2018


Hi.

I'm slowly (very) working towards crating a usable test for validating for
classes where #= is true, #hash will also be true.

Last week, the Date issue showed up.  This week?
Intervals:
   (0 to: 1) = (0 to: 5/3). "true"
   (0 to: 1) hash = (0 to: 5/3) hash. "false"
CharacterBlock:
   | cb1 cb2 |
   cb1 := (CharacterBlock new stringIndex: 5 text: 'StandardText' asText
topLeft: (100 at 100) extent: (20 at 20)).
   cb2 := (CharacterBlock new stringIndex: 5 text: 'StandardText' asText
topLeft: (200 at 200) extent: (20 at 20)).
   cb1 = cb2. "true"
   cb1 hash = cb2 hash. "false"

These were found by comparing a random sampling of instances of classes
that implement #= or #hash (or both), and finding which have these deviant
properties.  The hard part is figuring out instances that are going to have
issues - Date didn't show up in my prototype scanning.  Also most classes
don't have instances floating around to compare.

Thanks,
-cbc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181026/4d3db5aa/attachment.html>


More information about the Squeak-dev mailing list