Identity vs equality (was Re: [Newbies] Assignment)
Andreas Raab
andreas.raab at gmx.de
Tue Aug 14 06:39:58 UTC 2007
nicolas cellier wrote:
> This is one of my pets, and i'm glad to remind everybody that once
> symmetry is cured, = is still not an equivalence relationship, because
> transitivity is often broken.
>
> a := 2 raisedTo: 80.
> b := a asDouble.
> c := a+1.
> self should: [(a = b) & (b = c) ==> (a = c)].
Nice example. But in all fairness, transitivity isn't really broken in
the above because coercion is not a lossless operation. You are using
equality in a strictly mathematical sense and in this strict sense b and
c are not equal but only appear to be because of inexact coercion of c.
> In Squeak, we have all the elements for making a decision,
> implementation are ready in mantis, the thread have been over-discussed,
> we just need an authority to choose, or vote if some prefer democracy.
I don't remember the thread. Where is it?
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|