From: "Darryl L. Pierce" Date: 2011-10-05T02:11:49+09:00 Subject: Re: Operator Overloading On 10/04/2011 11:52 AM, Dave Aronson wrote: > On Tue, Oct 4, 2011 at 10:03, Brian Candler wrote: > >> (Of course, 'x' and 'self.x' are the same; you can write 'self.x' if you >> think it's clearer) > > Not quite. This is one of Ruby's little gotchas. A naked "x" will be > taken as a local variable in the method. If you want to use an > instance variable you *must* precede it with either "self." or "@". Sorry, Brian was right. Try it out in the context of the code sample he posted to see for yourself. -- Darryl L. Pierce http://mcpierce.multiply.com/ "What do you care what people think, Mr. Feynman?"