I am trying to study Pharo's internals and I am now curious how it stores
class variables.
I notice that in order to have a class `Greeter` with a "static" variable
`greeting`, I need to make `greeting` an instance variable under "show show
the class side" and create a "Getter" and "Setter" for this "instance
variable".
First thing that confuses me is, why is this called an instance variable if
this particular "static" method is not bound to any particular instance? Is
it just because it is defined in an "instance" of a "ProtoClass"?
Second thing that confuses me is, where are these pairs of ("instance
variable name" => "instance variable value") stored? I know that I can call
Transcript show:
((Greeter class) instanceVariables at: 1).
which prints "greeting".
and
Transcript show:
Greeter instanceVariables class.
which prints "Array"(curious, i expected a Dictionary mapping Strings to
Object).
Transcript show:
((Greeter class) instanceVariables at: 1) class.
prints "ByteSymbol".
Now I am confused, where are the actual values of the "static variables"
stored? I can find the names, but can't understand where the values are
hidden.
Can somebody help me understand this?
--
View this message in context:
http://forum.world.st/How-does-Pharo-store-instance-variables-tp4917924.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.