Re: Question about type tags
Oren Ben-Kiki <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <1254288722.5043.37.camel@nero> |
On Tue, 2009-09-29 at 10:13 -0700, William Spitzak wrote:
> Just to follow up, we are using tags.
>
> A big advantage so far is that the tag is optional and it is easy to
> ignore it when reading. This allows further compression by omitting the
> tag when the reader knows the type, which happens a lot, but it is still
> ok if the writer wrote the tag.
>
> This proposal:
>
> >>> - a: { name: nameofa, a: value of a }
> >>> - b: { name: nameofb, b: value of b }
>
> seems a little strange in that it looks like a list of objects with one
> member for each type.
It is exactly that: a list of mappings, each with a single key, and a
value which is a mapping with two keys (name and an additional one).
> If the second '-' was not there it would be
> setting both the 'a' and 'b' members and a yaml validator would think
> this is ok.
If there was no second '-' it would be a list of objects with one entry;
that entry would be a mapping with two keys.
Both of these are very different from a list containing two entries,
each being a tagged mapping with two keys (name and an additional one).
> I think the description of tag syntax is confused in the YAML
> documentation. Would prefer that the leading '!' be considered a token
> indicating a tag and the tag itself be the rest of the string (including
> any further '!' characters). I believe this matches much more how people
> use it. For instance I certainly store all my local tags with no '!' in
> them.
I think you are ascribing some magic to your example syntax that does
not actually occur. Tags are very different from mapping keys.
Have fun,
Oren Ben-Kiki
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf