[newbie] how does Object implement new?

Peter Crowther Peter.Crowther at melandra.com
Thu Mar 29 17:58:11 UTC 2001


> From: Karl Wilson [mailto:khwilson at bigfoot.com]
> How does Object (or ProtoObject) implement new?

Welcome to The Metaphysics of Smalltalk :-).

> When you write Box>>new (Box is a subclass of Object):
> 
> new
> 	^super new initialize.
> 
> where is the new that it is finding?

In 'Box class' (which is a Metaclass) or a superclass thereof.  Metaclasses
are how Smalltalk gets around the problem that you need a hierarchy of
instance methods that stops at Object, but somehow you need to do something
different with the code for classes.  Take a look at classes and
metaclasses.  http://wiki.cs.uiuc.edu/VisualWorks/How+do+metaclasses+work%3F
would be one place to look [yeah, I know, it says VisualWorks...]

		- Peter





More information about the Squeak-dev mailing list