Re: The same tag for different kinds

Andrey Somov <[email protected]> Fri, 11 Mar 2016 09:18:29 +0100
Newsgroups gmane.text.yaml.general
Message-ID <CALbkv0cLSTdtZ7PRX5kBfDXO0EGe2eQPMUYgwNg2QT3acvwC_A@mail.gmail.com>
On Fri, Mar 11, 2016 at 1:30 AM, Oren Ben-Kiki <[email protected]> wrote:

> Presumably complain. What would it do with !!int {} ?
>

Yes, thank you. This is what I would like.
With the standard tags there is no question, it is a matter of consistency.
But for the _custom tags_ this is unclear in the specification (at least
for me).

At the moment SnakeYAML, PyYAML (and probably other processors) let users
define custom tags by providing a function Node => Object which is invoked
when the
custom tag is detected.
The interface is approx. like this:
register(<tag>, function<node => Object>)

Then this interface is incomplete. Registering the function _must_ specify
the node kind
register(<kind>, <tag>, function<node => Object>)

It also means that user may specify 3 different functions for each tag.

I think it is worth to mention it in the YAML 2.0 spec for clarity.

Andrey

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140

_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core