From: Clark C. E. <cc...@cl...> - 2004-09-09 00:24:07
|
On Wed, Sep 08, 2004 at 03:32:53PM -0400, T. Onoma wrote: | "This is a situation where the Python mapping and its native types | fail to behave how the YAML Model specifies. For these sorts of | icky cases where the native binding doesn't match YAML's _semantics_ | ..." [my emphasis] | | So YAML is doing exactly what it's supposed to keep it's nose out of. YAML has 3 models - Presentation, Serialization, and Representation. These models are there to help implementations, make as YAML interoperable as possible with various environments, and to provide a language to describe generic processes, such as a Schema language. Without a formal model these things are all very difficult, and the only fallback is 'the semantics is the code'. When you do this, you assume one code base, one implementation. | Force that semantic value and you're forced to tame an unruly | transformation --that's too bad, since there is quite a natural --even | proper, one. The YAML model specifies what _information_ the YAML Processor should deliver to the Application. It does not force any semantics on the Application, in particular, it can transform to its hearts content. | No, !bingles is very real. In the last draft proposal I fixed this. There is no way to explictly type a ?scalar in the YAML syntax, for example !?scalar is actually '!?scalar' != '?scalar'. So, we avoid that whole bag of worms. | To be very clear, it really just boils down to this: | | - Add !!rel to the repository Provide me a thought-out specification for it, and I'll probably add it. We will not deny a thoughtful tag ;) | - Add a statement along these lines: "If the _recommended_ type | !!rel has been implemented, and upon resolution to native-type, | a '!variant-map' does not meet the requirements of yaml's !!map | (namely the inequality of keys), and also assuming no other | transformation has been specified explicitly for this tag, | then the _recommended_ behavior is to transform it into a !!rel. | If !!rel is not implemented then the recommended behavior is, by | necessity, to throw an error." You can post this as a separate 'recommendation' you have for post-YAML processors. If its a good idea, your module will catch fire and everyone will use it. Cheers! Clark |