Re: YAML declarativeness

William Spitzak <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
You are right I think. Nesting of lists into a tree can be used for 
forward references, while anchor/tag used for backward ones. I missed 
this because I was using anchor/tag for all connections.

Is it true that any arbitrary directed graph can be reduced to a set of 
trees and a set of links that only go from nodes back to their ancestors 
in those trees? I'm thinking this is true but not so sure of my graph 
theory.

Clark C. Evans wrote:
> 
> On Feb 8, 2010, at 13:36, William Spitzak <[email protected]> wrote:
> 
>>
>>
>> Clark C. Evans wrote:
>>> On Sun, 07 Feb 2010 16:48 +0100, "Roald de Vries" <[email protected]>
>>> wrote:
>>>> Why is this not allowed in YAML:
>>>>
>>>>     - *id001
>>>> - &id001 some string
>>> We had a requirement that YAML shouldn't require processors to load 
>>> the entire document before linking and returning the result.  If you 
>>> permitted this, it'd complicate or rule-out any sort of streaming.
>>
>> So yaml cannot be used to store an arbitrary directed graph (ie with a 
>> loop)? It is limited to only directed acyclic graphs?
> 
> --- &cyclic
> - *cyclic # graphs are permitted
> ...
> 
> 
>> PS: In our program we certainly are allowing forward references, 
>> despite the fact that the data is a DAG, as the order of the items in 
>> the list is being used for other purposes (the stacking order in the 
>> display). I am also preserving the anchor/tag values in our data, 
>> which is also against the yaml spec, though...
>>

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
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.