From: Gavin Sinclair Date: 2003-01-16T00:53:08+09:00 Subject: Re: ruby-dev summary 19198-19345 On Thursday, January 16, 2003, 2:39:54 AM, Matt wrote: > matz@ruby-lang.org (Yukihiro Matsumoto) writes: >> Nobu already made a patch to implement it. I feel like it can make >> programs more cryptic. "<<-|FOO"?? WHAT DOES IT MEAN? > I just though, why not "<<|FOO". In other words, the '-' in there > doesn't serve much purpose. > s = <<|FOO > |this > | is > | my > | text > FOO To me, the '-' means the same that it always does: it allows the end-of-document marker to be indented. I don't see why that should change. In other words, the example given above is an incomplete here-document, based on the assumption in the following section. What happens if a here-doc is specified to have the left margin ('|') but for one or more lines it is not used, as in: s = <<-|EOS | One | Two Three | Four EOS puts s I think the correct output is: One Two Three Four (end of output) In that case, it's pretty easy to see what becomes of the quoted example at the top. The fifth line is " FOO". At the end of the day, the "-" and (proposed) "|" features of Ruby here-documents are independent of each other. Gavin