Where does "class new" come from?

Hans-Martin Mosner hmm at heeg.de
Tue May 16 17:48:49 UTC 2006


Torsten Sadowski wrote:

>Hello,
>
>this might be a stupid question but where does the "new" class method come
>from for object instantiation because I could find it neither in Object
>nor in ProtoObject. I just wanted to find out where "initialize" is called
>and what else might be done at object creation but now I'm completely
>baffled.
>  
>
All class objects inherit from Class, ClassDescription, Behavior.

So if you inspect "String class withAllSuperclasses" you'll find the 
complete inheritance chain.

Behavior is where the #new method is implemented. This class basically 
defines the low-level stuff that's needed to describe and create instances.
ClassDescription, Class and Metaclass add stuff to organize classes and 
methods, and to create the metaclass system of Smalltalk.

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list