On 08 Dec 2013, at 19:57, Allen Wirfs-Brock <[email protected]> wrote:
> {
> "allenwb": "there is an objectively observable order to the members of a
> JSON object",
> "JSON WG participant 1": "It would be insane to depend upon that ordering",
> "allenwb": "not if there is agreement between a producer and consumer on the
> meaning of the ordering",
> "JSON WG participant 2": "But JSON.parse and similar language bindings don't
> preserve order",
> "allenwb": "A streaming JSON parser would naturally preserve member order",
> "JSON WG participant 2": "I din't think there are any such parsers",
> "allenwb": "But someone might decide to create one, and if they do it will
> expose object members, in order",
> "allenwb": "Plus, in this particular case the schema is so simple the
> application developer might well design to write a custom, schema specific
> streaming parser."
> }
Which by at least one JSON decoder*) is decoded as:
---
allenwb: Plus, in this particular case the schema is so simple the application
developer
might well design to write a custom, schema specific streaming parser.
JSON WG participant 1: It would be insane to depend upon that ordering
JSON WG participant 2: I din't think there are any such parsers
(For readability, this one encoded in YAML, another JSON extension.)
Nice demonstration of the point here.
Grüße, Carsten
*) ruby -rjson -ryaml -e 'puts JSON.parse(File.read("allen.json")).to_yaml'
>allen.yaml
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss