Bool setter for std.json

Adam D. Ruppe destructionator at gmail.com
Mon Feb 24 10:33:48 PST 2014


On Monday, 24 February 2014 at 18:22:43 UTC, monarch_dodra wrote:
> Why does the JSON_TYPE enum have "TRUE" and "FALSE" to begin 
> with? Shouldn't it just be a single "BOOLEAN" type with two 
> values?

The json spec lists true, false, and null as distinct values:
http://www.json.org/


My guess is that since they are represented by javascript 
keywords (and come from the weakly-typed language), this makes 
the lexer and parser implementation match right up the JSON_TYPE 
thing.

so I don't really know, but the 1-1 correspondence with the 
keywords kinda makes sense to me.


More information about the Digitalmars-d mailing list