Es-discuss - several decimal discussions

Brendan Eich brendan at mozilla.org
Sun Aug 24 19:01:31 PDT 2008


On Aug 24, 2008, at 6:51 PM, Mark S. Miller wrote:

> On Sun, Aug 24, 2008 at 5:40 PM, Brendan Eich <brendan at mozilla.org>  
> wrote:
>> Why is eq being proposed whatever happens with Decimal?
>
> Because in the absence of decimal, === is close enough to an
> "identical" test that one can practically code around the problem
> cases (NaN and -0)

You're assuming 1.0m === 1.00m must be true. I'm disputing that (see  
exchange with Sam, who may agree).


>> We've been over this before, === is an equivalence relation  
>> excluding NaN.
>> It happens to put 0 and -0 in the same equivalence class. Why this  
>> is a
>> problem has yet to be demonstrated (add hashcode and then we can  
>> talk ;-).
>
> Until we add either hashcode or decimal, we can postpone the whole  
> topic.


I'm trying to avoid too much creature feep in any edition ;-). Other  
languages have near-universally-quantified hashcode analogues but  
solve NaN dilemmas by throwing (Python, IIRC). We can enlarge the  
language to be strictly more expressive, or we could enlarge  
equivalence classes under ===, or we could choose to make certain  
seemingly equal numbers !==. The rationale for excluding the last two  
alternatives when mooting Object.eq is not clear.

/be



More information about the Es-discuss mailing list