From: "T. Onoma" Date: 2003-12-01T01:44:24+09:00 Subject: Re: Class-level readers and writers On Sunday 30 November 2003 12:11 pm, David A. Black wrote: > I don't think so. > > [...] > > > Or is that class local variable? Cause I'm not understand how @@a "will > > behave like today's class instance variables without the need of ``class > > attribute accessors''." > > Matz's description is: > > * class variables will be local to the class/module > * if you need to access class variables from outside, > define accessors > > (See .) > > So class vars will be able to do what they currently can't do, namely > maintain state on a truly per-class basis (as opposed to > per-hierarchy). The difference between them and a class's instance > variables, as I understand it, will be that the class variables are > visible from instances of the class. Thanks David, I'm actually starting to get dizzy 8-o. It would help, I think, if we lay this down cold for all to understand. Could you fix the following yummy class, to the best of your knowledge: class ClassVariableSoup class_local_var # scope is ? def variables local_var # scope is method @class_instance_var # scope is instance/ancestry @_local_class_instance_var # scope is instance @@class_var # scope is class+instance/ancestry @@_local_class_var # scope is class+instance # others ? end $global_var # scope if everywhere end Much Obliged, -t0