Autoload.st
changeset 2 6526dde5f3ac
parent 1 a27a279701f8
child 3 24d81bf47225
--- a/Autoload.st	Fri Jul 16 11:39:45 1993 +0200
+++ b/Autoload.st	Mon Oct 04 11:32:33 1993 +0100
@@ -31,6 +31,15 @@
 written fall 91 by claus
 '!
 
+!Autoload class methodsFor:'queries'!
+
+isLoaded
+    "return true, if the class has been loaded; redefined in Autoload;
+     see comment there. this allows testing for a class been already loaded."
+
+    ^ false
+! !
+
 !Autoload class methodsFor:'loading'!
 
 autoload
@@ -46,7 +55,7 @@
     "remove myself - to avoid recompilation"
     Smalltalk at:mySym put:nil.
 
-    "load"
+    "load it"
     Transcript showCr:('autoloading ', myName , ' ...').
 
     Smalltalk fileInClass:myName.
@@ -56,12 +65,12 @@
     Smalltalk at:mySym put:mySelf.   "will be undone by become:"
 
     newClass isNil ifTrue:[
-        "no - reinstall myself"
+        "no - forget it"
         self warn:('autoload of ' , myName , ' failed').
         ^ nil
     ].
 
-    "wow - it did"
+    "wow - it did. now the big trick ..."
 
     self become:newClass.
     ^ self
@@ -107,8 +116,12 @@
 !
 
 subclass:a1 instanceVariableNames:a2 classVariableNames:a3 poolDictionaries:a4 category:a5
+    "catch subclass creation - this forces missing superclasses to be 
+     loaded first"
+
     |newClass|
 
+    "take care: subclassing Autoload must still be possible"
     (self == Autoload) ifTrue:[
         ^ super subclass:a1 instanceVariableNames:a2 classVariableNames:a3 poolDictionaries:a4 category:a5
     ].