From: Paul Lutus Date: 2006-10-23T20:25:24+09:00 Subject: Re: newbie: class attribute accessors? Diego Virasoro wrote: / ... > However, I would like to do something similar for class variables. So > for example in the above example, for @@NumberOfLegs. > > Is this possible? I don't think so (and I am certainly open to correction), and I think I know the reason. A class variable belongs to the class, not to any particular instance. The accessor shortcuts are meant to make instance variables available, but you need to think what would happen if any instance could change the class variables. Class variables are meant to hold values the entire class hold in common. These variables should not ordinarily be modifiable by any particular instance. Also, if accessor functions existed for class variables, this would essentially allow them to be modified globally, by anyone, without any of the usual protections. Further, such an accessor feature would exist at the class level, just like the variables it modified, so no instance would need to be created. Again, I could be wrong about this. -- Paul Lutus http://www.arachnoid.com