Last updated at 12:02 pm UTC on 17 January 2006
Variables are defined in a class definition, a template follows:
Object subclass: #NameOfSubclass
Class variables may be referenced in
- instance methods of the defining class
- class methods of the defining class
- instance methods of any sub-classes of the defining class
- class methods of any sub-classes of the defining class
- Class variables may not be overridden (no sub-class may redefine an existing class variable name either by an instance variable name or class variable name.
- Class variable names may not be any of the Reserved identifiers (i.e., nil, true, false, self, super)
- Class variable names must start with an upper case letter.
- Class variables are initially set to nil
- Class variables are never reset to nil automatically (i.e., if you would like what they hold to get garbage collected you better reset it to nil yourself)
- Class variables continue to hold their value even if no instance of the class exist
- allClassVarNames (e.g., Test1 allClassVarNames –> a Set(#DependentsFields #Classvar))