From: Clark C. E. <cc...@cl...> - 2004-09-08 01:30:28
|
Sean, This proposal does two things: - It specifies that omitted tags are simply a syntax-shorthand for well known 'tags'. In my proposal, each tag is a private '!implicit-*' per David's suggestion. In Oren's syntax non-plain scalars are always 'tag:yaml.org,2002:str' and all other tags are NULL (which has the exact semantics as the empty string as far as comparison goes). This keeps the information model for 'post-parse/pre-load' the same as the YAML Graph Representation, instead of a custom model with a plain-scalar flag. Ick. - It also defines, for informational purposes only, a specific word 'resolution' to refer to the act of filling in these omitted tags using only the content of the node, and not doing anything else. In short, it defines a very limited transformation, nothing more nothing less. In particular, it doesn't say applications couldn't just leave the tags as-is or do an arbitrary transform that re-structures the entire input graph. (I think...) The proposal certainly doesn't require, or describe any intermediate 'default implicit typing phase'. Although implementations are welcome to provide such a thing. Does this help? Clark ... (older draft of this response) This is _not_ proposing any sort of a default resolution rules. On the contrary, it is just defining what 'resolution' means, for the sole purpose of human discussion; namely to differentate it from arbitrary 'transforms' which actually do change content. It also gives a specific syntax rule, but that's an entirely different issue (my !implicit-tags or Oren's ! empty tag, let's choose one, it doesn't matter which). On Tuesday 07 September 2004 16:34, Clark C. Evans wrote: > In particular, he would like it to consider the loading of, > > --- > integer: 23 > float: 3.4 > ... > into a document, > > --- !!map > !!str "integer": !!int "23" > !!str "float": !!float "3.4" to be an example of 'resolving' the tags. Just as it would be OK to resove the first document to: --- !my-map !my-integer "integer": !my-23 "23" !my-float "float": !my-3.4 "3.4" just as well. The idea that tags resolve, without changing the content, and only according to the tag's value is all that is important. That they resolve to is not the issue, its that nodes arn't added and scalar values arn't changed or dropped; in short, that the transform was limited to only filling in omitted tags. On Tue, Sep 07, 2004 at 05:22:15PM -0700, Sean O'Dell wrote: | With schemas doing validation and typing, it's not a long step for a | schema to do implicit typing, so maybe keep that option open for the | future. It's fine to have a default implicit typing phase, This is not talking about a default implict typing; it's just saying that some sort of typing happens to implicit nodes, and that such typing doesn't completely re-arrange the YAML graph. | but I'm not | sure those new rules and the whole !implicit thing maps well to | something like that. Why not just keep the phase simple? Perform the | yaml.org implicit typing *if* its the default namespace (prefix?) and | *after* all other transformation schemas have been run, and then apply | the "if it's untagged, it might become implicit" rulset but even then, | just make it !yaml.org!map, !yaml.org!seq, etc. This is an example of an application specific "resolution" rule, and not one that should be explained by the specification. If you want to do it this way, great. ;) Clark -- Clark C. Evans Prometheus Research, LLC. http://www.prometheusresearch.com/ o office: +1.203.777.2550 ~/ , mobile: +1.203.444.0557 // (( Prometheus Research: Transforming Data Into Knowledge \\ , \/ - Research Exchange Database /\ - Survey & Assessment Technologies ` \ - Software Tools for Researchers ~ * |