Smalltalk.st
changeset 2159 b9255998a855
parent 2127 84a9ab84c94c
child 2169 780726f7a16c
--- a/Smalltalk.st	Sun Jan 12 01:11:11 1997 +0100
+++ b/Smalltalk.st	Mon Jan 13 17:05:55 1997 +0100
@@ -2119,131 +2119,6 @@
     ].
 !
 
-fileIn:aFileName
-    "read in the named file - look for it in some standard places;
-     return true if ok, false if failed"
-
-    ^ self fileIn:aFileName lazy:nil silent:nil logged:false 
-
-    "
-     Smalltalk fileIn:'source/TicTacToe.st'
-    "
-
-    "Created: 28.10.1995 / 17:06:28 / cg"
-!
-
-fileIn:aFileName lazy:lazy
-    "read in the named file - look for it in some standard places;
-     return true if ok, false if failed.
-     If lazy is true, no code is generated for methods, instead stubs
-     are created which compile themself when first executed. This allows
-     for much faster fileIn (but slows down the first execution later).
-     Since no syntax checks are done when doing lazy fileIn, use this only for
-     code which is known to be syntactically correct."
-
-    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false 
-
-    "
-     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
-    "
-
-    "Created: 28.10.1995 / 17:06:36 / cg"
-!
-
-fileIn:aFileName lazy:lazy silent:silent
-    "read in the named file - look for it in some standard places;
-     return true if ok, false if failed.
-     If lazy is true, no code is generated for methods, instead stubs
-     are created which compile themself when first executed. This allows
-     for much faster fileIn (but slows down the first execution later).
-     Since no syntax checks are done when doing lazy fileIn, use this only for
-     code which is known to be syntactically correct.
-     If silent is true, no compiler messages are output to the transcript.
-     Giving nil for silent/lazy will use the current settings."
-
-    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
-
-    "Created: 28.10.1995 / 17:06:41 / cg"
-!
-
-fileIn:aFileName lazy:lazy silent:silent logged:logged
-    "read in the named file - look for it in some standard places;
-     return true if ok, false if failed.
-     If lazy is true, no code is generated for methods, instead stubs
-     are created which compile themself when first executed. This allows
-     for much faster fileIn (but slows down the first execution later).
-     Since no syntax checks are done when doing lazy fileIn, use this only for
-     code which is known to be syntactically correct.
-     If silent is true, no compiler messages are output to the transcript.
-     Giving nil for silent/lazy will use the current settings."
-
-    |aStream path morePath bos|
-
-    "
-     an object or shared object ?
-    "
-    (ObjectFileLoader notNil
-    and:[ObjectFileLoader hasValidBinaryExtension:aFileName]) ifTrue:[
-        LoadBinaries ifFalse:[^ false].
-        path := self getBinaryFileName:aFileName.
-        path isNil ifTrue:[^ false].
-        ^ (ObjectFileLoader loadObjectFile:aFileName) notNil
-    ].
-
-    (aFileName endsWith:'.cls') ifTrue:[
-        BinaryObjectStorage notNil ifTrue:[
-            path := self getBinaryFileName:aFileName.
-            path isNil ifTrue:[^ false].
-            aStream := path asFilename readStream.
-            aStream notNil ifTrue:[
-                bos := BinaryObjectStorage onOld:aStream.
-                bos next.
-                bos close.
-                ^ true
-            ].
-            ^ false
-        ]
-    ].
-
-    (aFileName startsWith:'source/') ifTrue:[
-        aStream := self sourceFileStreamFor:(aFileName copyFrom:8)
-    ] ifFalse:[
-        (aFileName startsWith:'fileIn/') ifTrue:[
-            aStream := self fileInFileStreamFor:(aFileName copyFrom:8)
-        ] ifFalse:[
-            aStream := self systemFileStreamFor:aFileName.
-            (aStream notNil and:[aFileName includes:$/]) ifTrue:[
-                "/ temporarily prepend the files directory
-                "/ to the searchPath.
-                "/ This allows fileIn-driver files to refer to local
-                "/ files via a relative path, and drivers to fileIn other
-                "/ drivers ...
-                morePath := aStream pathName asFilename directoryName.
-            ]
-        ]
-    ].
-    aStream isNil ifTrue:[^ false].
-    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
-
-    "
-     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
-    "
-
-    "Modified: 8.1.1997 / 17:58:31 / cg"
-!
-
-fileIn:aFileName logged:logged
-    "read in the named file - look for it in some standard places;
-     return true if ok, false if failed.
-     The argument logged controls, if the changefile is to be updated."
-
-    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged 
-
-    "
-     Smalltalk fileIn:'source/TicTacToe.st' logged:false
-    "
-!
-
 fileInChanges
     "read in the last changes file - bringing the system to the state it
      had when left the last time.
