[squeak-dev] Re: The Trunk: Network-ar.82.mcz

Frank Shearar frank.shearar at angband.za.org
Thu Sep 2 11:59:23 UTC 2010


On 2010/09/02 13:19, Bert Freudenberg wrote:
>
> On 02.09.2010, at 13:00, Frank Shearar wrote:
>
>> On 2010/09/02 12:45, Bert Freudenberg wrote:
>>>
>>> However, the registry should be a class variable not class inst variable IMHO.
>>
>> Network-fbs.86 does this.
>>
>> I'm not entirely sure what the difference is between a class variable and a class inst variable. I understand that the latter is an instance variable of the object "Foo class", but what's the practical difference between the two? When do you, or should you, use a class inst variable, and when not?
>
> A class inst variable has a different value in each subclass. A class variable is shared between all subclasses.

And now that I think about this, it seems rather obvious. Each class is 
an object, so a class instvar on Url cannot be an instvar on GenericUrl 
class. Without an accessor method, GenericUrl cannot access any class 
instvar on Url (leaving aside #instVarAt: and friends).

frank



More information about the Squeak-dev mailing list