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

Dale Henrichs dale.henrichs at gemtalksystems.com
Wed Sep 3 23:16:24 UTC 2014


Chris,

IIRC, by definition a NAN is not equal to itself...

Dale


On Wed, Sep 3, 2014 at 4:11 PM, Chris Muller <ma.chris.m at gmail.com> wrote:

> When could it happen?
>
> 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.
>
> Real world context:  When two DB clients change the same object in the
> exact same way, it's not a conflict.  If they change it differently,
> it is.
>
> They've both made the same reference to Float nan, but just asking if
> they made equivalent changes still reports false.  So I have to put in
> a complicated special check for NaN first..??
>
> Okay, I actually wrote:  (a==b or: [a=b]) but who would ever write
> that or not "simplify it" in teh future if they saw it?
>
> Comments?  Why shouldn't Float nan = Float nan?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140903/d900330d/attachment.htm


More information about the Squeak-dev mailing list