From: Niklas Frykholm Date: 2001-10-27T19:51:50+09:00 Subject: [ruby-talk:23614] Re: Fast reply needed: class var trouble [HarryO]: > > The Real PoRLS (Principle of Roberts Least Surpris) here would be for > > Ruby to conclude that it cant be a local since it would be useless to > > declare a local when value never used. Something for rite matz? ;-) > > Maybe I'm missing something here, but I can't think of a case where I'd > want a local variable to override an accessor method like this. I > actually think that violates the POLS, since I wouldn't expect it. I strongly disagree... all variables should be local by default. Otherwise, when you wrote a method you would have to keep in mind all the accessors that existed in the class and the superclass to make sure one of your local variables didn't inadvertedly collide with one of them. Also, if you added a new accessor :t to the class, every method where you had previously used t as a local variable would suddenly break. // Niklas