I think that's an interesting idea, but well out of scope for the 1.2 spec, which is due to be released in a few days.

After 1.2 is out we can start talking about 1.3 and other interesting stuff.

Cheers, Ingy

On Sun, Apr 19, 2009 at 2:52 AM, Douglas Mayle <> wrote:
There was some discussion on this list about the new standard, and
while it's probably too late for such a change, I thought I'd mention
an idea I had related to default_flow_style (in PyYAML).

Because YAML supports other object types on the same line, the colon
is an ambiguous character. This means that when a human is editing a
YAML document, they have to take care to quote any strings containing
a colon, which introduces other issues.  For example:

I want to encode the sentence "Beef: it's what's for dinner" under the
'doc' key.  This would end up as:

doc: 'Beef: it''s what''s for dinner'

The string is quoted, and you have to escape the quotes. This is
because of the ambiguity cased by parsing:

       Beef: it's what's for dinner

I think YAML could be changed so that the default behavior encouraged
human editing over the compact form, without sacrificing the choice.

What I propose is using a double colon to indicate the compact form.
That way a human can type:

doc: Beef: it's what's for dinner

Which won't be confused with the second form, which becomes

doc:: Beef: it's what's for dinner

This way the user typing a sentence doesn't have to worry about the
sentence content.  The user who is trying to encode a more complex
object knows how to do so, and will use the double colon encoding...

Douglas Mayle

Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32.
Yaml-core mailing list