3 ms·
I've implemented similarly constrained string representations for numerics for a config file format, but I ended up allowing both "1" and "1.0" so I could dis
by nly 10y ago
I've implemented similarly constrained string representations for numerics for a config file format, but I ended up allowing both "1" and "1.0" so I could distinguish integer and floating point literals ("1.00" was still forbidden, as was "0.0"... zero was stored in a specially tagged way).
The exponent syntax in JSON is fun because it allows numerous representations of 0 and 1 using e.g. 0e1 and 7e0
- seagreen 10y ago> I ended up allowing both "1" and "1.0" so I could distinguish integer and floating point literals Definitely the toughest call when making a JSON subset like this.