From: Oren Ben-K. <or...@ri...> - 2002-05-01 13:41:20
|
Brian Ingerson [mailto:in...@tt...] wrote: > ysh > --- > yaml> empty text: > yaml> empty map: !map > yaml> empty seq: !seq > yaml> : empty key > yaml> empty in in-line map: { : } > yaml> empty in in-line seq: [ , ] > yaml> ... > $VAR1 = { > '' => 'empty key', > 'empty in in-line seq' => [ > '' > ], > 'empty seq' => [], > 'empty text' => '', > 'empty in in-line map' => { > '' => '' > }, > 'empty map' => {} > }; > > Oren, I don't see the ambiguity. The *final* comma (when > followed by no content) is ignored. That's the way I've > always understood it. (obviously) It works like this. empty map: [] map with one entry: [ "" ] map with two entries: [ "", "" ] It is valid to specify an empty string in the simple style, so I can write: another map with two entries: [ , "" ] So, one would expect that it would be possible to use the simple empty string for the second entry: map with ??? entries: [ "", ] Only this causes the second entry to disappear. Or does it? The productions are ambiguous - and so is the intent. We could rule that it is invalid to specify a simple empty string as the last value in a list, unless it has some properties... two entries: [ , !something ] one entry: [ , ] Ugh. I don't like the looks of this much. Hence I didn't consider it as an alternative... > > I vote for the second, because it already works... and all the good > > stuff you mentioned like readability. > > Now honestly, I wouldn't mind getting rid of this property. The extra > comma (as Oren pointed out) is only interesting in multi line > contexts, which YAML doesn't have. OK. > I vote for the first, because it already works... and all the good > stuff you mentioned like simplicity. So, we have one "tend towards explicit" and one "tend towards simple". Which moves the ball to Clark's court... Clark? Have fun, Oren Ben-Kiki |