RFC: std.json sucessor
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Mon Aug 25 12:42:06 PDT 2014
On 8/25/2014 6:23 AM, "Ola Fosheim Grøstad"
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Monday, 25 August 2014 at 13:07:08 UTC, Don wrote:
>> practice. So a JSON parser should at least be able to lex them.
>>
>> ie this should be parsable:
>>
>> {"foo": NaN, "bar": Infinity, "baz": -Infinity}
>>
>> You should also put tests in for what happens when you pass NaN or infinity to
>> toJSON. It shouldn't silently generate invalid JSON.
>
> I believe you are allowed to use very high exponents, though. Like: 1E999 . So
> you need to decide if those should be mapped to +Infinity or to the max value…
Infinity. Mapping to max value would be a horrible bug.
> NaN also come in two forms with differing semantics: signalling(NaNs) and quiet
> (NaN). NaN is used for 0/0 and sqrt(-1), but NaNs is used for illegal values
> and failure.
>
> For some reason D does not seem to support this aspect of IEEE754? I cannot find
> ".nans" listed on the page http://dlang.org/property.html
Because I tried supporting them in C++. It doesn't work for various reasons.
Nobody else supports them, either.
More information about the Digitalmars-d
mailing list