From: "David A. Black" Date: 2004-08-24T19:49:19+09:00 Subject: Re: *with* block? Hi -- On Tue, 24 Aug 2004, Mauricio Fern�ndez wrote: > If the following syntax is acceptable > > my_obj.with do > x = 0 > y = 10 > width = 100 > height = 100 > _ > end > > you can make it 'setter-safe' (i.e. go through the normal attribute > setters instead of bypassing them and assigning to the iv.s directly) > trivially with Kernel#local_variables. If you're trying to fight back against Ruby's need for an explicit receiver in assignment-style method calls, I think you've won a bit of a Pyrrhic victory. That looks like a bunch of assignments to local variables; I wouldn't want to have to train my eye to find the word "with" and then figure out that Ruby's normal assignment behavior was temporarily suspended. That's a heavy price to pay for avoiding a few occurrences of the word 'self' (or 'some_obj', etc.). David -- David A. Black dblack@wobblini.net