Newbie Question: Class Variables?

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Sat May 27 21:57:51 UTC 2000


On Thu, 25 May 2000, Bob McCrory wrote:

> I've been working with a class and I just added two class variables.  
> However, my instance methods don't seem to be able to recognize these
> variables as anything but nil.  I did add a class method to initialize
> them and they show up properly initialized when I inspect the class.  
> Any suggestions?  What am I doing wrong?

Sounds okay so far. If the classPool dictionary correctly shows the
values, the class vars are indeed properly initialized. But you're saying
that on the instance side, their value is nil? For example, when selecting
and inspecting it in the browser?

It might happen (although it is very unlikely) that the instance method
references another "copy" of the class variable binding. Recompiling the
method should fix this. It's also a good idea to inspect Undeclared in
such cases. If this still does not help, inspect the literals of the
compiled method. Or better, ask again and send some source code
demonstrating your problem ;-)

-- Bert

PS: Sending your emails as plain text only would be a Good Thing :-)





More information about the Squeak-dev mailing list