Re: Why are tags tied to kinds?

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <1272590914.2330.21.camel@nero>
Hmmm. This is an old, old decision that came out of pretty esoteric
discussions about the information model and potential YPath/YSchema
issues. On a more pragmatic note, using the same tags for different
kinds makes all sort of processing be messier - today, when you know
something's tag, you know pretty much everything about it.

BTW, a little remembered fact is that URI fragments are allowed in tags.
So it is perfectly OK for you to do:

- !point#str (4, 5)  # Scalar
- !point#seq [4, 5]  # seq
- !point#map {x:4, y:5} # map

As far as YAML is concerned these are different tags, but in the application level (or for a human) it is pretty clear what is going on. Of course you could also use a normal path operator (/, -) instead of #, but # is a "stronger" indicator these tags are "the same".

Have fun,

    Oren Ben-Kiki

On Mon, 2009-12-21 at 21:22 +0000, Burt Harris wrote:
> The YAML representation model ties each tag to a Kind.   It seems to me that allowing several different Kinds for a tag might add to the human factors of the language.  For example, someone might want to allow different representations of a 2-D point:
> 
>   - !point (4, 5)  # Scalar
>   - !point [4, 5]  # seq
>   - !point {x:4, y:5} # map
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Yaml-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/yaml-core



------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.