--- a/Smalltalk.st Fri Oct 28 08:45:38 2011 +0100
+++ b/Smalltalk.st Mon Oct 31 22:19:21 2011 +0000
@@ -226,6 +226,16 @@
this is not called when an image is restarted; in this
case the show starts in Smalltalk>>restart."
+ Compiler := ByteCodeCompiler.
+ Compiler isNil ifTrue:[
+ "
+ ByteCodeCompiler is not in the system (i.e. has not been linked in)
+ this allows at least immediate evaluations for runtime systems without compiler
+ NOTICE: a parser is always needed, otherwise we cannot read resource files etc.
+ "
+ Compiler := Parser
+ ].
+
"/
"/ start catching SIGSEGV and SIGBUS
"/
@@ -254,16 +264,6 @@
"/
self initSystemPath.
- Compiler := ByteCodeCompiler.
- Compiler isNil ifTrue:[
- "
- ByteCodeCompiler is not in the system (i.e. has not been linked in)
- this allows at least immediate evaluations for runtime systems without compiler
- NOTICE: a parser is always needed, otherwise we cannot read resource files etc.
- "
- Compiler := Parser
- ].
-
"/
"/ another one, to be initialized before others
"/
@@ -515,18 +515,18 @@
"sent from VM via #initializeModules"
Error handle:[:ex |
- ClassesFailedToInitialize isNil ifTrue:[
- ClassesFailedToInitialize := IdentitySet new.
- ].
- ClassesFailedToInitialize add:aClass.
- ('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR.
- ex suspendedContext fullPrintAll.
- '------------------------------------------------' errorPrintCR.
- (Smalltalk commandLineArguments includes:'--debug') ifTrue:[
- ex reject
- ].
+ ClassesFailedToInitialize isNil ifTrue:[
+ ClassesFailedToInitialize := IdentitySet new.
+ ].
+ ClassesFailedToInitialize add:aClass.
+ ('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR.
+ ex suspendedContext fullPrintAll.
+ '------------------------------------------------' errorPrintCR.
+ (Smalltalk commandLineArguments includes:'--debug') ifTrue:[
+ ex reject
+ ].
] do:[
- aClass initialize
+ aClass initialize
].
"Modified: / 11-09-2011 / 17:01:32 / cg"
@@ -2131,15 +2131,15 @@
"add a block to be executed in a separate process after
everything has been initialized. These blocks will
be executed only once and not be executed after an image restart.
- Initial processes such as the launcher are usually started here
+ Initial processes such as the launcher are usually started here
(see smalltalk.rc / private.rc)."
"{ Pragma: +optSpace }"
StartBlocks isNil ifTrue:[
- StartBlocks := OrderedCollection with:aBlock
+ StartBlocks := OrderedCollection with:aBlock
] ifFalse:[
- StartBlocks add:aBlock
+ StartBlocks add:aBlock
]
"Created: / 09-09-1996 / 16:46:53 / stefan"
@@ -2192,7 +2192,7 @@
extensionsLoaded := false.
ProgrammingLanguage allDo:[:lang|
- extensionsLoaded := extensionsLoaded | (self loadExtensionsForPackage:aPackageId language: lang)
+ extensionsLoaded := extensionsLoaded | (self loadExtensionsForPackage:aPackageId language: lang)
].
^ extensionsLoaded
@@ -2202,7 +2202,7 @@
!
loadExtensionsForPackage:aPackageId language: language
- |mgr packageDirName inStream projectDefinition extensionsFilename mod dir
+ |mgr packageDirName inStream projectDefinition extensionsFilename mod dir
extensionsRevisionString extensionsRevisionInfo|
language supportsExtensionMethods ifFalse:[^false].
@@ -2211,10 +2211,10 @@
packageDirName := self getPackageFileName:packageDirName.
(packageDirName notNil and:[Class tryLocalSourceFirst]) ifTrue:[
- (self loadExtensionsFromDirectory:packageDirName language: language) ifTrue:[
- ^ true.
- ].
- packageDirName := nil. "do not try again"
+ (self loadExtensionsFromDirectory:packageDirName language: language) ifTrue:[
+ ^ true.
+ ].
+ packageDirName := nil. "do not try again"
].
"
@@ -2224,16 +2224,16 @@
mgr := AbstractSourceCodeManager managerForPackage: aPackageId
].
mgr notNil ifTrue:[
- extensionsFilename := 'extensions.' , language sourceFileSuffix.
-
- projectDefinition := ProjectDefinition definitionClassForPackage:aPackageId.
- projectDefinition notNil ifTrue:[
- mod := aPackageId asPackageId module.
- dir := aPackageId asPackageId directory.
- extensionsRevisionString := projectDefinition perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
- extensionsRevisionString notNil ifTrue:[
- extensionsRevisionInfo := mgr revisionInfoFromString:extensionsRevisionString inClass:nil.
- extensionsRevisionInfo notNil ifTrue:[
+ extensionsFilename := 'extensions.' , language sourceFileSuffix.
+
+ projectDefinition := ProjectDefinition definitionClassForPackage:aPackageId.
+ projectDefinition notNil ifTrue:[
+ mod := aPackageId asPackageId module.
+ dir := aPackageId asPackageId directory.
+ extensionsRevisionString := projectDefinition perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
+ extensionsRevisionString notNil ifTrue:[
+ extensionsRevisionInfo := mgr revisionInfoFromString:extensionsRevisionString inClass:nil.
+ extensionsRevisionInfo notNil ifTrue:[
extensionsRevisionInfo fileName = extensionsFilename ifFalse:[
"JV@2011-10-23: following condition is never satisfied for
filed-in packages. The whole scheme of extensionVersion_XXX
@@ -2249,33 +2249,33 @@
^ false
]
]
- ]
- ].
- SourceCodeManagerError handle:[:ex |
- ] do:[
- inStream := mgr streamForExtensionFile:extensionsFilename package:aPackageId directory:dir module:mod cache:true.
- ].
- ].
- inStream isNil ifTrue:[
- SourceCodeManagerError handle:[:ex |
- ] do:[
- inStream := mgr getMostRecentSourceStreamForFile:extensionsFilename inPackage:aPackageId.
- ].
- ].
- inStream notNil ifTrue:[
- Class withoutUpdatingChangeSetDo:[
- inStream fileIn.
- ].
- inStream close.
- SilentLoading ifFalse:[
- Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
- ].
- ^ true
- ]
+ ]
+ ].
+ SourceCodeManagerError handle:[:ex |
+ ] do:[
+ inStream := mgr streamForExtensionFile:extensionsFilename package:aPackageId directory:dir module:mod cache:true.
+ ].
+ ].
+ inStream isNil ifTrue:[
+ SourceCodeManagerError handle:[:ex |
+ ] do:[
+ inStream := mgr getMostRecentSourceStreamForFile:extensionsFilename inPackage:aPackageId.
+ ].
+ ].
+ inStream notNil ifTrue:[
+ Class withoutUpdatingChangeSetDo:[
+ inStream fileIn.
+ ].
+ inStream close.
+ SilentLoading ifFalse:[
+ Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
+ ].
+ ^ true
+ ]
].
packageDirName notNil ifTrue:[
- ^ self loadExtensionsFromDirectory:packageDirName language: language
+ ^ self loadExtensionsFromDirectory:packageDirName language: language
].
^ false
@@ -2289,8 +2289,8 @@
| extensionsLoaded |
extensionsLoaded := false.
ProgrammingLanguage allDo:
- [:lang|
- extensionsLoaded := extensionsLoaded | (self loadExtensionsFromDirectory: packageDirOrString language: lang)].
+ [:lang|
+ extensionsLoaded := extensionsLoaded | (self loadExtensionsFromDirectory: packageDirOrString language: lang)].
^extensionsLoaded
"Modified: / 02-01-2010 / 10:40:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -2462,12 +2462,12 @@
loadOK loadErrorOccurred exePath|
packageDirOrStringOrNil notNil ifTrue:[
- packageDir := packageDirOrStringOrNil asFilename.
+ packageDir := packageDirOrStringOrNil asFilename.
].
VerboseLoading ifTrue:[
- silent := false
+ silent := false
] ifFalse:[
- silent := SilentLoading | StandAlone | InfoPrinting not.
+ silent := SilentLoading | StandAlone | InfoPrinting not.
].
"For now: have to read the project definition first!!
@@ -2481,36 +2481,36 @@
"if not, file it in ..."
(projectDefinitionClass isNil and:[packageDir notNil]) ifTrue:[
- projectDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageString.
- "/ try to load the project definition class
- projectDefinitionFilename := (packageDir / projectDefinitionClassName) withSuffix:'st'.
- projectDefinitionFilename exists ifFalse:[
- projectDefinitionFilename := (packageDir / 'source' / projectDefinitionClassName) withSuffix:'st'.
- ].
- projectDefinitionFilename exists ifTrue:[
- Class withoutUpdatingChangesDo:[
- Smalltalk silentlyLoadingDo:[
- projectDefinitionFilename fileIn.
- ].
- ].
- projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
- ].
+ projectDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageString.
+ "/ try to load the project definition class
+ projectDefinitionFilename := (packageDir / projectDefinitionClassName) withSuffix:'st'.
+ projectDefinitionFilename exists ifFalse:[
+ projectDefinitionFilename := (packageDir / 'source' / projectDefinitionClassName) withSuffix:'st'.
+ ].
+ projectDefinitionFilename exists ifTrue:[
+ Class withoutUpdatingChangesDo:[
+ Smalltalk silentlyLoadingDo:[
+ projectDefinitionFilename fileIn.
+ ].
+ ].
+ projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
+ ].
].
projectDefinitionClass notNil ifTrue:[
- projectDefinitionClass autoload.
- somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
- (silent not and:[somethingHasBeenLoaded]) ifTrue:[
- Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
- ].
- ^ true.
+ projectDefinitionClass autoload.
+ somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
+ (silent not and:[somethingHasBeenLoaded]) ifTrue:[
+ Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
+ ].
+ ^ true.
].
"/ no project-definition class.
"Is there a shared library (.dll or .so) ?"
shLibName := aPackageString asPackageId libraryName asFilename
- withSuffix:ObjectFileLoader sharedLibrarySuffix.
+ withSuffix:ObjectFileLoader sharedLibrarySuffix.
"/ silent ifFalse:[
"/ Transcript showCR:('looking for binary classLib file: ' , shLibName pathName).
@@ -2518,75 +2518,75 @@
exePath := OperatingSystem pathOfSTXExecutable asFilename directory.
binaryClassLibraryFilename := exePath / shLibName.
binaryClassLibraryFilename exists ifFalse:[
- exePath baseName = 'bin' ifTrue:[
- binaryClassLibraryFilename := exePath directory / 'lib' / shLibName.
- ].
- binaryClassLibraryFilename exists ifFalse:[
- binaryClassLibraryFilename := exePath directory / 'plugin' / shLibName.
- binaryClassLibraryFilename exists ifFalse:[
+ exePath baseName = 'bin' ifTrue:[
+ binaryClassLibraryFilename := exePath directory / 'lib' / shLibName.
+ ].
+ binaryClassLibraryFilename exists ifFalse:[
+ binaryClassLibraryFilename := exePath directory / 'plugin' / shLibName.
+ binaryClassLibraryFilename exists ifFalse:[
"/ binaryClassLibraryFilename := Filename currentDirectory / shLibName.
"/ binaryClassLibraryFilename exists ifFalse:[
- packageDir notNil ifTrue:[
- binaryClassLibraryFilename := packageDir / shLibName.
- binaryClassLibraryFilename exists ifFalse:[
- "/ mhmh - is this a good idea ? (temporary kludge)
- binaryClassLibraryFilename := packageDir / 'objbc' / shLibName.
- binaryClassLibraryFilename exists ifFalse:[
- binaryClassLibraryFilename := packageDir / 'objvc' / shLibName.
- ]
- ]
- ]
+ packageDir notNil ifTrue:[
+ binaryClassLibraryFilename := packageDir / shLibName.
+ binaryClassLibraryFilename exists ifFalse:[
+ "/ mhmh - is this a good idea ? (temporary kludge)
+ binaryClassLibraryFilename := packageDir / 'objbc' / shLibName.
+ binaryClassLibraryFilename exists ifFalse:[
+ binaryClassLibraryFilename := packageDir / 'objvc' / shLibName.
+ ]
+ ]
+ ]
"/ ].
- ].
- ].
+ ].
+ ].
].
binaryClassLibraryFilename exists ifTrue:[
- ObjectFileLoader::ObjectFileLoadErrorNotification handle:[:ex |
- loadErrorOccurred := true.
- ex proceedWith:true.
- ] do:[
- loadOK := self loadPackage:aPackageString fromClassLibrary:binaryClassLibraryFilename.
- ].
- loadOK ifTrue:[
- silent ifFalse:[
- Transcript showCR:('loaded package: ' , aPackageString , ' from binary classLib file: ' , binaryClassLibraryFilename pathName).
- ].
- doLoadAsAutoloaded ifFalse:[
- "/ force autoloading...
- Smalltalk allClassesDo:[:eachClass |
- eachClass package == aPackageString ifTrue:[eachClass autoload].
- ].
- ].
- ^ true
- ].
- loadErrorOccurred ifTrue:[
- self breakPoint:#cg.
- projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
- projectDefinitionClass notNil ifTrue:[
- "/ load prerequisites...
- projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
- self breakPoint:#cg.
- ].
- ].
+ ObjectFileLoader::ObjectFileLoadErrorNotification handle:[:ex |
+ loadErrorOccurred := true.
+ ex proceedWith:true.
+ ] do:[
+ loadOK := self loadPackage:aPackageString fromClassLibrary:binaryClassLibraryFilename.
+ ].
+ loadOK ifTrue:[
+ silent ifFalse:[
+ Transcript showCR:('loaded package: ' , aPackageString , ' from binary classLib file: ' , binaryClassLibraryFilename pathName).
+ ].
+ doLoadAsAutoloaded ifFalse:[
+ "/ force autoloading...
+ Smalltalk allClassesDo:[:eachClass |
+ eachClass package == aPackageString ifTrue:[eachClass autoload].
+ ].
+ ].
+ ^ true
+ ].
+ loadErrorOccurred ifTrue:[
+ self breakPoint:#cg.
+ projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
+ projectDefinitionClass notNil ifTrue:[
+ "/ load prerequisites...
+ projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
+ self breakPoint:#cg.
+ ].
+ ].
].
packageDir isNil ifTrue:[
- ^ false.
+ ^ false.
].
"/ loadAll ? - will be soon obsolete
"/ mhmh - this will vanish soon...
loadAllFilename := packageDir / 'loadAll'.
loadAllFilename exists ifFalse:[
- loadAllFilename := packageDir / 'loadall'.
+ loadAllFilename := packageDir / 'loadall'.
].
loadAllFilename exists ifTrue:[
- (self loadPackage:aPackageString fromLoadAllFile:loadAllFilename) ifTrue:[
- silent ifFalse:[
- Transcript showCR:('loaded package: ' , aPackageString , ' from loadAll file: ' , loadAllFilename pathName).
- ].
- ^ true
- ]
+ (self loadPackage:aPackageString fromLoadAllFile:loadAllFilename) ifTrue:[
+ silent ifFalse:[
+ Transcript showCR:('loaded package: ' , aPackageString , ' from loadAll file: ' , loadAllFilename pathName).
+ ].
+ ^ true
+ ]
].
packageName := packageDir baseName.
@@ -2955,45 +2955,45 @@
But be careful, to not invent new symbols ..."
sym := aString asSymbolIfInterned.
sym notNil ifTrue:[
- cls := self at:sym ifAbsent:nil.
- cls isBehavior ifTrue:[^ cls].
+ cls := self at:sym ifAbsent:nil.
+ cls isBehavior ifTrue:[^ cls].
].
(aString endsWith:' class') ifTrue:[
- nonMeta := self classNamed:(aString copyWithoutLast:6).
- nonMeta notNil ifTrue:[
- ^ nonMeta theMetaclass
- ].
+ nonMeta := self classNamed:(aString copyWithoutLast:6).
+ nonMeta notNil ifTrue:[
+ ^ nonMeta theMetaclass
+ ].
].
"no success yet. Try if this is a private class of an autoloaded class"
cls isNil ifTrue:[
- idx := aString indexOfSubCollection:'::'.
- idx ~~ 0 ifTrue:[
- prefix := aString copyTo:idx-1.
- nsNameSymbol := prefix asSymbolIfInterned.
- nsNameSymbol notNil ifTrue:[
- rest := aString copyFrom:idx+2.
- namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
- "namespace may be the owner of a private class.
- NameSpaces and Behaviors have the same protocol"
- [namespace isBehavior] whileTrue:[
- idx := rest indexOfSubCollection:'::'.
- idx ~~ 0 ifTrue:[
- prefix := rest copyTo:idx-1.
- rest := rest copyFrom:idx+2.
- "this does an implicit autoload if required"
- namespace := namespace privateClassesAt:prefix.
- ] ifFalse:[
- namespace isLoaded ifTrue:[
- cls := namespace privateClassesAt:rest.
- cls isBehavior ifTrue:[^ cls].
- ].
- namespace := nil. "force exit of loop"
- ].
- ].
- ].
- ].
+ idx := aString indexOfSubCollection:'::'.
+ idx ~~ 0 ifTrue:[
+ prefix := aString copyTo:idx-1.
+ nsNameSymbol := prefix asSymbolIfInterned.
+ nsNameSymbol notNil ifTrue:[
+ rest := aString copyFrom:idx+2.
+ namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
+ "namespace may be the owner of a private class.
+ NameSpaces and Behaviors have the same protocol"
+ [namespace isBehavior] whileTrue:[
+ idx := rest indexOfSubCollection:'::'.
+ idx ~~ 0 ifTrue:[
+ prefix := rest copyTo:idx-1.
+ rest := rest copyFrom:idx+2.
+ "this does an implicit autoload if required"
+ namespace := namespace privateClassesAt:prefix.
+ ] ifFalse:[
+ namespace isLoaded ifTrue:[
+ cls := namespace privateClassesAt:rest.
+ cls isBehavior ifTrue:[^ cls].
+ ].
+ namespace := nil. "force exit of loop"
+ ].
+ ].
+ ].
+ ].
].
^ nil
@@ -3104,10 +3104,10 @@
"Modified: / 10-08-2006 / 13:05:48 / cg"
!
-hasClassNamed:aString
- Symbol
- hasInterned:aString
- ifTrue:[:aSymbol | ^ (self at:aSymbol ifAbsent:[ nil ]) isClass ].
+hasClassNamed:aString
+ Symbol
+ hasInterned:aString
+ ifTrue:[:aSymbol | ^ (self at:aSymbol ifAbsent:[ nil ]) isClass ].
^ false
"Created: / 26-08-2009 / 11:43:03 / Jaroslav Havlin <havlij6@fel.cvut.cz>"
@@ -3525,42 +3525,42 @@
thisIsARestart := imageName notNil.
graphicalMode ifTrue:[
- Display isNil ifTrue:[
- (StartupClass notNil
- and:[ (StartupClass perform:#isHeadless ifNotUnderstood:false) ]) ifFalse:[
- self openDisplay.
- ].
- ].
+ Display isNil ifTrue:[
+ (StartupClass notNil
+ and:[ (StartupClass perform:#isHeadless ifNotUnderstood:false) ]) ifFalse:[
+ self openDisplay.
+ ].
+ ].
].
StandAlone ifFalse:[
- "
- enable the graphical debugger/inspector
- (they could have been (re)defined as autoloaded in the patches file)
- "
- self initStandardTools.
+ "
+ enable the graphical debugger/inspector
+ (they could have been (re)defined as autoloaded in the patches file)
+ "
+ self initStandardTools.
].
"
if there is a display, start its event dispatcher
"
Display notNil ifTrue:[
- Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
- SaveEmergencyImage == true ifTrue:[
- 'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
- ObjectMemory primSnapShotOn:'crash.img'.
- ].
- 'Display [warning]: broken display connection - exit.' infoPrintCR.
- self exit.
- ].
- Display startDispatch.
+ Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
+ SaveEmergencyImage == true ifTrue:[
+ 'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
+ ObjectMemory primSnapShotOn:'crash.img'.
+ ].
+ 'Display [warning]: broken display connection - exit.' infoPrintCR.
+ self exit.
+ ].
+ Display startDispatch.
].
idx := CommandLineArguments indexOf:'--browserWindow:'.
IsPlugin := (idx ~~ 0).
IsPlugin ifTrue:[
- self browserWindowStartup.
- "/ not reached
+ self browserWindowStartup.
+ "/ not reached
].
Initializing := false.
@@ -3571,49 +3571,49 @@
"/ Therefore, it is now done by an extra user-process.
process := [
- StartBlocks notNil ifTrue:[
- StartBlocks do:[:aBlock|
- aBlock value
- ].
- StartBlocks := nil.
- ].
- ImageStartBlocks notNil ifTrue:[
- ImageStartBlocks do:[:aBlock|
- aBlock value
- ].
- ].
- StandAlone ifFalse:[
- (SilentLoading == true) ifFalse:[ "i.e. undefined counts as false"
- thisIsARestart ifTrue:[
- Transcript cr.
- Transcript showCR:('Smalltalk restarted from:'
- , imageName
- , ' (saved '
- , ObjectMemory imageSaveTime printString
- , ')' ).
- ] ifFalse:[
- Transcript showCR:(self hello).
- Transcript showCR:(self copyrightString).
- ].
- Transcript cr.
- ].
-
- DemoMode==true ifTrue:[
- Transcript showCR:'*** Restricted use: ***'.
- Transcript showCR:'*** This program may be used for education only. ***'.
- Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'.
- Transcript showCR:'*** for more details. ***'.
- Transcript cr.
- ].
- ].
-
- thisIsARestart ifTrue:[
- "/
- "/ the final late notification - users can now assume that
- "/ views, forms etc. have been recreated.
-
- ObjectMemory changed:#returnFromSnapshot.
- ]
+ StartBlocks notNil ifTrue:[
+ StartBlocks do:[:aBlock|
+ aBlock value
+ ].
+ StartBlocks := nil.
+ ].
+ ImageStartBlocks notNil ifTrue:[
+ ImageStartBlocks do:[:aBlock|
+ aBlock value
+ ].
+ ].
+ StandAlone ifFalse:[
+ (SilentLoading == true) ifFalse:[ "i.e. undefined counts as false"
+ thisIsARestart ifTrue:[
+ Transcript cr.
+ Transcript showCR:('Smalltalk restarted from:'
+ , imageName
+ , ' (saved '
+ , ObjectMemory imageSaveTime printString
+ , ')' ).
+ ] ifFalse:[
+ Transcript showCR:(self hello).
+ Transcript showCR:(self copyrightString).
+ ].
+ Transcript cr.
+ ].
+
+ DemoMode==true ifTrue:[
+ Transcript showCR:'*** Restricted use: ***'.
+ Transcript showCR:'*** This program may be used for education only. ***'.
+ Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'.
+ Transcript showCR:'*** for more details. ***'.
+ Transcript cr.
+ ].
+ ].
+
+ thisIsARestart ifTrue:[
+ "/
+ "/ the final late notification - users can now assume that
+ "/ views, forms etc. have been recreated.
+
+ ObjectMemory changed:#returnFromSnapshot.
+ ]
] newProcess.
@@ -3630,60 +3630,60 @@
"/ message.
(StartupClass notNil and:[StartupSelector notNil]) ifTrue:[
- "
- allow more customization by reading an image specific rc-file
- "
- thisIsARestart ifTrue:[
- (imageName asFilename hasSuffix:'img') ifTrue:[
- imageName := imageName copyWithoutLast:4
- ].
- self fileIn:(imageName , '.rc')
- ].
+ "
+ allow more customization by reading an image specific rc-file
+ "
+ thisIsARestart ifTrue:[
+ (imageName asFilename hasSuffix:'img') ifTrue:[
+ imageName := imageName copyWithoutLast:4
+ ].
+ self fileIn:(imageName , '.rc')
+ ].
"/ Display notNil ifTrue:[
"/ Display exitOnLastClose:true.
"/ ].
"/ Processor exitWhenNoMoreUserProcesses:true.
- process := [
- StandAlone ifTrue:[
- AbortOperationRequest handle:[:ex |
- 'Smalltalk [info]: aborted - exit.' infoPrintCR.
- OperatingSystem exit:1
- ] do:[
- StartupClass perform:StartupSelector withArguments:StartupArguments.
- ]
- ] ifFalse:[
- StartupClass perform:StartupSelector withArguments:StartupArguments.
- ].
-
- "/
- "/ non-GUI apps exit after the startup;
- "/ assume that GUI apps have created & opened some view ...
- "/
- Display isNil ifTrue:[
- 'Smalltalk [info]: no Display - exit.' infoPrintCR.
- Smalltalk exit.
- ].
- "/
- "/ GUI apps exit after the last user process has finished
- "/
- Display exitOnLastClose:true.
- Processor exitWhenNoMoreUserProcesses:true.
- ] newProcess.
- process priority:(Processor userSchedulingPriority).
- process name:'main'.
- process beGroupLeader.
- process resume.
- process := true. "do not refer to process"
+ process := [
+ StandAlone ifTrue:[
+ AbortOperationRequest handle:[:ex |
+ 'Smalltalk [info]: aborted - exit.' infoPrintCR.
+ OperatingSystem exit:1
+ ] do:[
+ StartupClass perform:StartupSelector withArguments:StartupArguments.
+ ]
+ ] ifFalse:[
+ StartupClass perform:StartupSelector withArguments:StartupArguments.
+ ].
+
+ "/
+ "/ non-GUI apps exit after the startup;
+ "/ assume that GUI apps have created & opened some view ...
+ "/
+ Display isNil ifTrue:[
+ 'Smalltalk [info]: no Display - exit.' infoPrintCR.
+ Smalltalk exit.
+ ].
+ "/
+ "/ GUI apps exit after the last user process has finished
+ "/
+ Display exitOnLastClose:true.
+ Processor exitWhenNoMoreUserProcesses:true.
+ ] newProcess.
+ process priority:(Processor userSchedulingPriority).
+ process name:'main'.
+ process beGroupLeader.
+ process resume.
+ process := true. "do not refer to process"
].
StandAlone ifTrue:[
- Display notNil ifTrue:[
- FlyByHelp notNil ifTrue:[
- FlyByHelp start
- ].
- ].
+ Display notNil ifTrue:[
+ FlyByHelp notNil ifTrue:[
+ FlyByHelp start
+ ].
+ ].
].
"
@@ -3693,13 +3693,13 @@
((Display notNil and:[graphicalMode])
or:[process notNil
or:[HeadlessOperation]]) ifTrue:[
- Processor dispatchLoop.
- "done - the last process finished"
- 'Smalltalk [info]: last process finished - exit.' infoPrintCR.
+ Processor dispatchLoop.
+ "done - the last process finished"
+ 'Smalltalk [info]: last process finished - exit.' infoPrintCR.
] ifFalse:[
- StandAlone ifFalse:[
- self readEvalPrint
- ]
+ StandAlone ifFalse:[
+ self readEvalPrint
+ ]
].
self exit
@@ -3719,27 +3719,27 @@
(commandName, ' [info]: opening display...') infoPrintCR.
Display isNil ifTrue:[
- Screen notNil ifTrue:[
- [
- Screen openDefaultDisplay:nil.
- ] on:Screen deviceOpenErrorSignal do:[:ex|
- ('%1 [error]: No display connection to: %2' bindWith:commandName with:ex parameter) errorPrintCR.
- (commandName, ' [info]: Either set the DISPLAY environment variable,') infoPrintCR.
- (commandName, ' [info]: or start smalltalk with a -display argument.') infoPrintCR.
- HeadlessOperation == true ifFalse:[
- OperatingSystem exit:1.
- ].
- ].
-
- Display notNil ifTrue:[
- (self secureFileIn:'display.rc') ifFalse:[
- "/ 'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' errorPrintCR.
- (self secureFileIn:'keyboard.rc') ifFalse:[
- "/ 'Smalltalk [warning]: no keyboard.rc found; shortkey setting might be wrong.' errorPrintCR.
- ]
- ]
- ].
- ]
+ Screen notNil ifTrue:[
+ [
+ Screen openDefaultDisplay:nil.
+ ] on:Screen deviceOpenErrorSignal do:[:ex|
+ ('%1 [error]: No display connection to: %2' bindWith:commandName with:ex parameter) errorPrintCR.
+ (commandName, ' [info]: Either set the DISPLAY environment variable,') infoPrintCR.
+ (commandName, ' [info]: or start smalltalk with a -display argument.') infoPrintCR.
+ HeadlessOperation == true ifFalse:[
+ OperatingSystem exit:1.
+ ].
+ ].
+
+ Display notNil ifTrue:[
+ (self secureFileIn:'display.rc') ifFalse:[
+ "/ 'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' errorPrintCR.
+ (self secureFileIn:'keyboard.rc') ifFalse:[
+ "/ 'Smalltalk [warning]: no keyboard.rc found; shortkey setting might be wrong.' errorPrintCR.
+ ]
+ ]
+ ].
+ ]
]
"Created: / 06-12-2006 / 15:38:17 / cg"
@@ -3761,15 +3761,15 @@
#earlySystemInstallation is sent for ST80 compatibility
#earlyRestart is send first, nothing has been setup yet.
- (should be used to flush all device dependent entries)
+ (should be used to flush all device dependent entries)
#restarted is send right after.
- (should be used to recreate external resources (fds, bitmaps etc)
+ (should be used to recreate external resources (fds, bitmaps etc)
#returnFromSnapshot is sent last
- (should be used to restart processes, reOpen Streams which cannot
- be automatically be reopened (i.e. Sockets, Pipes) and so on.
- (Notice that positionable fileStreams are already reopened and repositioned)
+ (should be used to restart processes, reOpen Streams which cannot
+ be automatically be reopened (i.e. Sockets, Pipes) and so on.
+ (Notice that positionable fileStreams are already reopened and repositioned)
"
|deb insp transcript idx|
@@ -3793,12 +3793,12 @@
idx := CommandLineArguments indexOf:'-q'.
idx == 0 ifTrue:[
- idx := CommandLineArguments indexOf:'--silent'.
+ idx := CommandLineArguments indexOf:'--silent'.
].
idx ~~ 0 ifTrue:[
- Object infoPrinting:false.
- ObjectMemory infoPrinting:false.
- CommandLineArguments removeAtIndex:idx.
+ Object infoPrinting:false.
+ ObjectMemory infoPrinting:false.
+ CommandLineArguments removeAtIndex:idx.
].
"/
@@ -3833,7 +3833,7 @@
insp := Inspector.
deb := Debugger.
deb notNil ifTrue:[
- deb reinitialize
+ deb reinitialize
].
Inspector := MiniInspector.
Debugger := MiniDebugger.
@@ -3846,7 +3846,7 @@
"/ ObjectFileLoader; therefore, must reload before doing any notifications.
ObjectFileLoader notNil ifTrue:[
- ObjectFileLoader reloadAllRememberedObjectFiles.
+ ObjectFileLoader reloadAllRememberedObjectFiles.
].
"/
@@ -3855,9 +3855,9 @@
"/ a display during early startup.
Screen notNil ifTrue:[
- Screen allScreens do:[:aDisplay |
- aDisplay invalidateConnection
- ].
+ Screen allScreens do:[:aDisplay |
+ aDisplay invalidateConnection
+ ].
].
ObjectMemory changed:#earlySystemInstallation.
@@ -3873,7 +3873,7 @@
"/ (mostly view/GC/color & font stuff)
ObjectMemory
- changed:#earlyRestart; changed:#restarted.
+ changed:#earlyRestart; changed:#restarted.
"/
"/ start catching SIGINT and SIGQUIT
@@ -3887,80 +3887,80 @@
idx := CommandLineArguments indexOf:'--faststart'.
idx == 0 ifTrue:[
- idx := CommandLineArguments indexOf:'--fastStart'.
+ idx := CommandLineArguments indexOf:'--fastStart'.
].
idx ~~ 0 ifTrue:[
- CommandLineArguments removeAtIndex:idx.
+ CommandLineArguments removeAtIndex:idx.
] ifFalse:[
- CallbackSignal := QuerySignal new.
- [
- Class withoutUpdatingChangesDo:[
- (self fileIn:(self commandName , '_r.rc')) ifFalse:[
- "no _r.rc file where executable is; try default smalltalk_r.rc"
- self fileIn:'smalltalk_r.rc'
- ].
- ]
- ] on:CallbackSignal do:[:ex|
- "/ now, display and view-stuff works;
- "/ back to the previous debugging interface
-
- Inspector := insp.
- Debugger := deb.
-
- "/ reinstall Transcript, if not changed during restart.
- "/ if there was no Transcript, go to stderr
-
- (transcript notNil and:[Transcript == Stderr]) ifTrue:[
- Transcript := transcript.
- ].
- Initializing := false.
- ex proceed.
- ].
- CallbackSignal := nil.
+ CallbackSignal := QuerySignal new.
+ [
+ Class withoutUpdatingChangesDo:[
+ (self fileIn:(self commandName , '_r.rc')) ifFalse:[
+ "no _r.rc file where executable is; try default smalltalk_r.rc"
+ self fileIn:'smalltalk_r.rc'
+ ].
+ ]
+ ] on:CallbackSignal do:[:ex|
+ "/ now, display and view-stuff works;
+ "/ back to the previous debugging interface
+
+ Inspector := insp.
+ Debugger := deb.
+
+ "/ reinstall Transcript, if not changed during restart.
+ "/ if there was no Transcript, go to stderr
+
+ (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+ Transcript := transcript.
+ ].
+ Initializing := false.
+ ex proceed.
+ ].
+ CallbackSignal := nil.
].
"/ reinitialization (restart) of Display is normally performed
"/ in the restart script. If this has not been run for some reason,
"/ do in now.
Initializing ifTrue:[
- Display notNil ifTrue:[
- [
- Display reinitializeFor:Screen defaultDisplayName.
- ] on:Screen deviceOpenErrorSignal do:[
- 'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
- Screen defaultDisplayName errorPrintCR.
- OperatingSystem exit:1.
- ].
- ].
- "/ now, display and view-stuff works;
- "/ back to the previous debugging interface
-
- Inspector := insp.
- Debugger := deb.
-
- "/ reinstall Transcript, if not changed during restart.
- "/ if there was no Transcript, go to stderr
-
- (transcript notNil and:[Transcript == Stderr]) ifTrue:[
- Transcript := transcript.
- ].
- Initializing := false.
+ Display notNil ifTrue:[
+ [
+ Display reinitializeFor:Screen defaultDisplayName.
+ ] on:Screen deviceOpenErrorSignal do:[
+ 'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
+ Screen defaultDisplayName errorPrintCR.
+ OperatingSystem exit:1.
+ ].
+ ].
+ "/ now, display and view-stuff works;
+ "/ back to the previous debugging interface
+
+ Inspector := insp.
+ Debugger := deb.
+
+ "/ reinstall Transcript, if not changed during restart.
+ "/ if there was no Transcript, go to stderr
+
+ (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+ Transcript := transcript.
+ ].
+ Initializing := false.
].
Screen notNil ifTrue:[
- "clean up leftover screens (and views) that haven't been reopened.
- Operate on a copy, since brokenConnection removes us from AllScreens"
- Screen allScreens copy do:[:eachDisplay |
- eachDisplay isOpen ifFalse:[
- 'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
- eachDisplay errorPrintCR.
- eachDisplay cleanupAfterDispatch; brokenConnection.
- ]
- ].
+ "clean up leftover screens (and views) that haven't been reopened.
+ Operate on a copy, since brokenConnection removes us from AllScreens"
+ Screen allScreens copy do:[:eachDisplay |
+ eachDisplay isOpen ifFalse:[
+ 'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
+ eachDisplay errorPrintCR.
+ eachDisplay cleanupAfterDispatch; brokenConnection.
+ ]
+ ].
].
deb := insp := transcript := nil. "avoid dangling refs"
(StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
- self hideSplashWindow. "/ if there is one, it's now time to hide it
+ self hideSplashWindow. "/ if there is one, it's now time to hide it
].
self mainStartup:true
@@ -4015,7 +4015,7 @@
Initializing := true.
(StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
- self hideSplashWindow. "/ if there is one, it's now time to hide it
+ self hideSplashWindow. "/ if there is one, it's now time to hide it
].
"
@@ -4042,15 +4042,15 @@
CommandLineArguments removeAtIndex:idx.
].
- "/ look for a '--repl' argument
- "/ then go into a read-eval-print loop immediately
- idx := CommandLineArguments indexOf:'--repl'.
- idx ~~ 0 ifTrue:[
- CommandLineArguments removeAtIndex:idx.
- self startSchedulerAndBackgroundCollector.
- self readEvalPrint.
- self exit.
- ].
+ "/ look for a '--repl' argument
+ "/ then go into a read-eval-print loop immediately
+ idx := CommandLineArguments indexOf:'--repl'.
+ idx ~~ 0 ifTrue:[
+ CommandLineArguments removeAtIndex:idx.
+ self startSchedulerAndBackgroundCollector.
+ self readEvalPrint.
+ self exit.
+ ].
"/ look for a '-e filename' or '--execute filename' argument
"/ this will force fileIn of filename only, no standard startup.
@@ -4066,33 +4066,33 @@
].
].
idx ~~ 0 ifTrue:[
- |process|
+ |process|
CommandName := arg := CommandLineArguments at:idx + 1.
CommandLineArguments
removeAtIndex:idx+1; removeAtIndex:idx.
- self startSchedulerAndBackgroundCollector.
- process := [
- arg = '-' ifTrue:[
- self fileInStream:Stdin
- lazy:nil
- silent:nil
- logged:false
- addPath:nil
- ] ifFalse:[
- IsSTScript := true.
- self fileIn:arg.
- ].
- self exit.
- ] newProcess.
- process priority:(Processor userSchedulingPriority).
- process name:'main'.
- process beGroupLeader.
- process resume.
-
- Processor dispatchLoop.
+ self startSchedulerAndBackgroundCollector.
+ process := [
+ arg = '-' ifTrue:[
+ self fileInStream:Stdin
+ lazy:nil
+ silent:nil
+ logged:false
+ addPath:nil
+ ] ifFalse:[
+ IsSTScript := true.
+ self fileIn:arg.
+ ].
+ self exit.
+ ] newProcess.
+ process priority:(Processor userSchedulingPriority).
+ process name:'main'.
+ process beGroupLeader.
+ process resume.
+
+ Processor dispatchLoop.
self exit
].
@@ -4108,7 +4108,7 @@
CommandLineArguments
removeAtIndex:idx+1; removeAtIndex:idx.
- self startSchedulerAndBackgroundCollector.
+ self startSchedulerAndBackgroundCollector.
self
fileInStream:arg readStream
lazy:nil
@@ -4133,7 +4133,7 @@
].
commandFile notNil ifTrue:[
- self startSchedulerAndBackgroundCollector.
+ self startSchedulerAndBackgroundCollector.
(self secureFileIn:commandFile) ifFalse:[
('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
OperatingSystem exit:1.
@@ -4143,14 +4143,14 @@
"/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
commandFile := self commandName asFilename withSuffix:'rc'.
- (didReadRCFile := self secureFileIn:commandFile) ifFalse:[
+ (didReadRCFile := commandFile exists and:[self secureFileIn:commandFile]) ifFalse:[
StandAlone ifFalse:[
- defaultRC := 'smalltalk.rc'
+ defaultRC := 'smalltalk.rc' asFilename
] ifTrue:[
- defaultRC := 'stxapp.rc'
+ defaultRC := 'stxapp.rc' asFilename
].
- didReadRCFile := self secureFileIn:defaultRC.
+ didReadRCFile := defaultRC exists and:[self secureFileIn:defaultRC].
didReadRCFile ifFalse:[
StandAlone ifFalse:[
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
@@ -4165,7 +4165,7 @@
"/ ('Screen is %1' bindWith:Screen) printCR.
didReadRCFile ifFalse:[
- self secureFileIn:'private.rc'.
+ 'private.rc' asFilename exists ifTrue:[ self secureFileIn:'private.rc' ].
"/
"/ No RC file found;
@@ -4181,7 +4181,7 @@
"/ ObjectMemory startBackgroundCollectorAt:5.
"/ ObjectMemory startBackgroundFinalizationAt:5.
self addStartBlock:[
- self startSchedulerAndBackgroundCollector
+ self startSchedulerAndBackgroundCollector
].
].
].
@@ -4786,7 +4786,7 @@
installAutoloadedClassesFromAbbrevFile:aFilename
aFilename readingFileDo:[:abbrevStream |
- self installAutoloadedClassesFromStream:abbrevStream.
+ self installAutoloadedClassesFromStream:abbrevStream.
]
"Created: / 29-07-2011 / 20:39:21 / cg"
@@ -4982,46 +4982,46 @@
maxLevels == 0 ifTrue:[
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
- ^ self
+ ^ self
].
dir := aDirectory asFilename.
dirName := dir pathName.
(dirsConsulted includes:dirName) ifTrue:[
- ^ self
+ ^ self
].
dirsConsulted add:dirName.
(dir / 'NOPACKAGES') exists ifTrue:[
- ^ self.
+ ^ self.
].
(dir / 'NOSUBAUTOLOAD') exists ifTrue:[
- ^ self.
+ ^ self.
].
noAutoloadHere := noAutoloadIn.
noAutoloadHere ifFalse:[
- (dir / 'NOAUTOLOAD') exists ifTrue:[
- noAutoloadHere := true.
- ].
+ (dir / 'NOAUTOLOAD') exists ifTrue:[
+ noAutoloadHere := true.
+ ].
] ifTrue:[
- (dir / 'AUTOLOAD') exists ifTrue:[
- noAutoloadHere := false.
- ].
+ (dir / 'AUTOLOAD') exists ifTrue:[
+ noAutoloadHere := false.
+ ].
].
((dir / 'loadAll') exists or:[(dir / 'abbrev.stc') exists]) ifTrue:[
- KnownPackages isNil ifTrue:[
- KnownPackages := Set new.
- ].
- pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
- KnownPackages add:pkgName
+ KnownPackages isNil ifTrue:[
+ KnownPackages := Set new.
+ ].
+ pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
+ KnownPackages add:pkgName
].
showSplashInLevels >= 0 ifTrue:[
- self showSplashMessage:('Smalltalk [info]: installing autoloaded classes found under "%1"...'
- bindWith:(dirName contractAtBeginningTo:35)).
+ self showSplashMessage:('Smalltalk [info]: installing autoloaded classes found under "%1"...'
+ bindWith:(dirName contractAtBeginningTo:35)).
].
"/
@@ -5029,57 +5029,57 @@
"/ below; however, still traverse the directories to find packages ...
"/
noAutoloadHere ifFalse:[
- [
- self installAutoloadedClassesFromAbbrevFile:(dir / 'abbrev.stc').
- ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
+ [
+ self installAutoloadedClassesFromAbbrevFile:(dir / 'abbrev.stc').
+ ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
].
[
- directoryContents := dir directoryContents asSet. "asSet to speed up remove"
+ directoryContents := dir directoryContents asSet. "asSet to speed up remove"
] on:FileStream openErrorSignal do:[:ex|
- "non-accessable directory: we are done"
- ^ self
+ "non-accessable directory: we are done"
+ ^ self
].
directoryContents removeAllFoundIn:#(
- 'objbc'
- 'objvc'
- 'doc'
- 'CVS'
- 'bitmaps'
- 'resources'
- 'source'
- 'not_delivered'
- 'not_ported'
- ).
+ 'objbc'
+ 'objvc'
+ 'doc'
+ 'CVS'
+ 'bitmaps'
+ 'resources'
+ 'source'
+ 'not_delivered'
+ 'not_ported'
+ ).
dir baseName = 'stx' ifTrue:[
- directoryContents removeAllFoundIn:#(
- 'configurations'
- 'include'
- 'rules'
- 'stc'
- 'support'
- ).
+ directoryContents removeAllFoundIn:#(
+ 'configurations'
+ 'include'
+ 'rules'
+ 'stc'
+ 'support'
+ ).
].
directoryContents do:[:eachFilenameString |
- |f|
-
- f := dir / eachFilenameString.
- f isDirectory ifTrue:[
- self
- recursiveInstallAutoloadedClassesFrom:f
- rememberIn:dirsConsulted
- maxLevels:maxLevels-1
- noAutoload:noAutoloadHere
- packageTop:packageTopPath
- showSplashInLevels:showSplashInLevels - 1.
- ]
+ |f|
+
+ f := dir / eachFilenameString.
+ f isDirectory ifTrue:[
+ self
+ recursiveInstallAutoloadedClassesFrom:f
+ rememberIn:dirsConsulted
+ maxLevels:maxLevels-1
+ noAutoload:noAutoloadHere
+ packageTop:packageTopPath
+ showSplashInLevels:showSplashInLevels - 1.
+ ]
].
showSplashInLevels >= 0 ifTrue:[
- self showSplashMessage:('Smalltalk [info]: installing autoloaded classes from "%1"...'
- bindWith:(dirName contractAtBeginningTo:35)).
+ self showSplashMessage:('Smalltalk [info]: installing autoloaded classes from "%1"...'
+ bindWith:(dirName contractAtBeginningTo:35)).
].
"
@@ -5471,7 +5471,7 @@
classFileName asFilename suffix notEmptyOrNil ifTrue:[
ok := self fileIn:classFileName lazy:loadLazy silent:beSilent.
] ifFalse:[
- ok := self fileInSourceFile:classFileName lazy:loadLazy silent:beSilent.
+ ok := self fileInSourceFile:classFileName lazy:loadLazy silent:beSilent.
]
] ifFalse:[
classFileName := classFileName copyReplaceAll:$: with:$_.
@@ -5583,23 +5583,23 @@
if that did not work, look for an st-source file ...
"
ok ifFalse:[
- filenameToSet := classFileName.
- (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
+ filenameToSet := classFileName.
+ (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
ifFalse:[
alternativeClassFileName notNil ifTrue:[
- filenameToSet := alternativeClassFileName.
- ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
+ filenameToSet := alternativeClassFileName.
+ ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
].
ok ifFalse:[
"
... and in the standard source-directory
"
- filenameToSet := 'source/' , classFileName.
- (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
+ filenameToSet := 'source/' , classFileName.
+ (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
ifFalse:[
alternativeClassFileName notNil ifTrue:[
- filenameToSet := 'source/' , alternativeClassFileName.
- ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
+ filenameToSet := 'source/' , alternativeClassFileName.
+ ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
]
]
]
@@ -5611,47 +5611,47 @@
"
ok ifFalse:[
packageDir notNil ifTrue:[
- packageFile := self getPackageSourceFileName:(packageDir , '/source/' , classFileName).
+ packageFile := self getPackageSourceFileName:(packageDir , '/source/' , classFileName).
packageFile isNil ifTrue:[
- packageFile := (packageDir , '/source/' , classFileName).
+ packageFile := (packageDir , '/source/' , classFileName).
].
filenameToSet := packageFile.
- (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
+ (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
ifFalse:[
alternativeClassFileName notNil ifTrue:[
- packageFile := self getPackageSourceFileName:(packageDir , '/source/' , alternativeClassFileName).
+ packageFile := self getPackageSourceFileName:(packageDir , '/source/' , alternativeClassFileName).
packageFile isNil ifTrue:[
- packageFile := (packageDir , '/source/' , alternativeClassFileName).
+ packageFile := (packageDir , '/source/' , alternativeClassFileName).
].
filenameToSet := packageFile.
- ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
+ ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
].
ok ifFalse:[
- packageFile := self getPackageSourceFileName:(packageDir , '/' , classFileName).
+ packageFile := self getPackageSourceFileName:(packageDir , '/' , classFileName).
packageFile isNil ifTrue:[
- packageFile := (packageDir , '/' , classFileName).
+ packageFile := (packageDir , '/' , classFileName).
].
filenameToSet := packageFile.
- (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
+ (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
ifFalse:[
alternativeClassFileName notNil ifTrue:[
- packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName).
+ packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName).
packageFile isNil ifTrue:[
- packageFile := (packageDir , '/' , alternativeClassFileName).
+ packageFile := (packageDir , '/' , alternativeClassFileName).
].
filenameToSet := packageFile.
- ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
+ ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
].
ok ifFalse:[
"
... and in the standard source-directory
"
- filenameToSet := 'source/' , packageDir , '/' , classFileName.
- (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
+ filenameToSet := 'source/' , packageDir , '/' , classFileName.
+ (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
ifFalse:[
alternativeClassFileName notNil ifTrue:[
- filenameToSet := 'source/' , packageDir , '/' , alternativeClassFileName.
- ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
+ filenameToSet := 'source/' , packageDir , '/' , alternativeClassFileName.
+ ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
]
]
]
@@ -5799,8 +5799,8 @@
and load it. This installs all of its contained classes.
Return true if ok, false if not.
Notice: the argument may not have an extension (by purpose);
- the sharedLib extension (.dll / .so / .sl) is added here, to
- make the caller independent of the underlying operatingSystem."
+ the sharedLib extension (.dll / .so / .sl) is added here, to
+ make the caller independent of the underlying operatingSystem."
|baseName handle libraryFilename packagePath|
@@ -5808,21 +5808,28 @@
baseName := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
baseName exists ifTrue:[
- "/ load local file first...
- handle := ObjectFileLoader loadObjectFile:baseName.
+ "/ load local file first...
+ handle := ObjectFileLoader loadObjectFile:baseName.
].
handle isNil ifTrue:[
- packagePath := self getPackageDirectoryForPackage:packageID.
- packagePath isNil ifTrue:[^ false].
- packagePath := packagePath asFilename.
- libraryFilename := packagePath / baseName.
- libraryFilename exists ifFalse:[
- "in windows (with Borland compiler, DLLs in development environment are under objbc"
- libraryFilename := packagePath / 'objbc' / baseName.
- ].
- libraryFilename exists ifTrue:[
- handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
- ].
+ packagePath := self getPackageDirectoryForPackage:packageID.
+ packagePath isNil ifTrue:[^ false].
+ packagePath := packagePath asFilename.
+ libraryFilename := packagePath / baseName.
+ libraryFilename exists ifFalse:[
+ libraryFilename := nil.
+ #('objbc' 'objvc') do:[:eachPossibleCompiledCodeDir |
+ "in windows, with Borland compiler, DLLs in development environment are under objbc;
+ with MSVC, they are under objvc"
+ libraryFilename isNil ifTrue:[
+ libraryFilename := packagePath / eachPossibleCompiledCodeDir / baseName.
+ libraryFilename exists ifFalse:[ libraryFilename := nil ]
+ ].
+ ].
+ ].
+ (libraryFilename notNil and:[libraryFilename exists]) ifTrue:[
+ handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
+ ].
].
"/ handle notNil ifTrue:[
@@ -5836,7 +5843,7 @@
Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
"
- "Modified: 8.1.1997 / 17:58:56 / cg"
+ "Modified: / 08-10-2011 / 00:08:51 / cg"
!
fileInSourceFile:filename lazy:loadLazy silent:beSilent
@@ -5844,12 +5851,12 @@
"Try all available programming languages"
ProgrammingLanguage allDo:
- [:lang| | f |
- f := (filename endsWith: ('.' , lang sourceFileSuffix))
- ifTrue:[filename]
- ifFalse:[filename , '.' , lang sourceFileSuffix].
- (self fileIn:f lazy:loadLazy silent:beSilent)
- ifTrue:[^true]].
+ [:lang| | f |
+ f := (filename endsWith: ('.' , lang sourceFileSuffix))
+ ifTrue:[filename]
+ ifFalse:[filename , '.' , lang sourceFileSuffix].
+ (self fileIn:f lazy:loadLazy silent:beSilent)
+ ifTrue:[^true]].
^false
"Created: / 16-08-2009 / 14:45:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -5891,10 +5898,10 @@
].
[
(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
- "JV: Changed to give ProgrammingLanguage to choose
- proper reader"
- (ProgrammingLanguage forStream: inStream)
- fileInStream: inStream
+ "JV: Changed to give ProgrammingLanguage to choose
+ proper reader"
+ (ProgrammingLanguage forStream: inStream)
+ fileInStream: inStream
]
] ensure:[
morePath notNil ifTrue:[
@@ -6408,9 +6415,9 @@
"search aFileName in some standard places and try all available languages"
ProgrammingLanguage allDo:
- [:lang| | file |
- file := self getPackageFileName: filenameWithoutSuffix , '.' , lang sourceFileSuffix.
- file ifNotNil:[^file]].
+ [:lang| | file |
+ file := self getPackageFileName: filenameWithoutSuffix , '.' , lang sourceFileSuffix.
+ file ifNotNil:[^file]].
^nil
"Created: / 16-08-2009 / 14:44:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -7189,54 +7196,54 @@
withAbbreviationsFromStream:aStream do:aBlock
"read classname to filename mappings from aStream.
Evaluate aBlock for each tuple:
- class-name , abbrev-name, package
+ class-name , abbrev-name, package
Sigh - all for those poor sys5.3 or MSDOS people with short filenames..."
|line lineNo words nm abbrev pkg category size s w|
lineNo := 0.
[aStream atEnd] whileFalse:[
- line := aStream nextLine.
- lineNo := lineNo + 1.
- line notEmptyOrNil ifTrue:[
- (line startsWith:'#') ifFalse:[
-
- "/ must do it manually, caring for quoted strings.
+ line := aStream nextLine.
+ lineNo := lineNo + 1.
+ line notEmptyOrNil ifTrue:[
+ (line startsWith:'#') ifFalse:[
+
+ "/ must do it manually, caring for quoted strings.
"/ words := line asCollectionOfWords.
- words := OrderedCollection new.
- s := line readStream.
- [s atEnd] whileFalse:[
- s skipSeparators.
- s peek == $' ifTrue:[
- s next.
- w := s upTo:$'.
- s skipSeparators.
- ] ifFalse:[
- w := s upToSeparator
- ].
- words add:w
- ].
- words size >= 3 ifTrue:[
- nm := (words at:1) withoutSeparators.
- abbrev := (words at:2) withoutSeparators.
- pkg := (words at:3) withoutSeparators.
- aBlock argumentCount = 3 ifTrue:[
- aBlock value:nm value:abbrev value:pkg.
- ] ifFalse:[
- words size >= 4 ifTrue:[
- category := words at:4.
- ].
- words size = 5 ifTrue:[
- size := (words at:5) asNumber
- ].
- aBlock value:nm value:abbrev value:pkg value: category value: size
- ]
- ] ifFalse:[
- ('Smalltalk [warning]: malformed line ', lineNo printString , ' in ' , (aStream pathName)) infoPrintCR.
- ]
- ]
- ]
+ words := OrderedCollection new.
+ s := line readStream.
+ [s atEnd] whileFalse:[
+ s skipSeparators.
+ s peek == $' ifTrue:[
+ s next.
+ w := s upTo:$'.
+ s skipSeparators.
+ ] ifFalse:[
+ w := s upToSeparator
+ ].
+ words add:w
+ ].
+ words size >= 3 ifTrue:[
+ nm := (words at:1) withoutSeparators.
+ abbrev := (words at:2) withoutSeparators.
+ pkg := (words at:3) withoutSeparators.
+ aBlock argumentCount = 3 ifTrue:[
+ aBlock value:nm value:abbrev value:pkg.
+ ] ifFalse:[
+ words size >= 4 ifTrue:[
+ category := words at:4.
+ ].
+ words size = 5 ifTrue:[
+ size := (words at:5) asNumber
+ ].
+ aBlock value:nm value:abbrev value:pkg value: category value: size
+ ]
+ ] ifFalse:[
+ ('Smalltalk [warning]: malformed line ', lineNo printString , ' in ' , (aStream pathName)) infoPrintCR.
+ ]
+ ]
+ ]
].
"Modified: / 06-03-2011 / 18:17:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -7539,7 +7546,7 @@
classes need rework.
ST/X revision Naming is:
- <major>.<minor>.<revision>.<release>"
+ <major>.<minor>.<revision>.<release>"
^ 2
@@ -7598,7 +7605,7 @@
to the outside world.
ST/X revision Naming is:
- <major>.<minor>.<revision>.<release>"
+ <major>.<minor>.<revision>.<release>"
^ 1
@@ -7668,7 +7675,7 @@
self minorVersionNr printString ,
'.',
self revisionNr printString)
-
+
"
Smalltalk versionString
@@ -7692,13 +7699,14 @@
!Smalltalk class methodsFor:'documentation'!
version
- ^ '$Id: Smalltalk.st 10724 2011-10-23 17:47:36Z vranyj1 $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.979 2011/10/07 22:08:58 cg Exp $'
!
version_CVS
- ^ '§Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.976 2011/09/11 15:01:45 cg Exp §'
+ ^ 'Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.979 2011/10/07 22:08:58 cg Exp '
!
version_SVN
- ^ '$Id: Smalltalk.st 10724 2011-10-23 17:47:36Z vranyj1 $'
+ ^ '$Id: Smalltalk.st 10729 2011-10-31 22:19:21Z vranyj1 $'
! !
+