From: Tom Sawyer Date: 2002-08-10T05:03:16+09:00 Subject: Re: ambiguity between local variable assignment and writter method On Fri, 2002-08-09 at 13:30, Dave Thomas wrote: > This is an interesting issue: should internal users go via the setter > method or access the instance variable directly. Clearly it depends on > the circumstances, but I often find myself writing accessors that do > things such as lazy evaluation, or which set dirty flags for > persistent objects, and where I really do need to go via the method > form. For those times, it's nice to have a shortcut, but it isn't > something I'd fight hard for... :) well i think the shortcut of .setter is really backways-around, not really fumigating the "smell". though certainly it is at least a bit cleaner. the fact that all other methods get picked up without using self, just smacks of EXCEPTION. the exception for #setter= methods, and exceptions always smack of smell. why couldn't ruby just check to see if there was such a setter method first, prior to assuming it a local variable assignment? the only consequence of this would be that you could not use local variable names identical to your method names. something i tend to do anyway. ~transami