[squeak-dev] a==b "true" but a=b "false"

Chris Muller asqueaker at gmail.com
Thu Sep 4 23:00:54 UTC 2014


On Thu, Sep 4, 2014 at 2:39 PM, Andres Valloud
<avalloud at smalltalk.comcastbiz.net> wrote:
>>> A:  With Float nan.
>>>
>>>    Float nan == Float nan   "true"
>>>
>>>    Float nan = Float nan   "false"
>>>
>>> It violates what I have long considered an invariant that if a==b, then
>>> a=b.
>>
>>
>> Yep. We might want to fix that.
>
>
> I'm curious now.  Where did that long considered invariant come from?  I

It comes from a normal sense that an object is "equivalent" to itself.

> also know of a real application that defined, quite on purpose,
>
> SomeDomainObject>>= anObject
>
>         ^false

Well, I'm curious about the contexts.  What app considered an object
not equal to itself on purpose?

I get Eliots statement that, given all the different possible origins
of NaN, assuming equivalency is assuming too much.  But that's a
purists view; I think NaN, more generically, means, "could not be
calculated", and therefore, in terms of the vision any given system
has on a model, it's practical to TREAT the stuff outside its scope
equivalently.

We even do it as humans.  What is outside the scope of our awareness
is "equivalent" in terms of how we deal with it, even though it isn't.

"Awareness".  This seems to be getting philosophical!


More information about the Squeak-dev mailing list