Use of == for arithmetic equality

Chris Muller chris at funkyobjects.org
Tue Feb 14 20:59:26 UTC 2006


Hi Diego!  I agree with the spirit of what you're
saying; that 

> Only a small set of objects can
> answer for equality in
> a senseful way.

and that many designs override = in a non-sensical way
that can end up being costly.  And not just to the
software, it has the psychological effect of causing
people to think of the "data" instead of their
"objects."

However I think its necessary to have "equality"
defined by default for all objects based on identity. 
Dan put it succintly:

> It is true that a==b implies a=b

There are many cases where logical equality for any
object is useful.  Any object, for example, should be
able to be put into a Collection and collections need
to ask logical equality on their elements to work
properly.

Regards,
  Chris






More information about the Squeak-dev mailing list