Autoload.st
changeset 8316 4023c53e9320
parent 8306 5b610781e787
child 8382 c3fe9de270ad
--- a/Autoload.st	Thu Apr 15 10:53:37 2004 +0200
+++ b/Autoload.st	Thu Apr 15 11:28:58 2004 +0200
@@ -100,6 +100,9 @@
         self setSuperclass:nil.
         ObjectMemory flushCaches.
     ].
+    LoadedClasses isNil ifTrue:[
+        LoadedClasses := IdentitySet new.
+    ].
 
     self ~~ Autoload ifTrue:[
         ^ self doesNotUnderstand:(Message selector:#initialize)
@@ -168,7 +171,7 @@
 
 basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:withPackage
     "print an expression to define myself on aStream.
-     Since autoloaded classes dont know their real definition, simply
+     Since autoloaded classes don't know their real definition, simply
      output some comment string making things clear in the browser."
 
     |myName fileName nm package|
@@ -407,9 +410,6 @@
 "/        ].
 "/    ].
 
-    LoadedClasses isNil ifTrue:[
-        LoadedClasses := IdentitySet new.
-    ].
     LoadedClasses add:newClass.
 
     "wow - it worked. now the big trick ..."
@@ -421,7 +421,7 @@
     self dependents do:[:aDependent |
         newClass addDependent:aDependent
     ].
-    Smalltalk changed:#aboutToAutloadClass with:(self -> newClass).
+    Smalltalk changed:#aboutToAutoloadClass with:(self -> newClass).
     self becomeSameAs:newClass.
     oldMeta becomeSameAs:newClass class.
 
@@ -463,7 +463,7 @@
 !
 
 classResources
-    "catch classResources - load the class and resend #error to the real one"
+    "catch classResources - load the class and resend to the real one"
 
     ^ self doesNotUnderstand:(Message selector:#classResources)
 !
@@ -504,30 +504,6 @@
     ^ self doesNotUnderstand:(Message selector:#error)
 !
 
-loadAndResendMessage
-    "common helper to autoload a class and define a subclass of it by sending
-     the sender-message again.
-     This is invoked by all #subClass... definition messages."
-
-    |sel args newClass|
-
-    sel := thisContext sender selector.
-    args := thisContext sender args.
-
-    "take care: subclassing Autoload must still be possible"
-    (self == Autoload) ifTrue:[
-        ^ self perform:sel inClass:Autoload class superclass withArguments:args
-    ].
-
-    newClass := self autoload.
-    newClass notNil ifTrue:[
-        ^ newClass perform:sel withArguments:args
-    ].
-    ^ nil
-
-    "Created: 8.2.1997 / 19:42:47 / cg"
-!
-
 new
     "catch new - load the class and resend #new to the real one"
 
@@ -762,6 +738,32 @@
     ^ self loadAndResendMessage
 ! !
 
+!Autoload class methodsFor:'private'!
+
+loadAndResendMessage
+    "common helper to autoload a class and define a subclass of it by sending
+     the sender-message again.
+     This is invoked by all #subClass... definition messages."
+
+    |sel args newClass|
+
+    sel := thisContext sender selector.
+    args := thisContext sender args.
+
+    "take care: subclassing Autoload must still be possible"
+    (self == Autoload) ifTrue:[
+        ^ self perform:sel inClass:Autoload class superclass withArguments:args
+    ].
+
+    newClass := self autoload.
+    newClass notNil ifTrue:[
+        ^ newClass perform:sel withArguments:args
+    ].
+    ^ nil
+
+    "Created: 8.2.1997 / 19:42:47 / cg"
+! !
+
 !Autoload class methodsFor:'queries'!
 
 accepts:aSignal
@@ -814,7 +816,7 @@
 loadedClasses
     "return the set of classes that were autoloaded"
 
-    ^ LoadedClasses ? #()
+    ^ LoadedClasses
 !
 
 privateClassesOrAll:allOfThem
@@ -826,13 +828,13 @@
 wasAutoloaded:aClass
     "return true, if aClass was autoloaded"
 
-    ^ LoadedClasses notNil and:[LoadedClasses includes:aClass]
+    ^ LoadedClasses includes:aClass
 ! !
 
 !Autoload class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.122 2004-04-08 10:54:15 werner Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.123 2004-04-15 09:28:58 stefan Exp $'
 ! !
 
 Autoload initialize!