Consistent decimal semantics

P T Withington ptw at
Fri Aug 29 08:43:55 PDT 2008

On 2008-08-25, at 19:41EDT, Waldemar Horwat wrote:

> - Should decimal values behave as objects (pure library  
> implementation) or as primitives?
> If they behave as objects, then we'd get into situations such as 3m ! 
> = 3m in some cases and 3m == 3m in other cases.  Also, -0m != 0m  
> would be necessary.  This is clearly unworkable.

In Dylan this conundrum is dealt with either by interning (which could  
be done in JS by returning an existing object from the constructor),  
or by overriding == (Which is easy in Dylan because == is an open  
multi-method that can be extended by libraries, not yet in JS).

More information about the Es-discuss mailing list