Re: Literal for plain style string

"Clark C. Evans" <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On Thu, Aug 09, 2007 at 03:11:11PM -0700, Ingy dot Net wrote:
| On 09/08/07 09:32 -0400, Clark C. Evans wrote:
| > As much as this is a good idea, I'm afrid it'd be very hard to just make
| > this change -- it would require a directive at the very minimum.
| 
| Clark, can you state why you think it would be hard? Not that I don't believe
| you, but at this point it's just handwaving.

Agreed, it is handwaving, since the proposal isn't detailed enough to
give a cost estimate.  That said, on the face value, it seems to be a
very ambitious proposal. 

As I understand the idea, we'd completely re-think the plain style, which
combines a single-line form and a multi-line form (or, both, starting on
the first line and then continuing on to subsequent lines).  Assuming
that we could agree on the semantics, it'd be a very large set of
changes both to the specification proper as well as regression tests
and the implementation.

| I think the directive could be
|     %YAML 1.1
| to get the old behaviour :)
| 

Well, as you state, most people don't use the header.  So, what is the
likely impact be?  Consider,

    ---
    - This is a paragraph
      that continues on the
      third line.
    - this is a # comment
    -
      # this is also a comment
      but this isn't

This is currently equivalent to:

    ['This is a paragraph that continues on the third line.',
     'this is a', "but this isn't"]

I'm not exactly clear what the proposed rewrite would be.  But, I'm
certain it would change the meaning of a great deal of content out
there.  I'm not convinced that value in the improvement would be worth
the cost.   I think we have smaller refinements I'd rather tackle before
we explored this one further.

Thanks for listening,

Clark

| > On Wed, Aug 08, 2007 at 02:44:01PM -0700, TRANS wrote:
| > | I would like to make a repeated proposal that a future version of YAML
| > | make the plan style string literal vs. the current folding.
| > | 
| > | I suggested this before b/c it better suited using YAML as a means of
| > | storing programming code b/c many programming languages use a new line
| > | to indicate the end of a statement. The repetitive use of '|' was
| > | unsightly and easy to forget.
| > | 
| > | Now I have discovered another use. I use YAML for configuration files
| > | as much as possible. But a simple line by line list is generally too
| > | convenient to replace with YAML. However if the default string style
| > | were literal, then such a file would already be vaild YAML (I make an
| > | exception for the mandatory %YAML directive b/c implementations tend
| > | not to enforce this.) In other words a file that looked like:
| > | 
| > |   some/file/path1
| > |   some/file/path2
| > |   some/file/path3
| > | 
| > | could be loaded by YAML and would look just as the original file
| > | appears. Currently, the specification causes all these lines to merge
| > | into one line which, obviously, makes the entries ambiguous and
| > | useless.
| > 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.