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

Eliot Miranda eliot.miranda at gmail.com
Thu Nov 15 15:29:53 UTC 2018


Hi Benoît,

> On Oct 31, 2018, at 7:40 PM, Benoit St-Jean via Squeak-dev <squeak-dev at lists.squeakfoundation.org> wrote:
> 
> Interesting!
> 
> 
> As a comparison:
> 
> Squeak 5.2
> (0 to: 1) = (0 to: 5/3). "true"
> (0 to: 1) hash = (0 to: 5/3) hash. "false"
> 
> Dolphin 7
> (0 to: 1) = (0 to: 5/3). "true"
> (0 to: 1) hash = (0 to: 5/3) hash. "false"
> 
> VisualWorks 8.1.1
> (0 to: 1) = (0 to: 5/3). "true"
> (0 to: 1) hash = (0 to: 5/3) hash. "true"
> 
> Pharo 5.0
> (0 to: 1) = (0 to: 5/3). "true"
> (0 to: 1) hash = (0 to: 5/3) hash. "false"
> 
> I don't have VAST installed on the PC I'm using right now.  I'd be curious to see how other Smalltalk and/or GemStone handle this?  So far (according to what I could test, only VW is right (according to the ANSI standard and just plain logic!)
> 
> I wonder how much code relies on this "behavior" out there!
> 
> But the ANSI Smalltalk draft is very clear on this (revision 1.9, page 53, http://wiki.squeak.org/squeak/uploads/172/standard_v1_9-indexed.pdf):
> 
> "If the value of receiver = comparand is true then the receiver and comparand *must* have equivalent hash values."
> 
> That's what I always thought (or was taught or even read in the Blue Book).  Was this something that was changed at some point???

Nothing was changed.  It’s simply people not realizing there is a bug there.  Hence the value of Chris’ tests.

> ---------------- 
> Benoît St-Jean 
> Yahoo! Messenger: bstjean 
> Twitter: @BenLeChialeux 
> Pinterest: benoitstjean 
> Instagram: Chef_Benito
> IRC: lamneth 
> Blogue: endormitoire.wordpress.com 
> "A standpoint is an intellectual horizon of radius zero".  (A. Einstein)
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181115/920eb77f/attachment.html>


More information about the Squeak-dev mailing list