From: Robert Klemme Date: 2004-03-18T18:09:32+09:00 Subject: Re: why use heredoc in doublequotes? "Mark Hubbart" schrieb im Newsbeitrag news:C3ED58B4-783A-11D8-90E1-000502FDD5CC@mac.com... > > On Mar 17, 2004, at 9:14 AM, Simon Strandgaard wrote: > > > On Wed, 17 Mar 2004 09:18:30 -0700, Ara.T.Howard wrote: > > [snip] > >> ~/eg/ruby > cat heredoc.rb > >> s = 'foobar' > >> > >> p <<"<<" > >> #{ s } > >> << > >> > >> ~/eg/ruby > ruby heredoc.rb > >> " foobar\n" > >> > > > > I bet this can be useful for making an obscure compact quine. > > > > ;-) > > Since Ruby doesn't care what you use as delimiters, usually... > > >> %q delimited_with_spaces .inspect.display > "delimited_with_spaces"=>nil > >> %q delimited with plain 'ol tabs .inspect.display > "delimited with plain 'ol tabs"=>nil > >> %q > ?> and with newlines?!? > ?> .inspect.display > "and with newlines?!?"=>nil > >>%q^Hbackspaces are stranger yet^H.inspect.display > "backspaces are stranger yet"=>nil > >>%q^CBut the interrupt character really takes the > cake^C.inspect.display > "But the interrupt character really takes the cake"=>nil > > I beg you, though -- *please* don't take advantage of the fact that you > can delimit strings with interrupts!!! ;) This thread goes down the dark side of Ruby... *schudder* :-) robert