I'm having trouble initializing class variables in Pharo. I started by creating a class with a single class variable:
Object subclass: #ClassVariableTestBehavior
instanceVariableNames: ''
classVariableNames: 'test'
package: 'DummyPackage'
And then on the class side I created an initialize message and set the variable to nil.
ClassVariableTestBehavior class >>> initialize
test := nil
I saved and then created an instance method:
ClassVariableTestBehavior >>> test
^ test
and went back again and changed the class method to be:
ClassVariableTestBehavior class >>> initialize
test := 34
In the playground I then printed the result of the following:
ClassVariableTestBehavior new test.
Which was nil. Why hasn't the value of the class variable updated to be 34?