On May 27, 2007, at 17:14 , subbukk wrote:

Since classes are also objects
that are created when you 'accept' the definition (except that its variables are created from classVariableNames), so you can use them in class methods
immediately.

Not quite. Those variables are "class variables", which are global variables (global to the class and subclasses and all their instances). Their names start with a capital letter like every global variable in Smalltalk.

Like Bert explained in an earlier mail, use of classVariables is
very rare.

There is a difference between "class variables" (which are like "static" variables in other systems, so they get their fare share of use) and "class instance variables" (very rarely used indeed). You see "class instance variables" only when you switch the browser to the class side. "Class instance variables" have a different value in each subclass and are private to the class-side. Hence they are not global and have lower-case names.

- Bert -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to