Safe pattern for creating new root classes

Lex Spoon lex at cc.gatech.edu
Fri Mar 24 17:20:26 UTC 2000


dpennell at quallaby.com wrote:
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
> 
> ------_=_NextPart_001_01BF95BB.792F23FE
> Content-Type: text/plain;
> 	charset="iso-8859-1"
> 
> > You beat me to it.  Besides being logical (the current way is, too,
> > IMHO), this adds real functionality.  If the superclass is 
> > not defined,
> > we can create a dummy class with the correct name to subclass from. 
> > That class should probably be a subclass of Object, but in 
> > any case, the
> > superclass of the new class won't be lost.
> 
> Or we could dynamically load the superclass...
> 


Where would you load it from?  The problem is when you say:

	A subclass: B

and A doesn't exist (yet).  Currently, B ends up as a new root class,
which probably wasn't intended.  It's especially problematic because
loading a future version of A, will not correct B's definition.



Lex





More information about the Squeak-dev mailing list