@@ -2261,238 +2136,6 @@
     "
 !
 
-fileInClass:aClassName
-    "find a source/object file for aClassName and -if found - load it.
-     search is in some standard places trying driver-file (.ld), object-file (.o) and 
-     finally source file (.st) in that order.
-     The file is first searched for using the class name, then the abbreviated name."
-
-    ^ self fileInClass:aClassName initialize:true lazy:false silent:nil
-!
-
-fileInClass:aClassName fromObject:aFileName
-    "read in the named object file and dynamic-link it into the system
-     - look for it in some standard places.
-     Only install the named class from this object file.
-     Return true if ok, false if failed."
-
-    |path ok|
-
-    "
-     check if the dynamic loader class is in
-    "
-    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
-
-    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
-    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
-    ok ifTrue:[
-	SilentLoading ifFalse:[
-	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
-	]
-    ].
-    ^ ok
-
-    "
-     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' 
-     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' 
-    "
-
-    "Modified: 10.9.1996 / 20:43:52 / cg"
-!
-
-fileInClass:aClassName initialize:doInit
-    "find a source/object file for aClassName and -if found - load it.
-     search is in some standard places trying driver-file (.ld), object-file (.o) and 
-     finally source file (.st) in that order.
-     The file is first searched for using the class name, then the abbreviated name."
-
-    ^ self fileInClass:aClassName initialize:doInit lazy:false silent:nil
-!
-
-fileInClass:aClassName initialize:doInit lazy:loadLazy
-    "find a source/object file for aClassName and -if found - load it.
-     search is in some standard places trying driver-file (.ld), object-file (.o) and 
-     finally source file (.st) in that order.
-     The file is first searched for using the class name, then the abbreviated name."
-
-     ^ self fileInClass:aClassName initialize:doInit lazy:loadLazy silent:nil
-!
-
-fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent 
-    "find a source/object file for aClassName and -if found - load it.
-     This is the workhorse for autoloading.
-     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
-     finally source file (.st), in that order.
-     The file is first searched for using the class name, then the abbreviated name.
-     The argument doInit controlls if the class should be sent a #initialize after the
-     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
-     should not send notes to the transcript; it can be true, false or nil, where
-     nil uses the value from SilentLoading."
-
-    |shortName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr fn|
-
-    wasLazy := Compiler compileLazy:loadLazy.
-    beSilent notNil ifTrue:[
-	wasSilent := self silentLoading:beSilent.
-    ].
-
-    [
-	Class withoutUpdatingChangesDo:
-	[
-	    ok := false.
-
-	    shortName := self fileNameForClass:aClassName.
-	    "
-	     first, look for a loader-driver file (in fileIn/xxx.ld)
-	    "
-	    (ok := self fileIn:('fileIn/' , shortName , '.ld') lazy:loadLazy silent:beSilent)
-	    ifFalse:[
-		"
-		 try abbreviated driver-file (in fileIn/xxx.ld)
-		"
-		shortName ~= aClassName ifTrue:[
-		    ok := self fileIn:('fileIn/' , aClassName , '.ld') lazy:loadLazy silent:beSilent
-		].
-		ok ifFalse:[
-		    "
-		     then, if dynamic linking is available, 
-		    "
-		    (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
-			sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
-
-			"
-			 first look for a class packages shared binary in binary/xxx.o
-			"
-			libName := self libraryFileNameOfClass:aClassName.
-			libName notNil ifTrue:[
-			    (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
-			    ifFalse:[
-				sharedLibExtension ~= '.o' ifTrue:[
-				    ok := self fileInClass:aClassName fromObject:(libName, '.o')
-				]
-			    ].
-			].
-
-			"
-			 then, look for a shared binary in binary/xxx.o
-			"
-			ok ifFalse:[
-			    (ok := self fileInClass:aClassName fromObject:(shortName, sharedLibExtension))
-			    ifFalse:[
-				sharedLibExtension ~= '.o' ifTrue:[
-				    ok := self fileInClass:aClassName fromObject:(shortName, '.o')
-				].
-				ok ifFalse:[
-				    shortName ~= aClassName ifTrue:[
-					(ok := self fileInClass:aClassName fromObject:(aClassName, sharedLibExtension))
-					ifFalse:[
-					    sharedLibExtension ~= '.o' ifTrue:[
-						ok := self fileInClass:aClassName fromObject:(aClassName, '.o')
-					    ]
-					]
-				    ].
-				].
-			    ].
-			].
-		    ].
-
-		    "
-		     if that did not work, look for a compiled-bytecode file ...
-		    "
-		    ok ifFalse:[
-			(ok := self fileIn:(shortName , '.cls') lazy:loadLazy silent:beSilent)
-			ifFalse:[
-			    shortName ~= aClassName ifTrue:[
-				ok := self fileIn:(aClassName , '.cls') lazy:loadLazy silent:beSilent
-			    ]
-			]
-		    ].
-
-		    "
-		     if that did not work, look for an st-source file ...
-		    "
-		    ok ifFalse:[
-			fn := shortName , '.st'.
-			(ok := self fileIn:fn lazy:loadLazy silent:beSilent)
-			ifFalse:[
-			    shortName ~= aClassName ifTrue:[
-				fn := aClassName , '.st'.
-				ok := self fileIn:fn lazy:loadLazy silent:beSilent
-			    ].
-			    ok ifFalse:[
-				"
-				 ... and in the standard source-directory
-				"
-				fn := 'source/' , shortName , '.st'.
-				(ok := self fileIn:fn lazy:loadLazy silent:beSilent)
-				ifFalse:[
-				    shortName ~= aClassName ifTrue:[
-					fn := 'source/' , aClassName , '.st'.
-					ok := self fileIn:fn lazy:loadLazy silent:beSilent
-				    ]
-				]
-			    ]
-			].
-			ok ifFalse:[
-			    "
-			     new: if there is a sourceCodeManager, ask it for the classes sourceCode
-			    "
-			    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
-				inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName.
-				inStream notNil ifTrue:[
-				    fn := nil.
-				    ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. 
-				]
-			    ].
-			].
-		    ].
-		].
-	    ]
-	].
-	ok ifTrue:[
-	    newClass := self at:(aClassName asSymbol).
-	    newClass notNil ifTrue:[
-		fn notNil ifTrue:[
-		    newClass classFilename isNil ifTrue:[
-			newClass setClassFilename:fn
-		    ].
-		].
-
-		doInit ifTrue:[
-		    newClass initialize
-		]
-	    ]
-	].
-    ] valueNowOrOnUnwindDo:[
-	Compiler compileLazy:wasLazy. 
-	wasSilent notNil ifTrue:[
-	    self silentLoading:wasSilent
-	]
-    ].
-
-    ^ newClass
-
-    "Modified: 11.11.1996 / 09:56:39 / cg"
-!
-
-fileInClassLibrary:aClassLibraryName
-    "find an object file containing a binary class library in some standard places
-     and load it. This install all of its contained classes.
-     Return true if ok, false if not."
-
-    ObjectFileLoader isNil ifTrue:[^ false].
-    ^ (ObjectFileLoader 
-            loadObjectFile:(aClassLibraryName , (ObjectFileLoader sharedLibraryExtension))
-      ) notNil
-
-    "
-     Smalltalk fileInClassLibrary:'libtable'
-     Smalltalk fileInClassLibrary:'binary/libwidg3'
-    "
-
-    "Modified: 8.1.1997 / 17:58:56 / cg"
-!
-
 fileInFileStreamFor:aFileName
     "search aFileName in some standard places;
      return a readonly fileStream or nil if not found.
