Oren Ben-Kiki | 1 May 2004 20:30
Gravatar

Re: indent escape?

On Saturday 01 May 2004 21:05, Clark C. Evans wrote:
> | Or another one closer to heredoc which perl and php are used to:
> |   - ginving another url: |<<
> | http://www.another-url.org/this_link_is_far_too_long_for_mail_client_to_a
> |llow_spaces.html # and cutting this line would broke the link
> | <<
>
> This is our most frequently proposed feature.  I suppose that it
> isn't any more ugly than double quoted strings...  Brian/Oren?

We have considered this, at one time. You can have the same effect by using an 
indented literal scalar. The benefit of the "terminated" style is that you 
don't need to indent the scalar. From a YAML point of view, that's a 
disadvantage; the document structure becomes much less visible.

It almost seems as though this should be a flow style rather than a block 
style, since it uses a marker rather than indentation to denote structure. 
The following doesn't make much sense, though:

	---
	some:
		flow: { terminated: <<EOF
	Text
	EOF}
	...

Perhaps if someone comes up with a use case where indenting the text is a 
problem? The problem isn't long lines (for these, you need to use double 
quotes anyway). Admittedly, indenting literal scalars costs screen real 
estate, but they have to be pretty deeply nested for this to make a real 
difference (you can indent each level by just one space if you want).

What's the use case?

Have fun,

	Oren Ben-Kiki

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

Gmane