Substitutability, was Re: Finding the spirit of L-World

Joe Darcy joe.darcy at
Sat Feb 23 18:56:37 UTC 2019

On 2/23/2019 8:57 AM, Stephen Colebourne wrote:
> On Sat, 23 Feb 2019 at 13:43, Brian Goetz <brian.goetz at> wrote:
>> One piece
>> of this might be finding a different name for "value type", so that
>> "there are three kinds of values: refs, primitives, and values" didn't
>> sound so silly.
> That could work. (Avoiding the bikeshed)
> PS. How bad would it really be to change NaN == NaN to be true?
> Wouldn't any breakages be pretty minor?

No, not for floating-point code.

Way back in 1985 the IEEE 754 standard consciously defined == on NaN to 
be false. This is the canonical idiom for detecting NaN in terms of 
operations defined in the standard.

It is common for math library kinds of methods to have screenings for 
NaN up front and changing how the NaN-checking idiom behaves will cause 
the wrong branches to get executed.


More information about the valhalla-dev mailing list