On 10 Dec 2013, at 07:52, James Clark <[email protected]> wrote:

> Infoset

Not a bad idea to lead us out of this quagmire.

So a JSON infoset would capture a processed AST, but not yet the transformation 
to the data model level.

JSON implementations would create the JSON data model from that infoset 
(typically without actually reifying the latter as an AST), and JSON extensions 
like ECMAscript's would be free to do whatever they want.
It is just important to distinguish the two, so people don’t confuse the data 
model with the infoset, or think that a JSON implementation needs to provide 
access to the infoset.

Re the infoset for JSON numbers:  That is clearly a rational, expressed as a 
pair of two integers: a numerator and a (power of ten) denominator.  (JSON 
cannot express any other rationals, or any irrationals for that matter.)

1.23 is [123, 100]
1.5 is [15, 10]
1e4 is [10000, 1]
1e-4 is [1, 10000]

Now one could argue whether the infoset should distinguish 1 and 1.0.
Naively, that would be
1 is [1, 1]
1.0 is [10, 10]
I’d argue that you want to reduce toward the denominator being the minimal 
power of ten, i.e.
1 is [1, 1]
1.0 is [1, 1]
1.5 is [15, 10]

Grüße, Carsten

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to