--- a/Smalltalk.st Fri Mar 05 12:58:38 1999 +0100
+++ b/Smalltalk.st Fri Mar 05 13:00:04 1999 +0100
@@ -2884,250 +2884,253 @@
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|
+ |shortName longName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr fn|
wasLazy := Compiler compileLazy:loadLazy.
beSilent notNil ifTrue:[
- wasSilent := self silentLoading:beSilent.
+ wasSilent := self silentLoading:beSilent.
].
+ longName := aClassName copyReplaceAll:$: with:$_.
+
[
- Class withoutUpdatingChangesDo:
- [
- |zarFn zar entry|
-
- 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, and the classes package is known,
- look for an st-cls file
- in a package subdir of the source-directory ...
- "
- ok ifFalse:[
- package notNil ifTrue:[
- (ok := self fileIn:(package , '/' , shortName , '.cls') lazy:loadLazy silent:beSilent)
- ifFalse:[
- shortName ~= aClassName ifTrue:[
- ok := self fileIn:(package , '/' , 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
- ]
- ]
- ]
- ].
- "
- if that did not work, and the classes package is known,
- look for an st-source file
- in a package subdir of the source-directory ...
- "
- ok ifFalse:[
- package notNil ifTrue:[
- fn := package , '/' , shortName , '.st'.
- (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
- ifFalse:[
- shortName ~= aClassName ifTrue:[
- fn := package , '/' , aClassName , '.st'.
- ok := self fileIn:fn lazy:loadLazy silent:beSilent
- ].
- ok ifFalse:[
- "
- ... and in the standard source-directory
- "
- fn := 'source/' , package , '/' , shortName , '.st'.
- (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
- ifFalse:[
- shortName ~= aClassName ifTrue:[
- fn := 'source/' , package , '/' , aClassName , '.st'.
- ok := self fileIn:fn lazy:loadLazy silent:beSilent
- ]
- ]
- ]
- ].
- ]
- ].
- "
- if that did not work, and the classes package is known,
- look for a zipArchive containing a class entry.
- "
- ok ifFalse:[
- package notNil ifTrue:[
- zarFn := package asFilename withSuffix:'zip'.
- zarFn := self getSourceFileName:zarFn.
- zarFn notNil ifTrue:[
- zar := ZipArchive oldFileNamed:zarFn.
- zar notNil ifTrue:[
- entry := zar extract:(shortName , '.st').
- entry isNil ifTrue:[
- entry := zar extract:(aClassName , '.st').
- ].
- entry notNil ifTrue:[
- ok := self
- fileInStream:(entry asString readStream)
- lazy:loadLazy
- silent:beSilent
- logged:false
- addPath:nil
- ].
- ]
- ]
- ]
- ].
-
- "
- if that did not work,
- look for a zipArchive containing a class entry.
- "
- ok ifFalse:[
- zarFn := self getSourceFileName:'source.zip'.
- zarFn notNil ifTrue:[
- zar := ZipArchive oldFileNamed:zarFn.
- zar notNil ifTrue:[
- entry := zar extract:(shortName , '.st').
- entry isNil ifTrue:[
- entry := zar extract:(aClassName , '.st').
- ].
- entry notNil ifTrue:[
- ok := self
- fileInStream:(entry asString readStream)
- lazy:loadLazy
- silent:beSilent
- logged:false
- addPath:nil
- ].
- ]
- ]
- ].
- 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
- ]
- ]
- ].
+ Class withoutUpdatingChangesDo:
+ [
+ |zarFn zar entry|
+
+ 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/' , longName , '.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:(longName, sharedLibExtension))
+ ifFalse:[
+ sharedLibExtension ~= '.o' ifTrue:[
+ ok := self fileInClass:aClassName fromObject:(longName, '.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:(longName , '.cls') lazy:loadLazy silent:beSilent
+ ]
+ ]
+ ].
+ "
+ if that did not work, and the classes package is known,
+ look for an st-cls file
+ in a package subdir of the source-directory ...
+ "
+ ok ifFalse:[
+ package notNil ifTrue:[
+ (ok := self fileIn:(package , '/' , shortName , '.cls') lazy:loadLazy silent:beSilent)
+ ifFalse:[
+ shortName ~= aClassName ifTrue:[
+ ok := self fileIn:(package , '/' , longName , '.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 ~= longName ifTrue:[
+ fn := longName , '.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 ~= longName ifTrue:[
+ fn := 'source/' , longName , '.st'.
+ ok := self fileIn:fn lazy:loadLazy silent:beSilent
+ ]
+ ]
+ ]
+ ].
+ "
+ if that did not work, and the classes package is known,
+ look for an st-source file
+ in a package subdir of the source-directory ...
+ "
+ ok ifFalse:[
+ package notNil ifTrue:[
+ fn := package , '/' , shortName , '.st'.
+ (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
+ ifFalse:[
+ shortName ~= aClassName ifTrue:[
+ fn := package , '/' , longName , '.st'.
+ ok := self fileIn:fn lazy:loadLazy silent:beSilent
+ ].
+ ok ifFalse:[
+ "
+ ... and in the standard source-directory
+ "
+ fn := 'source/' , package , '/' , shortName , '.st'.
+ (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
+ ifFalse:[
+ shortName ~= aClassName ifTrue:[
+ fn := 'source/' , package , '/' , longName , '.st'.
+ ok := self fileIn:fn lazy:loadLazy silent:beSilent
+ ]
+ ]
+ ]
+ ].
+ ]
+ ].
+ "
+ if that did not work, and the classes package is known,
+ look for a zipArchive containing a class entry.
+ "
+ ok ifFalse:[
+ package notNil ifTrue:[
+ zarFn := package asFilename withSuffix:'zip'.
+ zarFn := self getSourceFileName:zarFn.
+ zarFn notNil ifTrue:[
+ zar := ZipArchive oldFileNamed:zarFn.
+ zar notNil ifTrue:[
+ entry := zar extract:(shortName , '.st').
+ (entry isNil and:[shortName ~= longName]) ifTrue:[
+ entry := zar extract:(longName , '.st').
+ ].
+ entry notNil ifTrue:[
+ ok := self
+ fileInStream:(entry asString readStream)
+ lazy:loadLazy
+ silent:beSilent
+ logged:false
+ addPath:nil
+ ].
+ ]
+ ]
+ ]
+ ].
+
+ "
+ if that did not work,
+ look for a zipArchive containing a class entry.
+ "
+ ok ifFalse:[
+ zarFn := self getSourceFileName:'source.zip'.
+ zarFn notNil ifTrue:[
+ zar := ZipArchive oldFileNamed:zarFn.
+ zar notNil ifTrue:[
+ entry := zar extract:(shortName , '.st').
+ (entry isNil and:[shortName ~= longName]) ifTrue:[
+ entry := zar extract:(longName , '.st').
+ ].
+ entry notNil ifTrue:[
+ ok := self
+ fileInStream:(entry asString readStream)
+ lazy:loadLazy
+ silent:beSilent
+ logged:false
+ addPath:nil
+ ].
+ ]
+ ]
+ ].
+ 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
- ]
+ Compiler compileLazy:wasLazy.
+ wasSilent notNil ifTrue:[
+ self silentLoading:wasSilent
+ ]
].
^ newClass
"Created: / 9.1.1998 / 14:40:32 / cg"
- "Modified: / 22.4.1998 / 18:01:37 / cg"
+ "Modified: / 5.3.1999 / 12:56:47 / cg"
!
fileInClassLibrary:aClassLibraryName
@@ -4201,5 +4204,5 @@
!Smalltalk class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.305 1999-02-25 21:59:00 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.306 1999-03-05 12:00:04 cg Exp $'
! !