Basic smalltalk browser question: class variables initialization

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Tue Dec 21 10:40:23 UTC 1999


On Sun, 19 Dec 1999, Piero Campanelli wrote:

> Hi.
> 
> I have a problem with class variables initialization. I made some classes
> with class variables that need to be initialized first time. So after class
> creation i do a:
> 
> 	MyClassName initialize
> 
> and all works !
> 
> But what happens when i 'File Out'  my sources for another running image ?

Squeak automagically places a chunk containing "MyClassName initialize" at
the end of your class file out (open it in a file list and have a look).

> When you do a 'File In' in a new image you have to remember to do a
> "MyClassName initialize". 

On file in, the code you filed out is executed, so "initialize" is sent to
your class. Isn't that great? :-)

  -Bert-





More information about the Squeak-dev mailing list