When are 2 CompiledMethods = [incl: Float>>nan]

Paolo Bonzini bonzini at gnu.org
Thu Sep 13 07:02:01 UTC 2007


Andreas Raab wrote:
> Hi Klaus -
> 
> Revert Association>>= to what it used to be and everything will be fine 
> (Association>>= is really, really badly broken; it causes problems all 
> over the places and this is one of them).

Just for the record, here is how I implemented Association>>#= in GNU 
Smalltalk to avoid this precise problem (though I don't exclude it 
introduces others):

= anAssociation
     "Answer whether the association's key and value are the same as
      anAssociation's, or false if anAssociation is not an Association.
      As a special case, identical values are considered equal even if
      #= returns false (as is the case for NaN floating-point values)."
     self class == anAssociation class ifFalse: [ ^false ].
     self key = anAssociation key ifFalse: [ ^false ].
     self value == anAssociation value ifTrue: [ ^true ].
     ^self value = anAssociation value

Paolo



More information about the Squeak-dev mailing list