From: Tom Sawyer Date: 2003-02-07T03:10:12+09:00 Subject: Re: %L, %l revisited On Thursday 06 February 2003 09:55 am, Hal E. Fulton wrote: > But he enhanced functionality without breaking > any existing functionality. It's the breakage > that I'm concerned with. elaborate, what's going to break? consider that the HERE document form of this was never fully worked out and %L, %l is a whole new construct. perhaps we should review, it all started with: [ruby-talk:50473]. In his idea, if you assign a character (except quotes) after the here-document indicator "<<-", All blanks and assigned character at the head of each line will be deleted. Here is a example assigning '|': p <<-|EOS | foo | bar EOS # => " foo\n bar\n". many showed initial support. note this is contrast to PERLs version: Paul Brannan wrote: "From what I can gather, the proposed perl solution would look like this in Ruby: p << " foo\n bar\n" (that is, strip any leading whitespace that is indented the same as the terminator)." but in reviewing a number of opions suggested that the Perl version is not as good. Gavin Sinclair brought up an interesting point in contrast to using a method to strip the tabs: "One more difference. tabto strips after string interpolcation, whereas here-doc does before it." Pe�a, Botp suggested it support mixture: s1 = <<|EOS |#{hi} | do not have the indenter | how are you? me, too.. but ruby takes care of me :-) EOS a number of suggestions were made at this point (many incompatible with current here docs). the most important point though was probably that the deliminator should be redefinable. but no specific solution was derived for this. that's when i suggested: %Q-| try | this which led to the %L form. and so.... -- tom sawyer, aka transami transami@transami.net