Bug: Use of == for arithmetic equality

tim Rowledge tim at rowledge.org
Tue Feb 14 00:25:29 UTC 2006


On 13-Feb-06, at 4:09 PM, Wolfgang Helbig wrote:
>
> Now, my question. Are SmallIntegers, Characters and Symbols in Squeak
> immutable objects in the sense of the above definition, i, e. not
> destroyable? If not, why and when was it changed in Squeak. If they  
> are
> still immutable, why is this planned to be changed?
SmallIntegers, Characters and Symbols are indeed immutable in Squeak.  
However, numbers in general are not quite the same; it is entirely  
possible to have several LargeIntegers with the same numeric value  
and that is one quite obvious case where using #== instead of #=  
could provide a surprise.
All one has to do is remember tat #== means 'is the same object' and  
#= means 'is an equal object' to see that confusion is not smart.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
If you think nobody cares about you, try missing a couple of payments.





More information about the Squeak-dev mailing list