From: Dossy Date: 2003-02-06T20:18:05+09:00 Subject: Re: %L, %l revisited On 2003.02.06, Tom Sawyer wrote: > > It's neither shoddy, nor "extra" :-) It's just how here-docs work. > > and how they are hardly ever used. i mean really am i wrong about that? when > was the last time you did: > > x = <<-EOS, 'add this' > to this > EOS > > that what is appended appears before what it is to be appended to, is what i > mean by "shoddy". I can't think of many places where I've used this feature of HERE docs, but if you do any automated unit testing with Test::Unit, you've probably used it. I definitely used it when testing up some HTML generation classes I wrote: assert_equal <<-EOT, myObject.toHTML, 'generate whole HTML doc from myObject' myObject this is my object EOT Yes, there are many different ways of accomplishing the same thing without using this specific "feature" of HERE docs, but having this feature made my test suite so much easier to read, IMHO. > always trade-offs. but i don't think the limitation of not being able > to chain methods to %L structure out ways the benefit of having > elegent margin control. but that's IMHO. If you like elegant margin control, go try programming Python. Then, tell me why you've decided to switch back to Ruby. :-) -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)