@@ -3219,6 +2862,365 @@
     "
 ! !
 
+!Smalltalk class methodsFor:'system management-fileIn'!
+
+fileIn:aFileName
+    "read in the named file - look for it in some standard places;
+     return true if ok, false if failed"
+
+    ^ self fileIn:aFileName lazy:nil silent:nil logged:false 
+
+    "
+     Smalltalk fileIn:'source/TicTacToe.st'
+    "
+
+    "Created: 28.10.1995 / 17:06:28 / cg"
+!
+
+fileIn:aFileName lazy:lazy
+    "read in the named file - look for it in some standard places;
+     return true if ok, false if failed.
+     If lazy is true, no code is generated for methods, instead stubs
+     are created which compile themself when first executed. This allows
+     for much faster fileIn (but slows down the first execution later).
+     Since no syntax checks are done when doing lazy fileIn, use this only for
+     code which is known to be syntactically correct."
+
+    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false 
+
+    "
+     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
+    "
+
+    "Created: 28.10.1995 / 17:06:36 / cg"
+!
+
+fileIn:aFileName lazy:lazy silent:silent
+    "read in the named file - look for it in some standard places;
+     return true if ok, false if failed.
+     If lazy is true, no code is generated for methods, instead stubs
+     are created which compile themself when first executed. This allows
+     for much faster fileIn (but slows down the first execution later).
+     Since no syntax checks are done when doing lazy fileIn, use this only for
+     code which is known to be syntactically correct.
+     If silent is true, no compiler messages are output to the transcript.
+     Giving nil for silent/lazy will use the current settings."
+
+    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
+
+    "Created: 28.10.1995 / 17:06:41 / cg"
+!
+
+fileIn:aFileName lazy:lazy silent:silent logged:logged
+    "read in the named file - look for it in some standard places;
+     return true if ok, false if failed.
+     If lazy is true, no code is generated for methods, instead stubs
+     are created which compile themself when first executed. This allows
+     for much faster fileIn (but slows down the first execution later).
+     Since no syntax checks are done when doing lazy fileIn, use this only for
+     code which is known to be syntactically correct.
+     If silent is true, no compiler messages are output to the transcript.
+     Giving nil for silent/lazy will use the current settings."
+
+    |aStream path morePath bos|
+
+    "
+     an object or shared object ?
+    "
+    (ObjectFileLoader notNil
+    and:[ObjectFileLoader hasValidBinaryExtension:aFileName]) ifTrue:[
+        LoadBinaries ifFalse:[^ false].
+        path := self getBinaryFileName:aFileName.
+        path isNil ifTrue:[^ false].
+        ^ (ObjectFileLoader loadObjectFile:aFileName) notNil
+    ].
+
+    (aFileName endsWith:'.cls') ifTrue:[
+        BinaryObjectStorage notNil ifTrue:[
+            path := self getBinaryFileName:aFileName.
+            path isNil ifTrue:[^ false].
+            aStream := path asFilename readStream.
+            aStream notNil ifTrue:[
+                bos := BinaryObjectStorage onOld:aStream.
+                bos next.
+                bos close.
+                ^ true
+            ].
+            ^ false
+        ]
+    ].
+
+    (aFileName startsWith:'source/') ifTrue:[
+        aStream := self sourceFileStreamFor:(aFileName copyFrom:8)
+    ] ifFalse:[
+        (aFileName startsWith:'fileIn/') ifTrue:[
+            aStream := self fileInFileStreamFor:(aFileName copyFrom:8)
+        ] ifFalse:[
+            aStream := self systemFileStreamFor:aFileName.
+            (aStream notNil and:[aFileName includes:$/]) ifTrue:[
+                "/ temporarily prepend the files directory
+                "/ to the searchPath.
+                "/ This allows fileIn-driver files to refer to local
+                "/ files via a relative path, and drivers to fileIn other
+                "/ drivers ...
+                morePath := aStream pathName asFilename directoryName.
+            ]
+        ]
+    ].
+    aStream isNil ifTrue:[^ false].
+    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
+
+    "
+     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
+    "
+
+    "Modified: 8.1.1997 / 17:58:31 / cg"
+!
+
+fileIn:aFileName logged:logged
+    "read in the named file - look for it in some standard places;
+     return true if ok, false if failed.
+     The argument logged controls, if the changefile is to be updated."
+
+    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged 
+
+    "
+     Smalltalk fileIn:'source/TicTacToe.st' logged:false
+    "
+!
+
+fileInClass:aClassName
+    "find a source/object file for aClassName and -if found - load it.
+     search is in some standard places trying driver-file (.ld), object-file (.o) and 
+     finally source file (.st) in that order.
+     The file is first searched for using the class name, then the abbreviated name."
+
+    ^ self fileInClass:aClassName initialize:true lazy:false silent:nil
+!
+
+fileInClass:aClassName fromObject:aFileName
+    "read in the named object file and dynamic-link it into the system
+     - look for it in some standard places.
+     Only install the named class from this object file.
+     Return true if ok, false if failed."
+
+    |path ok|
+
+    "
+     check if the dynamic loader class is in
+    "
+    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
+
+    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
+    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
+    ok ifTrue:[
+	SilentLoading ifFalse:[
+	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
+	]
+    ].
+    ^ ok
+
+    "
+     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' 
+     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' 
+    "
+
+    "Modified: 10.9.1996 / 20:43:52 / cg"
+!
+
+fileInClass:aClassName initialize:doInit
+    "find a source/object file for aClassName and -if found - load it.
+     search is in some standard places trying driver-file (.ld), object-file (.o) and 
+     finally source file (.st) in that order.
+     The file is first searched for using the class name, then the abbreviated name."
+
+    ^ self fileInClass:aClassName initialize:doInit lazy:false silent:nil
+!
+
+fileInClass:aClassName initialize:doInit lazy:loadLazy
+    "find a source/object file for aClassName and -if found - load it.
+     search is in some standard places trying driver-file (.ld), object-file (.o) and 
+     finally source file (.st) in that order.
+     The file is first searched for using the class name, then the abbreviated name."
+
+     ^ self fileInClass:aClassName initialize:doInit lazy:loadLazy silent:nil
+!
+
+fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent 
+    "find a source/object file for aClassName and -if found - load it.
+     This is the workhorse for autoloading.
+     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
+     finally source file (.st), in that order.
+     The file is first searched for using the class name, then the abbreviated name.
+     The argument doInit controlls if the class should be sent a #initialize after the
+     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
+     should not send notes to the transcript; it can be true, false or nil, where
+     nil uses the value from SilentLoading."
+
+    |shortName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr fn|
+
+    wasLazy := Compiler compileLazy:loadLazy.
+    beSilent notNil ifTrue:[
+	wasSilent := self silentLoading:beSilent.
+    ].
+
+    [
+	Class withoutUpdatingChangesDo:
+	[
+	    ok := false.
+
+	    shortName := self fileNameForClass:aClassName.
+	    "
+	     first, look for a loader-driver file (in fileIn/xxx.ld)
+	    "
+	    (ok := self fileIn:('fileIn/' , shortName , '.ld') lazy:loadLazy silent:beSilent)
+	    ifFalse:[
+		"
+		 try abbreviated driver-file (in fileIn/xxx.ld)
+		"
+		shortName ~= aClassName ifTrue:[
+		    ok := self fileIn:('fileIn/' , aClassName , '.ld') lazy:loadLazy silent:beSilent
+		].
+		ok ifFalse:[
+		    "
+		     then, if dynamic linking is available, 
+		    "
+		    (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
+			sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
+
+			"
+			 first look for a class packages shared binary in binary/xxx.o
+			"
+			libName := self libraryFileNameOfClass:aClassName.
+			libName notNil ifTrue:[
+			    (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
+			    ifFalse:[
+				sharedLibExtension ~= '.o' ifTrue:[
+				    ok := self fileInClass:aClassName fromObject:(libName, '.o')
+				]
+			    ].
+			].
+
+			"
+			 then, look for a shared binary in binary/xxx.o
+			"
+			ok ifFalse:[
+			    (ok := self fileInClass:aClassName fromObject:(shortName, sharedLibExtension))
+			    ifFalse:[
+				sharedLibExtension ~= '.o' ifTrue:[
+				    ok := self fileInClass:aClassName fromObject:(shortName, '.o')
+				].
+				ok ifFalse:[
+				    shortName ~= aClassName ifTrue:[
+					(ok := self fileInClass:aClassName fromObject:(aClassName, sharedLibExtension))
+					ifFalse:[
+					    sharedLibExtension ~= '.o' ifTrue:[
+						ok := self fileInClass:aClassName fromObject:(aClassName, '.o')
+					    ]
+					]
+				    ].
+				].
+			    ].
+			].
+		    ].
+
+		    "
+		     if that did not work, look for a compiled-bytecode file ...
+		    "
+		    ok ifFalse:[
+			(ok := self fileIn:(shortName , '.cls') lazy:loadLazy silent:beSilent)
+			ifFalse:[
+			    shortName ~= aClassName ifTrue:[
+				ok := self fileIn:(aClassName , '.cls') lazy:loadLazy silent:beSilent
+			    ]
+			]
+		    ].
+
+		    "
+		     if that did not work, look for an st-source file ...
+		    "
+		    ok ifFalse:[
+			fn := shortName , '.st'.
+			(ok := self fileIn:fn lazy:loadLazy silent:beSilent)
+			ifFalse:[
+			    shortName ~= aClassName ifTrue:[
+				fn := aClassName , '.st'.
+				ok := self fileIn:fn lazy:loadLazy silent:beSilent
+			    ].
+			    ok ifFalse:[
+				"
+				 ... and in the standard source-directory
+				"
+				fn := 'source/' , shortName , '.st'.
+				(ok := self fileIn:fn lazy:loadLazy silent:beSilent)
+				ifFalse:[
+				    shortName ~= aClassName ifTrue:[
+					fn := 'source/' , aClassName , '.st'.
+					ok := self fileIn:fn lazy:loadLazy silent:beSilent
+				    ]
+				]
+			    ]
+			].
+			ok ifFalse:[
+			    "
+			     new: if there is a sourceCodeManager, ask it for the classes sourceCode
+			    "
+			    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
+				inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName.
+				inStream notNil ifTrue:[
+				    fn := nil.
+				    ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. 
+				]
+			    ].
+			].
+		    ].
+		].
+	    ]
+	].
+	ok ifTrue:[
+	    newClass := self at:(aClassName asSymbol).
+	    newClass notNil ifTrue:[
+		fn notNil ifTrue:[
+		    newClass classFilename isNil ifTrue:[
+			newClass setClassFilename:fn
+		    ].
+		].
+
+		doInit ifTrue:[
+		    newClass initialize
+		]
+	    ]
+	].
+    ] valueNowOrOnUnwindDo:[
+	Compiler compileLazy:wasLazy. 
+	wasSilent notNil ifTrue:[
+	    self silentLoading:wasSilent
+	]
+    ].
+
+    ^ newClass
+
+    "Modified: 11.11.1996 / 09:56:39 / cg"
+!
+
+fileInClassLibrary:aClassLibraryName
+    "find an object file containing a binary class library in some standard places
+     and load it. This install all of its contained classes.
+     Return true if ok, false if not."
+
+    ObjectFileLoader isNil ifTrue:[^ false].
+    ^ (ObjectFileLoader 
+            loadObjectFile:(aClassLibraryName , (ObjectFileLoader sharedLibraryExtension))
+      ) notNil
+
+    "
+     Smalltalk fileInClassLibrary:'libtable'
+     Smalltalk fileInClassLibrary:'binary/libwidg3'
+    "
+
+    "Modified: 8.1.1997 / 17:58:56 / cg"
+! !
+
 !Smalltalk class methodsFor:'time-versions'!
 
 configuration
@@ -3507,5 +3509,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.211 1997-01-10 16:25:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.212 1997-01-13 16:05:55 cg Exp $'
 ! !