From: HarryO Date: 2001-10-27T08:14:32+09:00 Subject: [ruby-talk:23567] Re: Fast reply needed: class var trouble In article , "Robert Feldt" wrote: > 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. In other words, I would think the parser should always interpret that as being a call to the accessor method, in which case there would be no ambiguity. I can see that having "self.t = ..." available means that one can disambiguate things, thus leaving both interpretations open, whereas there would be no way I can think of to create the local variable if you made the precedence as I've suggested. Hence, can anyone see an example where it would make sense to define a local variable in a class method that overrides a class variable? I ask because my expectations are often different to those of others.