Re: YAML 2.0: drop arbitrary nodes to be used as keys
Oren Ben-Kiki <[email protected]> Wed, 2 Mar 2016 13:03:58 +0200
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <CADJiDhv2x-ypJzWRJ1As=+4Jtm9Y25poCR0YZdUMarKNLrBnrw@mail.gmail.com> |
I helps if you have an immutable data structure as a key - e.g., a complex number, a point, etc. Many YAML files can't be easily converted to JSON - anything with a tag, for starters... On Wed, Mar 2, 2016 at 12:23 PM, Andrey Somov <[email protected]> wrote: > Hi all, > even though it looks like a powerful feature, it gives nothing. > > This should be removed: > Note that YAML allows arbitrary nodes > <http://www.yaml.org/spec/1.2/spec.html#node//> to be used as keys > <http://www.yaml.org/spec/1.2/spec.html#key//>. In particular, a key > <http://www.yaml.org/spec/1.2/spec.html#key//> may be a sequence > <http://www.yaml.org/spec/1.2/spec.html#sequence//> or a mapping > <http://www.yaml.org/spec/1.2/spec.html#mapping//>. Thus, without the > above restrictions, practical one-pass parsing > <http://www.yaml.org/spec/1.2/spec.html#parse//> would have been > impossible to implement. > > The reason is not that it makes it impossible to convert YAML to JSON. > The reason is that it must never be used. YAML should not advocate > collections (often mutable data structures) as keys. > Of course, the related restrictions, like "1024 rule" or "key is > restricted to a single line", are also gone. > The key must be a scalar. Point. Whatever it is. > > Cheers, > Andrey > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Yaml-core mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/yaml-core > > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Yaml-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/yaml-core