Re: Question about type tags

William Spitzak <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Oren Ben-Kiki wrote:

> In general you can't force, or rely on, the order of the keys in the
> file. That is, in general someone may apply some tool to the file (say a
> pretty-printer) that will sort the keys alphabetically, or something,
> and then you'd be SOL. Using tags as in the previous example is the
> recommended way. Or, you may accept the overhead of creating the
> temporary structure.

Yes this is what I figured.

I am using the parser/emitter api to libyaml and I certainly do not want 
any temporary object, both because of the overhead and because it will 
throw errors in different than lexical order from the file.

> you _could_ mess up the file structure and do
> something like:
> 
> - a: { name: nameofa, a: value of a }
> - b: { name: nameofb, b: value of b }
> 
> But that's really just a dirtier form of tagging.

I guess that would work. It has the advantage that it works in json 
(though it looks ugly there), while if I use tags I will never be able 
to produce legit json.

Anyway I currently plan on using the tags.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
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.