Tips and tricks?

Andreas Raab andreas.raab at gmx.de
Tue Mar 9 20:04:00 UTC 2004


> Nu, so what was the trick?

Q: Say you have an extension in some class which requires an extra class
variable. How would you get that class variable into a system, given that MC
doesn't really track such changes?

A: You make a class side #initialize methods which looks like:

Foo class>>initialize
    "Make sure that the class variable is present"
    (self classPool includesKey: #MyVariable) ifFalse:[
        self addClassVar: #MyVariable.
    ].
    MyVariable := 42.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list