--- a/Array.st Wed May 06 06:59:44 2015 +0200
+++ b/Array.st Sun May 10 07:10:08 2015 +0100
@@ -1888,11 +1888,11 @@
"return true if the receiver or recursively any array element in the
receiver refers to aLiteral (i.e. a deep search)"
- self do: [ :el |
- el == aLiteral ifTrue:[^true].
- el class == Array ifTrue:[
- (el refersToLiteral: aLiteral) ifTrue: [^true]
- ]
+ self do:[:el |
+ el == aLiteral ifTrue:[^true].
+ (el class == Array or:[el class == ImmutableArray]) ifTrue:[
+ (el refersToLiteral: aLiteral) ifTrue: [^true]
+ ]
].
^ false
@@ -1910,10 +1910,10 @@
receiver is symbolic and matches aMatchPattern (i.e. a deep search)"
self do:[ :el |
- (el isSymbol and:[ aMatchPattern match: el]) ifTrue:[^true].
- el class == Array ifTrue:[
- (el refersToLiteralMatching: aMatchPattern) ifTrue: [^true]
- ]
+ (el isSymbol and:[ aMatchPattern match: el]) ifTrue:[^true].
+ (el class == Array or:[el class == ImmutableArray]) ifTrue:[
+ (el refersToLiteralMatching: aMatchPattern) ifTrue: [^true]
+ ]
].
^ false
@@ -2648,7 +2648,6 @@
"/ no, simply returning true here is a mistake:
"/ it could be a subclass of Array
"/ (of which the compiler does not know at all ...)
-
self class == Array ifFalse:[^ false].
"/
@@ -2687,9 +2686,10 @@
!Array class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.170 2015-05-03 12:38:00 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.171 2015-05-08 10:29:19 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.170 2015-05-03 12:38:00 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.171 2015-05-08 10:29:19 cg Exp $'
! !
+
--- a/CharacterArray.st Wed May 06 06:59:44 2015 +0200
+++ b/CharacterArray.st Sun May 10 07:10:08 2015 +0100
@@ -42,16 +42,39 @@
documentation
"
CharacterArray is a superclass for all kinds of Strings (i.e.
- (singleByte-)Strings, TwoByteStrings and whatever comes in the future.
-
- This class is abstract, meaning that there are no instances of it.
+ (singleByte-)Strings, TwoByteStrings, UnicodeStrings
+ and whatever my come in the future.
+
+ This class is abstract, meaning that there are no instances of it;
+ concrete subclasses define how the characters are stored (i.e. either as
+ single byte, two-byte or four byte strings).
+
All this class does is provide common protocol for concrete subclasses.
+ Notice:
+ internally, ST/X uses a unicode encoding for ALL characters - both
+ for individual chatacter entities and for strings of characters.
+ When reading/writing files in different encodings, the conversion is
+ done at read/write time by use of a CharacterEncoder instance.
+ These know how to convert to a wide range of encodings.
+
+ Also notice:
+ UTF8 and UTF16 are external encodings of a Unicode string; they are never
+ used internally. When interacting with a UTF8 interface (OS-API or files),
+ you should convert UTF8 into the internal full Unicode right at the interface.
+ Do not keep UTF8 around internally as String instances.
+ The reason is that UTF8 makes it harder to manipulate strings (for example
+ to insert/extract substrings or to get its size. Of such operations would
+ require a scan of the UTF8, which would complicate them).
+ Of course, there may be rare exceptions to this, for example if a file's contents
+ is treated as raw data, and the strings have to be copied/shuffled around only,
+ without any real processing on it.
+
[author:]
Claus Gittinger
[see also:]
- String TwoByteString
+ String TwoByteString Unicode16String Uniode32String
StringCollection
"
! !
@@ -7393,11 +7416,11 @@
!CharacterArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.583 2015-04-22 17:45:10 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.584 2015-05-06 08:51:19 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.583 2015-04-22 17:45:10 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.584 2015-05-06 08:51:19 cg Exp $'
!
version_HG
--- a/Collection.st Wed May 06 06:59:44 2015 +0200
+++ b/Collection.st Sun May 10 07:10:08 2015 +0100
@@ -339,7 +339,6 @@
^ self == Collection
! !
-
!Collection methodsFor:'Compatibility-Dolphin'!
identityIncludes:anObject
@@ -5414,7 +5413,7 @@
!
identicalValuesComputedBy:aBlock
- "true if aBlock answers the same value for all elements of the receiver"
+ "true if aBlock answers identical values for all elements of the receiver"
|first valueForFirstElement|
@@ -5700,7 +5699,7 @@
!
sameValuesComputedBy:aBlock
- "true if aBlock answers the same value for all elements of the receiver"
+ "true if aBlock answers equal values for all elements of the receiver"
|first valueForFirstElement|
@@ -5749,11 +5748,11 @@
!Collection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.363 2015-04-22 17:45:38 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.365 2015-05-07 14:26:49 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.363 2015-04-22 17:45:38 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.365 2015-05-07 14:26:49 cg Exp $'
! !
--- a/ExternalStream.st Wed May 06 06:59:44 2015 +0200
+++ b/ExternalStream.st Sun May 10 07:10:08 2015 +0100
@@ -5452,7 +5452,7 @@
^ OperatingSystem supportsSelect
!
-readWaitWithTimeoutMs:timeout
+readWaitWithTimeoutMs:timeoutOrNil
"suspend the current process, until the receiver
becomes ready for reading or a timeout (in milliseconds) expired.
If data is already available, return immediate.
@@ -5472,19 +5472,19 @@
wasBlocked := OperatingSystem blockInterrupts.
inputSema := Semaphore new name:'readWait'.
[
- timeout notNil ifTrue:[
- Processor signal:inputSema afterMilliseconds:timeout.
- ].
- Processor signal:inputSema onInput:fd.
- Processor activeProcess state:#ioWait.
- inputSema wait.
- hasTimedout := timeout notNil and:[(OperatingSystem readCheck:fd) not].
+ timeoutOrNil notNil ifTrue:[
+ Processor signal:inputSema afterMilliseconds:timeoutOrNil.
+ ].
+ Processor signal:inputSema onInput:fd.
+ Processor activeProcess state:#ioWait.
+ inputSema wait.
+ hasTimedout := timeoutOrNil notNil and:[(OperatingSystem readCheck:fd) not].
] ifCurtailed:[
- Processor disableSemaphore:inputSema.
- wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+ Processor disableSemaphore:inputSema.
+ wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
].
- timeout notNil ifTrue:[
- Processor disableSemaphore:inputSema.
+ timeoutOrNil notNil ifTrue:[
+ Processor disableSemaphore:inputSema.
].
wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
^ hasTimedout
@@ -6485,11 +6485,11 @@
!ExternalStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.417 2015-05-03 12:38:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.418 2015-05-08 01:06:30 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.417 2015-05-03 12:38:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.418 2015-05-08 01:06:30 cg Exp $'
! !
--- a/Number.st Wed May 06 06:59:44 2015 +0200
+++ b/Number.st Sun May 10 07:10:08 2015 +0100
@@ -14,10 +14,10 @@
"{ NameSpace: Smalltalk }"
ArithmeticValue subclass:#Number
- instanceVariableNames:''
- classVariableNames:'DecimalPointCharacterForPrinting DecimalPointCharactersForReading'
- poolDictionaries:''
- category:'Magnitude-Numbers'
+ instanceVariableNames:''
+ classVariableNames:'DecimalPointCharacterForPrinting DecimalPointCharactersForReading'
+ poolDictionaries:''
+ category:'Magnitude-Numbers'
!
!Number class methodsFor:'documentation'!
@@ -125,11 +125,11 @@
|s num|
s := aString readStream.
- num := self readFrom:s decimalPointCharacters:decimalPointCharacters onError:[^ self error:'invalid number'].
+ num := self readFrom:s decimalPointCharacters:decimalPointCharacters onError:[^ ConversionError raiseRequestErrorString:' - invalid number'].
s atEnd ifFalse:[
s skipSeparators.
s atEnd ifFalse:[
- ^ self error:'garbage at end of number'
+ ^ ConversionError raiseRequestErrorString:' - garbage at end of number'
].
].
^ num.
@@ -2513,10 +2513,10 @@
!Number class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.161 2015-03-26 16:20:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.162 2015-05-07 13:57:44 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.161 2015-03-26 16:20:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.162 2015-05-07 13:57:44 stefan Exp $'
! !
--- a/Object.st Wed May 06 06:59:44 2015 +0200
+++ b/Object.st Sun May 10 07:10:08 2015 +0100
@@ -256,6 +256,7 @@
"Modified: / 4.8.1999 / 08:54:06 / stefan"
! !
+
!Object class methodsFor:'Compatibility-ST80'!
rootError
@@ -1753,6 +1754,7 @@
! !
+
!Object methodsFor:'attributes access'!
objectAttributeAt:attributeKey
@@ -2056,6 +2058,7 @@
^ aBlock ensure:[ self addDependent:someone ]
! !
+
!Object methodsFor:'comparing'!
= anObject
@@ -7943,6 +7946,7 @@
^ self
! !
+
!Object methodsFor:'secure message sending'!
?:selector
@@ -8548,6 +8552,7 @@
"
! !
+
!Object methodsFor:'synchronized evaluation'!
freeSynchronizationSemaphore
@@ -9518,6 +9523,13 @@
^ (self class) == aClass
!
+isMenuItem
+ "return true, if the receiver is a menu item inside a MenuPanel, Menu or PopUpmenu.
+ false is returned here - the method is redefined in some classes."
+
+ ^ false
+!
+
isMeta
"return true, if the receiver is some kind of metaclass;
false is returned here - the method is only redefined in Metaclass."
@@ -10273,14 +10285,16 @@
! !
+
+
!Object class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.802 2015-04-26 11:30:22 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.803 2015-05-06 09:27:33 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.802 2015-04-26 11:30:22 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.803 2015-05-06 09:27:33 cg Exp $'
!
version_HG
--- a/ProjectDefinition.st Wed May 06 06:59:44 2015 +0200
+++ b/ProjectDefinition.st Sun May 10 07:10:08 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2006 by eXept Software AG
All Rights Reserved
@@ -6021,6 +6019,17 @@
].
"Created: / 03-06-2011 / 17:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+verbose:aBoolean
+ "enable/disable diagnostic output, which gives more detail on why package loading fails"
+
+ Verbose := aBoolean
+
+ "
+ self verbose:true
+ self verbose:false
+ "
! !
!ProjectDefinition class methodsFor:'private-extension handling'!
@@ -7949,11 +7958,11 @@
!ProjectDefinition class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.548 2015-04-17 15:16:25 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.549 2015-05-07 18:29:48 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.548 2015-04-17 15:16:25 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.549 2015-05-07 18:29:48 cg Exp $'
!
version_SVN
--- a/Smalltalk.st Wed May 06 06:59:44 2015 +0200
+++ b/Smalltalk.st Sun May 10 07:10:08 2015 +0100
@@ -18,15 +18,16 @@
classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses
NumberOfClassesHint SystemPath StartupClass StartupSelector
StartupArguments CommandLine CommandName CommandLineArguments
- CachedAbbreviations VerboseLoading SilentLoading Initializing
- StandAlone HeadlessOperation IsPlugin IsSharedLibraryComponent
- IsSTScript DebuggingStandAlone LogDoits LoadBinaries
- RealSystemPath ResourcePath SourcePath BinaryPath FileInPath
- PackagePath BinaryDirName ResourceDirName SourceDirName
- BitmapDirName PackageDirName FileInDirName ChangeFileName
- ImageStartTime ImageRestartTime DemoMode SaveEmergencyImage
- SpecialObjectArray CallbackSignal ClassesFailedToInitialize
- HasNoConsole IgnoreHalt PackageToPathMapping IgnoreAssertions'
+ CachedAbbreviations VerboseStartup VerboseLoading Verbose
+ SilentLoading Initializing StandAlone HeadlessOperation IsPlugin
+ IsSharedLibraryComponent IsSTScript DebuggingStandAlone LogDoits
+ LoadBinaries RealSystemPath ResourcePath SourcePath BinaryPath
+ FileInPath PackagePath BinaryDirName ResourceDirName
+ SourceDirName BitmapDirName PackageDirName FileInDirName
+ ChangeFileName ImageStartTime ImageRestartTime DemoMode
+ SaveEmergencyImage SpecialObjectArray CallbackSignal
+ ClassesFailedToInitialize HasNoConsole IgnoreHalt
+ PackageToPathMapping IgnoreAssertions'
poolDictionaries:''
category:'System-Support'
!
@@ -544,19 +545,19 @@
"sent from VM via #initializeModules"
Error handle:[:ex |
- ObjectMemory printStackBacktrace.
- 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
- ].
+ ObjectMemory printStackBacktrace.
+ 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.
+ ((DebuggingStandAlone == true) or:[ Smalltalk commandLineArguments includes:'--debug']) ifTrue:[
+ ex reject
+ ].
] do:[
- aClass initialize
+ aClass initialize
].
"Modified: / 11-09-2011 / 17:01:32 / cg"
@@ -603,8 +604,8 @@
Here, a few specific initializations are done, then the actual initialization is
done inside an error handler in basicInitializeSystem.
Notice:
- this is NOT called when an image is restarted;
- in this case the show starts in Smalltalk>>restart."
+ this is NOT called when an image is restarted;
+ in this case the show starts in Smalltalk>>restart."
|idx|
@@ -614,54 +615,79 @@
AbstractOperatingSystem initializeConcreteClass.
CommandLineArguments isEmptyOrNil ifTrue:[
- CommandLineArguments := #('stx') asOrderedCollection.
+ CommandLineArguments := #('stx') asOrderedCollection.
].
CommandLine := CommandLineArguments copy.
CommandLineArguments := CommandLineArguments asOrderedCollection.
CommandName := CommandLineArguments removeFirst. "/ the command
- SilentLoading := (CommandLineArguments includes:'--silentStartup').
- VerboseLoading := (CommandLineArguments includes:'--verboseLoading').
+ (idx := CommandLineArguments indexOf:'--silentStartup') ~~ 0 ifTrue:[
+ SilentLoading := true.
+ CommandLineArguments removeIndex:idx
+ ] ifFalse:[
+ SilentLoading := false.
+ ].
+ (idx := CommandLineArguments indexOf:'--verboseLoading') ~~ 0 ifTrue:[
+ VerboseLoading := true.
+ CommandLineArguments removeIndex:idx
+ ] ifFalse:[
+ VerboseLoading := false.
+ ].
+ (idx := CommandLineArguments indexOf:'--verboseStartup') ~~ 0 ifTrue:[
+ VerboseLoading := true.
+ VerboseStartup := true.
+ CommandLineArguments removeIndex:idx
+ ] ifFalse:[
+ VerboseStartup := false.
+ ].
+ (idx := CommandLineArguments indexOf:'--verbose') ~~ 0 ifTrue:[
+ Verbose := true.
+ VerboseLoading := true.
+ VerboseStartup := true.
+ CommandLineArguments removeIndex:idx
+ ] ifFalse:[
+ Verbose := false.
+ ].
DebuggingStandAlone := false.
StandAlone ifTrue:[
- InfoPrinting := false.
- ObjectMemory infoPrinting:false.
- IgnoreAssertions := true.
-
- idx := CommandLineArguments indexOf:'--debug'.
- idx ~~ 0 ifTrue:[
- DebuggingStandAlone := true.
- ].
- DebuggingStandAlone ifTrue:[
- Inspector := MiniInspector.
- Debugger := MiniDebugger.
- IgnoreAssertions := false.
- ].
+ InfoPrinting := false.
+ ObjectMemory infoPrinting:false.
+ IgnoreAssertions := true.
+
+ idx := CommandLineArguments indexOf:'--debug'.
+ idx ~~ 0 ifTrue:[
+ DebuggingStandAlone := true.
+ ].
+ DebuggingStandAlone ifTrue:[
+ Inspector := MiniInspector.
+ Debugger := MiniDebugger.
+ IgnoreAssertions := false.
+ ].
] ifFalse:[
- "/
- "/ define low-level debugging tools - graphical classes are not prepared yet
- "/ to handle things.
- "/ This will bring us into the MiniDebugger when an error occurs during startup.
- "/
- Inspector := MiniInspector.
- Debugger := MiniDebugger.
- IgnoreAssertions := false.
+ "/
+ "/ define low-level debugging tools - graphical classes are not prepared yet
+ "/ to handle things.
+ "/ This will bring us into the MiniDebugger when an error occurs during startup.
+ "/
+ Inspector := MiniInspector.
+ Debugger := MiniDebugger.
+ IgnoreAssertions := false.
].
Error handle:[:ex |
- StandAlone ifTrue:[
- DebuggingStandAlone ifFalse:[
- 'Startup Error - use --debug command line argument for more info' errorPrintCR.
- Smalltalk exit:1.
- ].
- 'Startup Error' errorPrintCR.
- thisContext fullPrintAll.
- ].
- ex reject.
+ StandAlone ifTrue:[
+ DebuggingStandAlone ifFalse:[
+ 'Startup Error - use "--debug" command line argument for more info' errorPrintCR.
+ Smalltalk exit:1.
+ ].
+ 'Smalltalk [error]: Error during early initialization:' errorPrintCR.
+ thisContext fullPrintAll.
+ ].
+ ex reject.
] do:[
- self basicInitializeSystem
+ self basicInitializeSystem
].
"Modified: / 12-10-2010 / 11:27:47 / cg"
@@ -1794,6 +1820,14 @@
"Created: / 18-11-2010 / 11:20:27 / cg"
!
+verbose
+ ^ Verbose
+!
+
+verbose:aBoolean
+ Verbose := aBoolean
+!
+
vmInstructionTrace:aBoolean
self halt:'not yet implemented'
@@ -2211,12 +2245,12 @@
loadOK "exePath" errorInInitialize|
packageDirOrStringOrNil notNil ifTrue:[
- packageDirOrNil := packageDirOrStringOrNil asFilename.
+ packageDirOrNil := packageDirOrStringOrNil asFilename.
].
VerboseLoading ifTrue:[
- silent := false
+ silent := false
] ifFalse:[
- silent := (SilentLoading or:[ StandAlone ]) or:[ InfoPrinting not ].
+ silent := (SilentLoading or:[ StandAlone ]) or:[ InfoPrinting not ].
].
"For now: have to read the project definition first!!
@@ -2227,112 +2261,112 @@
"maybe, it is already in the image"
projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
(projectDefinitionClass notNil and:[projectDefinitionClass supportedOnPlatform not]) ifTrue:[
- ^ PackageNotCompatibleError raiseRequestWith:aPackageString errorString:' - package is not compatible with this platform'.
+ ^ PackageNotCompatibleError raiseRequestWith:aPackageString errorString:' - package is not compatible with this platform'.
].
"Is there a shared library (.dll or .so) ?"
binaryClassLibraryFilename := ObjectFileLoader
- binaryClassFilenameForPackage:aPackageString
- inDirectory:packageDirOrNil.
+ binaryClassFilenameForPackage:aPackageString
+ inDirectory:packageDirOrNil.
(binaryClassLibraryFilename notNil and:[binaryClassLibraryFilename exists]) ifTrue:[
- |loadErrorOccurred|
-
- loadErrorOccurred := false.
- ObjectFileLoader objectFileLoadErrorNotification handle:[:ex |
- loadErrorOccurred := true.
- ex proceedWith:true.
- ] do:[
- loadOK := (ObjectFileLoader loadObjectFile:binaryClassLibraryFilename) notNil.
- "/ loadOK := self loadPackage:aPackageString fromClassLibrary:binaryClassLibraryFilename.
- ].
- (loadOK and:[loadErrorOccurred not]) ifTrue:[
- silent ifFalse:[
- Transcript showCR:('loaded package: ' , aPackageString , ' from binary classLib file: ' , binaryClassLibraryFilename pathName).
- ].
- "now, all compiled classes have been loaded.
- keep classes in the package which are autoloaded as autoloaded."
- ^ true
- ].
-
- loadErrorOccurred ifTrue:[
- self breakPoint:#cg.
- projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
- projectDefinitionClass notNil ifTrue:[
- projectDefinitionClass supportedOnPlatform ifTrue:[
- "/ load prerequisites...
- projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
- self breakPoint:#cg.
- ].
- ].
- ].
+ |loadErrorOccurred|
+
+ loadErrorOccurred := false.
+ ObjectFileLoader objectFileLoadErrorNotification handle:[:ex |
+ loadErrorOccurred := true.
+ ex proceedWith:true.
+ ] do:[
+ loadOK := (ObjectFileLoader loadObjectFile:binaryClassLibraryFilename) notNil.
+ "/ loadOK := self loadPackage:aPackageString fromClassLibrary:binaryClassLibraryFilename.
+ ].
+ (loadOK and:[loadErrorOccurred not]) ifTrue:[
+ silent ifFalse:[
+ Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from binary classLib file: ' , binaryClassLibraryFilename pathName).
+ ].
+ "now, all compiled classes have been loaded.
+ keep classes in the package which are autoloaded as autoloaded."
+ ^ true
+ ].
+
+ loadErrorOccurred ifTrue:[
+ self breakPoint:#cg.
+ projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
+ projectDefinitionClass notNil ifTrue:[
+ projectDefinitionClass supportedOnPlatform ifTrue:[
+ "/ load prerequisites...
+ projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
+ self breakPoint:#cg.
+ ].
+ ].
+ ].
].
packageDirOrNil isNil ifTrue:[
- ^ PackageNotFoundError raiseRequestWith:aPackageString.
+ ^ PackageNotFoundError raiseRequestWith:aPackageString.
].
"fallback - go through the project definition"
projectDefinitionClass isNil ifTrue:[
- projectDefinitionClassName := ProjectDefinition projectDefinitionClassNameForDefinitionOf:aPackageString.
- "/ try to load the project definition class
- projectDefinitionFilename := (packageDirOrNil / projectDefinitionClassName) withSuffix:'st'.
- projectDefinitionFilename exists ifFalse:[
- projectDefinitionFilename := (packageDirOrNil / 'source' / projectDefinitionClassName) withSuffix:'st'.
- ].
- projectDefinitionFilename exists ifTrue:[
- Class withoutUpdatingChangesDo:[
- Smalltalk silentlyLoadingDo:[
- Error handle:[:ex |
- "/ catch error during initialization;
- ex suspendedContext withAllSendersDo:[:sender |
- sender selector == #initialize ifTrue:[
- sender receiver isBehavior ifTrue:[
- sender receiver name = projectDefinitionClassName ifTrue:[
- errorInInitialize := true
- ]
- ]
- ]
- ].
- errorInInitialize ifFalse:[ ex reject ].
- ] do:[
- projectDefinitionFilename fileIn.
- ].
- ].
- ].
- errorInInitialize ifTrue:[
- Transcript showCR:'Smalltalk [info]: an error happened in #initialize - retry after loading package.'.
- ].
- projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
- ].
+ projectDefinitionClassName := ProjectDefinition projectDefinitionClassNameForDefinitionOf:aPackageString.
+ "/ try to load the project definition class
+ projectDefinitionFilename := (packageDirOrNil / projectDefinitionClassName) withSuffix:'st'.
+ projectDefinitionFilename exists ifFalse:[
+ projectDefinitionFilename := (packageDirOrNil / 'source' / projectDefinitionClassName) withSuffix:'st'.
+ ].
+ projectDefinitionFilename exists ifTrue:[
+ Class withoutUpdatingChangesDo:[
+ Smalltalk silentlyLoadingDo:[
+ Error handle:[:ex |
+ "/ catch error during initialization;
+ ex suspendedContext withAllSendersDo:[:sender |
+ sender selector == #initialize ifTrue:[
+ sender receiver isBehavior ifTrue:[
+ sender receiver name = projectDefinitionClassName ifTrue:[
+ errorInInitialize := true
+ ]
+ ]
+ ]
+ ].
+ errorInInitialize ifFalse:[ ex reject ].
+ ] do:[
+ projectDefinitionFilename fileIn.
+ ].
+ ].
+ ].
+ errorInInitialize ifTrue:[
+ Transcript showCR:'Smalltalk [warning]: an error happened in #initialize - retry after loading package.'.
+ ].
+ projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
+ ].
].
projectDefinitionClass notNil ifTrue:[
- projectDefinitionClass autoload.
- projectDefinitionClass supportedOnPlatform ifFalse:[
- ^ PackageNotCompatibleError raiseRequestWith:aPackageString errorString:' - package is not compatible with this platform'.
- ].
- projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
- somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
- errorInInitialize ifTrue:[
- Transcript showCR:('Smalltalk [info]: retrying #initialize').
- projectDefinitionClass initialize.
- ].
- (silent not and:[somethingHasBeenLoaded]) ifTrue:[
- Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
- ].
- ^ true.
+ projectDefinitionClass autoload.
+ projectDefinitionClass supportedOnPlatform ifFalse:[
+ ^ PackageNotCompatibleError raiseRequestWith:aPackageString errorString:' - package is not compatible with this platform'.
+ ].
+ projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
+ somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
+ errorInInitialize ifTrue:[
+ Transcript showCR:('Smalltalk [info]: retrying #initialize').
+ projectDefinitionClass initialize.
+ ].
+ (silent not and:[somethingHasBeenLoaded]) ifTrue:[
+ Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
+ ].
+ ^ true.
].
"/ source files-file loading no longer supported
"/ however, allow for autoload-stub loaded
doLoadAsAutoloaded ifTrue:[
- self
- recursiveInstallAutoloadedClassesFrom:packageDirOrNil
- rememberIn:(Set new)
- maxLevels:2
- noAutoload:false
- packageTop:packageDirOrNil
- showSplashInLevels:0.
- ^ true
+ self
+ recursiveInstallAutoloadedClassesFrom:packageDirOrNil
+ rememberIn:(Set new)
+ maxLevels:2
+ noAutoload:false
+ packageTop:packageDirOrNil
+ showSplashInLevels:0.
+ ^ true
].
^ PackageNotFoundError raiseRequestWith:aPackageString errorString:' - no projectDef, dll or loadAll found'.
@@ -2693,13 +2727,13 @@
Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
doLoadAsAutoloaded ifFalse:[
- "/ force autoloading...
- Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
+ "/ force autoloading...
+ Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
].
self loadExtensionsFromDirectory:packageDir.
VerboseLoading ifTrue:[
- Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
+ Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
].
^ true
@@ -4111,220 +4145,243 @@
while reading patches- and rc-file, do not add things into change-file
"
Class withoutUpdatingChangesDo:[
- |commandFile defaultRC prevCatchSetting
- isEval isPrint isFilter isRepl idxFileArg process|
-
- isEval := isPrint := isFilter := isRepl := false.
- didReadRCFile := false.
-
- StandAlone ifFalse:[
- "/
- "/ look for any '-q', '-e', '-l' or '-f' command line arguments
- "/ and handle them;
- "/ read startup and patches file
- "/
- idx := CommandLineArguments indexOfAny:#('-R' '--repl').
- isRepl := (idx ~~ 0).
-
- idx := CommandLineArguments indexOfAny:#('-q' '--silent').
- idx ~~ 0 ifTrue:[
- Object infoPrinting:false.
- ObjectMemory infoPrinting:false.
- CommandLineArguments removeAtIndex:idx.
- ].
-
- [
- idx := CommandLineArguments indexOfAny:#('-pp' '--packagePath').
- idx ~~ 0
- ] whileTrue:[
- arg := CommandLineArguments at:idx + 1.
- CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
- self packagePath addLast:arg.
- ].
-
- [
- idx := CommandLineArguments indexOfAny:#('-l' '--load').
- idx ~~ 0
- ] whileTrue:[
- arg := CommandLineArguments at:idx + 1.
- CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
- arg asFilename exists ifTrue:[
- Smalltalk fileIn:arg
- ] ifFalse:[
- Smalltalk loadPackage:arg
- ].
- ].
-
- "/ look for a '-e filename' or '--execute filename' argument
- "/ this will force fileIn of filename only, no standard startup.
-
- idx := CommandLineArguments indexOfAny:#('-e' '--execute' '--script').
- idx ~~ 0 ifTrue:[
- SilentLoading := true.
- CommandName := arg := CommandLineArguments at:idx + 1.
-
- CommandLineArguments
- removeAtIndex:idx+1; removeAtIndex:idx.
-
- self startSchedulerAndBackgroundCollector.
- keepSplashWindow ifFalse:[ self hideSplashWindow ].
- Initializing := false.
-
- process := [
- UserInterrupt handle:[:ex |
- self exit:128+(OperatingSystem sigINT).
- ] do:[
- arg = '-' ifTrue:[
- self fileInStream:Stdin
- lazy:nil
- silent:nil
- logged:false
- addPath:nil
- ] ifFalse:[
- IsSTScript := true.
- self fileIn:arg.
- ].
- ].
- "/ after the script, if Screen has been opened and there are any open windows,
- "/ then do not exit
- Display notNil ifTrue:[
- Display exitOnLastClose:true.
- Display checkForEndOfDispatch.
- Processor exitWhenNoMoreUserProcesses:true.
- ] ifFalse:[
- self exit.
- ].
- ] newProcess.
- process priority:(Processor userSchedulingPriority).
- process name:'main'.
- process beGroupLeader.
- process resume.
-
- Processor dispatchLoop.
- self exit
- ].
-
- "look for a '-f filename' or '--file filename' argument
- if scripting, thisis loaded before -P, -E or-R action.
- if not scripting, this will force evaluation of filename instead of smalltalk.rc"
- idxFileArg := CommandLineArguments indexOfAny:#('-f' '--file').
- (idxFileArg ~~ 0) ifTrue:[
- commandFile := CommandLineArguments at:idxFileArg+1.
- CommandLineArguments removeAtIndex:idxFileArg+1; removeAtIndex:idxFileArg.
- ].
-
- "/ look for a '-E expr' or '--eval expr' argument (-P or --print to print the result of evaluation)
- "/ or -F/--filter or a '--repl' argument
- "/ E, P and F this will force evaluation of expr only, no standard startup
- "/ repl go into an interactive loop.
- idx := CommandLineArguments indexOfAny:#('-E' '--eval').
- (isEval := (idx ~~ 0)) ifFalse:[
- idx := CommandLineArguments indexOfAny:#('-P' '--print').
- (isPrint := (idx ~~ 0)) ifFalse:[
- idx := CommandLineArguments indexOfAny:#('-F' '--filter').
- (isFilter := (idx ~~ 0)) ifFalse:[
- idx := CommandLineArguments indexOfAny:#('-R' '--repl').
- isRepl := (idx ~~ 0)
- ].
- ].
- ].
-
- (isEval | isPrint | isFilter | isRepl) ifTrue:[
- isRepl ifFalse:[
- CommandLineArguments size <= idx ifTrue:[
- 'stx: missing argument after -E/-P/-F' errorPrintCR.
- self exit:1.
- ].
- arg := CommandLineArguments at:idx + 1.
- CommandLineArguments removeAtIndex:idx+1.
- ].
- CommandLineArguments removeAtIndex:idx.
-
- self startSchedulerAndBackgroundCollector.
- keepSplashWindow ifFalse:[ self hideSplashWindow ].
- Initializing := false.
-
- "/ enable this, so we can provide $1..$n in the script
- ParserFlags allowDollarInIdentifier:true.
- ParserFlags warnDollarInIdentifier:false.
-
- "/ add bindings for arguments
- CommandLineArguments doWithIndex:[:arg :i |
- Workspace workspaceVariableAt:('_$',i printString) put:arg.
- ].
-
- "/ all of the above allow for a -f file to be loaded before any other action
- (commandFile notNil) ifTrue:[
- (self secureFileIn:commandFile) ifFalse:[
- ('Smalltalk [error]: "', commandFile, '" not found.') errorPrintCR.
- OperatingSystem exit:1.
- ]
- ].
-
- isRepl ifTrue:[
- self readEvalPrint.
- self exit.
- ].
- process := [
- UserInterrupt handle:[:ex |
- self exit:128+(OperatingSystem sigINT).
- ] do:[
- isFilter ifTrue:[
- "/ --filter - apply code to each input line.
- "/ compile code only once
- Compiler
- compile:'doIt ',arg
- forClass:String
- notifying:(EvalScriptingErrorHandler new source:arg).
-
- [Stdin atEnd] whileFalse:[
- |line|
-
- line := Stdin nextLine.
- line doIt.
- ].
- ] ifFalse:[
- "/ --print or --eval
- |rslt|
-
- rslt := Parser new
- evaluate:arg
- notifying:(EvalScriptingErrorHandler new source:arg)
- compile:true.
- isPrint ifTrue:[
- rslt printCR.
- ].
- ].
- ].
- "/ after the script, if Screen has been opened and there are any open windows,
- "/ then do not exit
- Display notNil ifTrue:[
- Display exitOnLastClose:true.
- Display checkForEndOfDispatch.
- Processor exitWhenNoMoreUserProcesses:true.
- ] ifFalse:[
- self exit.
- ].
- ] newProcess.
- process priority:(Processor userSchedulingPriority).
- process name:'main'.
- process beGroupLeader.
- process resume.
-
- Processor dispatchLoop.
- self exit
- ].
- ].
-
- commandFile notNil ifTrue:[
- SilentLoading := true. "/ suppress the hello & copyright messages
- self addStartBlock:
- [
- (self secureFileIn:commandFile) ifFalse:[
- ('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
- OperatingSystem exit:1.
- ].
- ].
+ |commandFile defaultRC prevCatchSetting
+ isEval isPrint isFilter isRepl idxFileArg process|
+
+ isEval := isPrint := isFilter := isRepl := false.
+ didReadRCFile := false.
+
+ StandAlone ifFalse:[
+ "/
+ "/ look for any '-q', '-e', '-l' or '-f' command line arguments
+ "/ and handle them;
+ "/ read startup and patches file
+ "/
+ idx := CommandLineArguments indexOfAny:#('-R' '--repl').
+ isRepl := (idx ~~ 0).
+
+ idx := CommandLineArguments indexOfAny:#('-q' '--silent').
+ idx ~~ 0 ifTrue:[
+ Object infoPrinting:false.
+ ObjectMemory infoPrinting:false.
+ CommandLineArguments removeAtIndex:idx.
+ SilentLoading := true.
+ ].
+
+ [
+ idx := CommandLineArguments indexOfAny:#('-pp' '--packagePath').
+ idx ~~ 0
+ ] whileTrue:[
+ arg := CommandLineArguments at:idx + 1.
+ CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
+ self packagePath addLast:arg.
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: add to packagePath: "', arg, '".') infoPrintCR.
+ ].
+ ].
+
+ [
+ idx := CommandLineArguments indexOfAny:#('-l' '--load').
+ idx ~~ 0
+ ] whileTrue:[
+ arg := CommandLineArguments at:idx + 1.
+ CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
+ arg asFilename exists ifTrue:[
+ Smalltalk fileIn:arg
+ ] ifFalse:[
+ Smalltalk loadPackage:arg
+ ].
+ ].
+
+ "/ look for a '-e filename' or '--execute filename' argument
+ "/ this will force fileIn of filename only, no standard startup.
+
+ idx := CommandLineArguments indexOfAny:#('-e' '--execute' '--script').
+ idx ~~ 0 ifTrue:[
+ SilentLoading := true.
+ CommandName := arg := CommandLineArguments at:idx + 1.
+
+ CommandLineArguments
+ removeAtIndex:idx+1; removeAtIndex:idx.
+
+ self startSchedulerAndBackgroundCollector.
+ keepSplashWindow ifFalse:[ self hideSplashWindow ].
+ Initializing := false.
+
+ process := [
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: reading script from: "', arg, '".') infoPrintCR.
+ ].
+ UserInterrupt handle:[:ex |
+ self exit:128+(OperatingSystem sigINT).
+ ] do:[
+ arg = '-' ifTrue:[
+ self fileInStream:Stdin
+ lazy:nil
+ silent:nil
+ logged:false
+ addPath:nil
+ ] ifFalse:[
+ IsSTScript := true.
+ self fileIn:arg.
+ ].
+ ].
+ "/ after the script, if Screen has been opened and there are any open windows,
+ "/ then do not exit
+ Display notNil ifTrue:[
+ Display exitOnLastClose:true.
+ Display checkForEndOfDispatch.
+ Processor exitWhenNoMoreUserProcesses:true.
+ ] ifFalse:[
+ self exit.
+ ].
+ ] newProcess.
+ process priority:(Processor userSchedulingPriority).
+ process name:'main'.
+ process beGroupLeader.
+ process resume.
+
+ Processor dispatchLoop.
+ self exit
+ ].
+
+ "look for a '-f filename' or '--file filename' argument
+ if scripting, thisis loaded before -P, -E or-R action.
+ if not scripting, this will force evaluation of filename instead of smalltalk.rc"
+ idxFileArg := CommandLineArguments indexOfAny:#('-f' '--file').
+ (idxFileArg ~~ 0) ifTrue:[
+ commandFile := CommandLineArguments at:idxFileArg+1.
+ CommandLineArguments removeAtIndex:idxFileArg+1; removeAtIndex:idxFileArg.
+ ].
+
+ "/ look for a '-E expr' or '--eval expr' argument (-P or --print to print the result of evaluation)
+ "/ or -F/--filter or a '--repl' argument
+ "/ E, P and F this will force evaluation of expr only, no standard startup
+ "/ repl go into an interactive loop.
+ idx := CommandLineArguments indexOfAny:#('-E' '--eval').
+ (isEval := (idx ~~ 0)) ifFalse:[
+ idx := CommandLineArguments indexOfAny:#('-P' '--print').
+ (isPrint := (idx ~~ 0)) ifFalse:[
+ idx := CommandLineArguments indexOfAny:#('-F' '--filter').
+ (isFilter := (idx ~~ 0)) ifFalse:[
+ idx := CommandLineArguments indexOfAny:#('-R' '--repl').
+ isRepl := (idx ~~ 0)
+ ].
+ ].
+ ].
+
+ (isEval | isPrint | isFilter | isRepl) ifTrue:[
+ isRepl ifFalse:[
+ CommandLineArguments size <= idx ifTrue:[
+ 'stx: missing argument after -E/-P/-F' errorPrintCR.
+ self exit:1.
+ ].
+ arg := CommandLineArguments at:idx + 1.
+ CommandLineArguments removeAtIndex:idx+1.
+ ].
+ CommandLineArguments removeAtIndex:idx.
+
+ self startSchedulerAndBackgroundCollector.
+ keepSplashWindow ifFalse:[ self hideSplashWindow ].
+ Initializing := false.
+
+ "/ enable this, so we can provide $1..$n in the script
+ ParserFlags allowDollarInIdentifier:true.
+ ParserFlags warnDollarInIdentifier:false.
+
+ "/ add bindings for arguments
+ CommandLineArguments doWithIndex:[:arg :i |
+ Workspace workspaceVariableAt:('_$',i printString) put:arg.
+ ].
+
+ "/ all of the above allow for a -f file to be loaded before any other action
+ (commandFile notNil) ifTrue:[
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: reading command file from: "', commandFile, '".') infoPrintCR.
+ ].
+ (self secureFileIn:commandFile) ifFalse:[
+ ('Smalltalk [error]: "', commandFile, '" not found.') errorPrintCR.
+ OperatingSystem exit:1.
+ ]
+ ].
+
+ isRepl ifTrue:[
+ self readEvalPrint.
+ self exit.
+ ].
+ process := [
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: executing expression: "', arg, '".') infoPrintCR.
+ ].
+ UserInterrupt handle:[:ex |
+ self exit:128+(OperatingSystem sigINT).
+ ] do:[
+ isFilter ifTrue:[
+ "/ --filter - apply code to each input line.
+ "/ compile code only once
+ Compiler
+ compile:'doIt ',arg
+ forClass:String
+ notifying:(EvalScriptingErrorHandler new source:arg).
+
+ [Stdin atEnd] whileFalse:[
+ |line|
+
+ line := Stdin nextLine.
+ line doIt.
+ ].
+ ] ifFalse:[
+ "/ --print or --eval
+ |rslt|
+
+ rslt := Parser new
+ evaluate:arg
+ notifying:(EvalScriptingErrorHandler new source:arg)
+ compile:true.
+ isPrint ifTrue:[
+ rslt printCR.
+ ].
+ ].
+ ].
+
+ "/ after the script, if Screen has been opened and there are any open windows,
+ "/ then do not exit
+ Display notNil ifTrue:[
+ Display exitOnLastClose:true.
+ Display checkForEndOfDispatch.
+ Processor exitWhenNoMoreUserProcesses:true.
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: display opened.') infoPrintCR.
+ ].
+ ] ifFalse:[
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: no display - exit after script.') infoPrintCR.
+ ].
+ self exit.
+ ].
+ ] newProcess.
+ process priority:(Processor userSchedulingPriority).
+ process name:'main'.
+ process beGroupLeader.
+ process resume.
+
+ Processor dispatchLoop.
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: exit normally.') infoPrintCR.
+ ].
+ self exit
+ ].
+ ].
+
+ commandFile notNil ifTrue:[
+ SilentLoading := true. "/ suppress the hello & copyright messages
+ self addStartBlock:
+ [
+ (self secureFileIn:commandFile) ifFalse:[
+ ('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
+ OperatingSystem exit:1.
+ ].
+ ].
"/ self startSchedulerAndBackgroundCollector.
"/ keepSplashWindow ifFalse:[ self hideSplashWindow ].
@@ -4334,67 +4391,67 @@
"/ ('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
"/ OperatingSystem exit:1.
"/ ].
- ] ifFalse:[
- "/ look for <command>.rc
- "/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
-
- commandFile := self commandName asFilename withSuffix:'rc'.
- (didReadRCFile := commandFile exists and:[self secureFileIn:commandFile]) ifFalse:[
- StandAlone ifFalse:[
- defaultRC := 'smalltalk.rc' "/asFilename
- ] ifTrue:[
- defaultRC := 'stxapp.rc' "/asFilename
- ].
- "JV@2011-11-01: DO NOT check defaultRC exist - this prevents smalltalk to
- to be started with different working directory than stx/projects/smalltalk !!!!!!"
-
- "/didReadRCFile := defaultRC exists and:[self secureFileIn:defaultRC].
- didReadRCFile := (self getSystemFileName:defaultRC) notNil
- and:[self secureFileIn:defaultRC].
- didReadRCFile ifFalse:[
- StandAlone ifFalse:[
- 'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
- graphicalMode := false.
- ]
- ]
- ].
-
- "/ ('StandAlone is %1' bindWith:StandAlone) printCR.
- "/ ('Headless is %1' bindWith:HeadlessOperation) printCR.
- "/ ('Display is %1' bindWith:Display) printCR.
- "/ ('Screen is %1' bindWith:Screen) printCR.
-
- keepSplashWindow ifFalse:[ self hideSplashWindow ].
- didReadRCFile ifFalse:[
- 'private.rc' asFilename exists ifTrue:[ self secureFileIn:'private.rc' ].
-
- "/
- "/ No RC file found;
- "/ Setup more default stuff
- "/
- StandAlone ifFalse:[
- "/ its a smalltalk - proceed in interpreter.
- 'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
- graphicalMode := false.
- ].
-
- "/ setup more defaults...
+ ] ifFalse:[
+ "/ look for <command>.rc
+ "/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
+
+ commandFile := self commandName asFilename withSuffix:'rc'.
+ (didReadRCFile := commandFile exists and:[self secureFileIn:commandFile]) ifFalse:[
+ StandAlone ifFalse:[
+ defaultRC := 'smalltalk.rc' "/asFilename
+ ] ifTrue:[
+ defaultRC := 'stxapp.rc' "/asFilename
+ ].
+ "JV@2011-11-01: DO NOT check defaultRC exist - this prevents smalltalk to
+ to be started with different working directory than stx/projects/smalltalk !!!!!!"
+
+ "/didReadRCFile := defaultRC exists and:[self secureFileIn:defaultRC].
+ didReadRCFile := (self getSystemFileName:defaultRC) notNil
+ and:[self secureFileIn:defaultRC].
+ didReadRCFile ifFalse:[
+ StandAlone ifFalse:[
+ 'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
+ graphicalMode := false.
+ ]
+ ]
+ ].
+
+ "/ ('StandAlone is %1' bindWith:StandAlone) printCR.
+ "/ ('Headless is %1' bindWith:HeadlessOperation) printCR.
+ "/ ('Display is %1' bindWith:Display) printCR.
+ "/ ('Screen is %1' bindWith:Screen) printCR.
+
+ keepSplashWindow ifFalse:[ self hideSplashWindow ].
+ didReadRCFile ifFalse:[
+ 'private.rc' asFilename exists ifTrue:[ self secureFileIn:'private.rc' ].
+
+ "/
+ "/ No RC file found;
+ "/ Setup more default stuff
+ "/
+ StandAlone ifFalse:[
+ "/ its a smalltalk - proceed in interpreter.
+ 'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
+ graphicalMode := false.
+ ].
+
+ "/ setup more defaults...
"/ ObjectMemory startBackgroundCollectorAt:5.
"/ ObjectMemory startBackgroundFinalizationAt:5.
- self addStartBlock:[
- self startSchedulerAndBackgroundCollector
- ].
- ].
- ].
- (CommandLineArguments includes:'--scripting') ifTrue:[
- self addStartBlock:[
- StandaloneStartup handleScriptingOptionsFromArguments:CommandLineArguments.
- ].
- ].
+ self addStartBlock:[
+ self startSchedulerAndBackgroundCollector
+ ].
+ ].
+ ].
+ (CommandLineArguments includes:'--scripting') ifTrue:[
+ self addStartBlock:[
+ StandaloneStartup handleScriptingOptionsFromArguments:CommandLineArguments.
+ ].
+ ].
].
HeadlessOperation ifTrue:[
- graphicalMode := false.
+ graphicalMode := false.
].
keepSplashWindow ifFalse:[ self hideSplashWindow ].
@@ -8223,11 +8280,11 @@
!Smalltalk class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1125 2015-04-29 11:23:35 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1129 2015-05-08 01:20:17 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1125 2015-04-29 11:23:35 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1129 2015-05-08 01:20:17 cg Exp $'
!
version_HG
@@ -8238,3 +8295,4 @@
version_SVN
^ '$ Id: Smalltalk.st 10648 2011-06-23 15:55:10Z vranyj1 $'
! !
+
--- a/Stream.st Wed May 06 06:59:44 2015 +0200
+++ b/Stream.st Sun May 10 07:10:08 2015 +0100
@@ -226,6 +226,7 @@
! !
+
!Stream methodsFor:'accessing'!
contents
@@ -3017,7 +3018,7 @@
^ self readWaitWithTimeoutMs:timeout
!
-readWaitWithTimeout:secondsOrTimeDuration
+readWaitWithTimeout:secondsOrTimeDurationOrNil
"suspend the current process, until the receiver
becomes ready for reading or a timeout (in seconds) expired.
If data is already available, return immediate.
@@ -3027,11 +3028,11 @@
|ms|
- secondsOrTimeDuration notNil ifTrue:[
- secondsOrTimeDuration isNumber ifTrue:[
- ms := secondsOrTimeDuration * 1000.
+ secondsOrTimeDurationOrNil notNil ifTrue:[
+ secondsOrTimeDurationOrNil isNumber ifTrue:[
+ ms := secondsOrTimeDurationOrNil * 1000.
] ifFalse:[
- ms := secondsOrTimeDuration getMilliseconds.
+ ms := secondsOrTimeDurationOrNil getMilliseconds.
]
].
^ self readWaitWithTimeoutMs:ms
@@ -3784,11 +3785,11 @@
!Stream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.242 2015-03-25 22:28:27 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.243 2015-05-08 01:06:57 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.242 2015-03-25 22:28:27 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.243 2015-05-08 01:06:57 cg Exp $'
! !