From: Gavin Sinclair Date: 2003-01-15T10:50:46+09:00 Subject: Re: ruby-dev summary 19198-19345 On Wednesday, January 15, 2003, 12:36:43 PM, Daniel wrote: > On Wed, 15 Jan 2003, Gavin Sinclair wrote: >> > p <<-|EOS >> > | foo >> > | bar >> > EOS >> > # => " foo\n bar\n". > [snip] >> Anyway. I want this functionality so bad I can taste it. > Gavin, maybe I'm missing something but I'm not sure I understand the > usefulness of this. The only example I can think of where I might like > this is when I have lots of indentation: > def function > if (condition) > p <<-|EOH > |Blah blah blah > |Blah blah blah > EOH > end > end Well, that's a good example! Here-documents can come up anywhere. > Is this the purpose of this feature? Or am I missing something? Even with little/no indentation, the proposed feature would be useful to me. I usually indent code in posts, but here will put is as if it were in a Ruby program. USAGE =<<-|EOU |Usage: froboz [-q] [-o DIR] files... | -q: quiet operation | -o: output to DIR | |(c) 2003 Widgets Co EOU --------- vs --------- USAGE =<<-EOU Usage: froboz [-q] [-o DIR] files... -q: quiet operation -o: output to DIR (c) 2003 Widgets Co EOU Being able to indent you text gives the same benefit as all indentation: highlights code structure. Gavin