From: Brian I. <in...@tt...> - 2001-10-26 02:59:04
|
Just thinking... Now that we are using '-' for arrays, we might want to reserve '=' for tuples. Tuples are immutable lists, or constant arrays. At least that's what my Python friends tell me. Evidently, tuples are very important to these snakey people. tuple: = foo = bar Now, I think this is an implicit way of saying: tuple: !tuple - foo - bar Perl does not support tuples, so they would need to be downgraded to arrays, but that's ok. BTW, I assume we are completely rid of: foo: !class =: value Since that is easily represented as: foo: !class : value 20) Reserve '=' for implicit tuple serialization. Reserve !tuple as well. --- Hmmm. That makes me think of one more point. 21) I think the type indicator should immediately follow the colon or dash, even when the value is classed or anchored. regular string:: "Hello YAML" anchored string: &005 : "Howdy YAML" classed block: !my.text |- Y A M L --- regular string:: "Hello YAML" anchored string:: &005 "Howdy YAML" classed block:|- !my.text Y A M L I like the second production's syntax better. Perhaps we can allow either. --- I'm trying to think of a good rule for class names. We need the following: - Explicit (com.ingy.foo.bar) - Relative (.baz) - Reserved (tuple) - Private (.Data.Dumper) The problem with reserving '.' for Relative classes is that you don't how many of the nodes to inherit from the parent. Is '.baz' equal to 'com.ingy.baz', 'com.ingy.foo.baz', or 'com.ingy.foo.bar.baz'? I suggest using this: !3.baz to mean 'com.ingy.foo.baz', where 3 is the number of nodes to inherit for Relative classes. Perl will need Private class a lot. This just means my own personal class that I (possibly) generated on the fly. A object of the 'Data::Dumper' module could be serialized using: !0.Data.Dumper which could be shortened to just '.Data.Dumper'. I *will* need this kind of loosely defined class for Perl, BTW. Very important. Let's keep single words for Reserved YAML Core classes. 22) Let's use the following classnames: - !com.FatPort.foo "Explicit - fully qualified" - !2.bar.baz "Relative - 'com.FatPort.bar.baz'" - !.My.Class "Private - unregistered" - !date "Reserved - for YAML types" --- I also have the question of whether class names are case sensitive or not. My Private classes (Perl) must be. Domain names aren't. 23) Class names are case-sensitive. Any part of the name that is a real domainname *should* always be specified in lower case. More Cheers, Brian |