JSON numbers (was: Revisiting Decimal)

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Thu Jan 15 19:46:52 PST 2009


David-Sarah Hopwood wrote:
> Brendan Eich wrote:
>> We are not condemned to repeat history if we pay attention to what went
>> before. JSON implementations in future ES specs cannot by default switch
>> either encoding or decoding to use decimal instead of number.
> 
> Of course not, but they can easily provide a non-default switch to do
> so.

I meant the preceding sentence to apply to decoding. It is simply
incorrect to say that JSON implementations in future ES specs could
not *encode* ES decimals as JSON numbers.

> They can also encode both ES numbers and ES decimals to JSON numbers,
> as Kris has already indicated that Dojo plans to do. (This encoding is
> lossy in general, but not necessarily lossy for a given use of JSON.)

-- 
David-Sarah Hopwood ⚥



More information about the Es-discuss mailing list