On Tue, Jul 16, 2002 at 11:39:01AM -0700, Neil Watkiss wrote:
| Clark C . Evans [16/07/02 14:42 -0400]:
| > Hello all. Just to toss it out, I've been thinking of including a
| > special key for a node identifier, which would be unique within a YAML
| > document.
| This sounds similar to an anchor. Could the same be achieved with an anchor
| naming convention?
The problem (good thing) about anchors is that the anchor-name
doesn't round-trip. Also, with anchors, you can have duplicates
and only the last anchor keeps, this is a good decision. With
a identifier, you want each node to have a unique persistent
handle even if it isn't referenced. Thus, I think that these
two are totally othgogonal.
Also, there is nothing stopping an application from using "id"
for this purpose; if it were a special key, however, it would
allow various YAML tools to know about the unique identifier,
and thus perhaps help facilitate built-in lookup functionality.
If you wanted to merge the two, you could even say that the
*alias mechanism can use the value of one of these identifiers;
although I'm not certain if this is such a brilliant idea.
In short, I need a persistent document-wide unique identifier
for each node regardless of if it occurs more than once in the
tree. This is much like our // comment special key... it doesn't
impact the information model any, but does allow generic YAML
aware tools to treat it in a specialized manner. Since unique
identifiers are so very common, this seems useful to me and
probably worth the minor cost.
Note, like the comment special key, it doesn't change anything,
in the model or syntax, it just provides for a few special
concepts that YAML aware generic tools can leverage.
Clark C. Evans Axista, Inc.
XCOLLA Collaborative Project Management Software