|
Class: Smalltalk
Object
|
+--Smalltalk
- Package:
- stx:libbasic
- Category:
- System-Support
- Version:
- rev:
1.1441
date: 2024/03/27 13:07:50
- user: stefan
- file: Smalltalk.st directory: libbasic
- module: stx stc-classLibrary: libbasic
This is one of the central classes in the system;
it provides all system-startup, shutdown and maintenance support.
Also global variables are (conceptionally) kept here.
As you will notice, this is NOT a Dictionary
- my implementation of globals is totally different
due to the need to be able to access globals from c-code as well,
I do not use associations for globals, but instead keep the
name<->value relations in the VM and access globals via utility
functions found there.
However, it provides the known enumeration protocol.
It may change to become a subclass of collection at some time,
to inherit more collection stuff ...
[Instance variables:]
none - all handling is done in the VM
[Class variables:]
StartBlocks <Collection> blocks to be executed in a separate process after
everything has been initialized. These blocks will
be deleted after execution and therefore not be
executed after an image restart. Initial processes
(such as the Launcher) are usually started here.
These blocks are added by smalltalk.rc/private.rc etc.
via #addStartBlock during early initialization.
ImageStartBlocks
<Collection> blocks to be executed in a separate process after
everything has been initialized. These blocks will be
executed after an image restart.
These blocks are usually added by smalltalk_r.rc etc.
ExitBlocks <Collection> blocks to evaluate before system is
left. Not currently used (GNU-ST compatibility).
SystemPath <Collection> path to search for system files (sources, bitmaps etc)
Set to a default here, but typically changed from some
startup.rc file
PackagePath <Collection> path to search for package.
This is going to replace the above systemPath, and a classes
resources will eventually searched in its package directory.
This list defines the path, where packages are searched for,
initially this is something like /opt/smalltalk/packages.
Set to a default here, but typically changed from some
startup.rc file
StartupClass <Class> class and selector, where the system starts up
StartupSelector <Symbol> (right after VM initialization)
StartupArguments <Array> If an image is saved while those being nonNil,
the image will come up there.
Allows for customized images to be generated from a standard ST/X.
StandAlone programs also set those during initialization.
CommandLine <String> Unix (OS-) command line
CommandName <String> the command (i.e. argv[0])
CommandLineArguments <Array> Unix (OS-) command line arguments broken into words
CommandName has been stripped off.
(initially set by the VM)
SilentLoading <Boolean> OBSOLETE:
suppresses messages during fileIn and in compiler
(can be set to true from a customized main.c)
VerboseLoading <Boolean> generate messages during fileIn and in compiler
(can be set to true from a customized main.c)
Initializing <Boolean> true while (re-)initializing
Controls the behavior of certain error
reporters (for example: suppress dialogBoxes)
while the system is not yet fit for full operation.
StandAlone <Boolean> true, if this is a standalone app;
if true the process scheduler watches for
which processes are still running, and
exits ST/X, when the last non-background
and non-system process exits.
Can be set in an application-specific startup script,
or, for standAlone programs, by C-code during initialization.
HeadlessOperation if true, a non-existing Display connection
<Boolean> will NOT lead to an error-exit during startup.
Default is false.
Can be set in an application-specific startup script,
or, for standAlone programs, by C-code during initialization.
LogDoits <Boolean> if true, doits are also logged in the changes
file. Default is false, since the changes file
may become huge if every tiny doIt is saved there ...
LoadBinaries <Boolean> if true, we attempt to load classes rom a binary
file, if present. If false, this is always suppressed.
SaveEmergencyImage <Boolean> if true (the default), an emergency image
is saved, if the main Display looses its
connection. This is useful if you have a
flaky display connection (serial line)
and want to have your stuff saved automatically
in case of a broken connection.
IgnoreAssertions <Boolean> if true, assertions are ignored (i.e. no errors reported).
Usually false in the development system, true in a standalone deployed app.
strictly private classVariables (helpers):
CachedClasses <Collection> known classes (cached for faster class enumeration)
CachedAbbreviations
<Dictionary> className to filename mappings
RealSystemPath <Collection> cached collection of directories along the path
which really exist. Caching avoids long checks
for existing directories on broken NFS volumes.
SourcePath <Collection> cached names of really existing directories
These are remembered, as in NFS systems,
ResourcePath the time to lookup files may become long
BinaryPath (especially, if some directories are on machines
FileInPath which are not up ...).
Therefore, the set of really
existing directories is cached when the SystemPath
is walked the first time.
A consequence is that you have to invoke
flushSystemPath, when you create any of those
directories while running
(and want the running ST/X to look there)
copyrightCOPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
readme_resourcesWhat is a resource file:
resource files contain language transformation and sometimes
UI-look specifics such as icons etc.
Where are resources stored in the image:
Resource files are only read on demand (i.e. when needed) and only read once
i.e. they are cached in the image).
The cached data is held in a per-class class-instVar named 'ClassResources'.
With only a few exceptions, the only classes which need resources are the GUI
classes under the SimpleView hierarchy.
How does the system find resources:
The idea is that the system-provided resource files can be overwritten
by the user or an application configuration.
This works via a hierarchy of directories where resources are searched for,
with the system's standard resource-files being at the end of that chain.
When searching for a resource file for class X, the following files are searched
in order:
{ResourcePath} / resources / X.rs
{SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs
{ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs
Compatibility-GNU
-
system: command
-
GNU-Smalltalk compatibility: execute an OS command
Usage example(s):
Compatibility-Squeak
-
allClassesAndTraits
( an extension from the stx:libcompat package )
-
for squeak compatibility - currently, there are no traits
-
allClassesAndTraitsDo: aBlock
( an extension from the stx:libcompat package )
-
for squeak compatibility - currently, there are no traits
-
allTraits
( an extension from the stx:libcompat package )
-
-
beep
-
output an audible beep or bell
-
garbageCollect
-
for Squeak compatibility
-
garbageCollectMost
-
collect recently created garbage; return the amount of freeSpace.
In ST/X, only the newSpace is collected here, and the sum of
newSpace + freeListSpace is returned.
-
globals
( an extension from the stx:libcompat package )
-
-
isMorphic
-
-
logChange: aString
( an extension from the stx:libcompat package )
-
Nothing to do
-
os
( an extension from the stx:libcompat package )
-
return the operating system
Usage example(s):
Smalltalk os -> Win32OperatingSystem
|
-
platformName
-
not yet fully implemented (I have to figure out, what squeak returns in each case...)
Usage example(s):
Smalltalk platformName -> 'Win32'
|
-
registerExternalObject: anObject
( an extension from the stx:libcompat package )
-
Register the given object in the external objects array and return its index.
If it is already there, just return its index.
ExternalObjects are protected from GC and can be accessed easily from
primitive code (via the global Smalltalk:SpecialObjectArray)
-
removeClassNamed: aName
-
Invoked from fileouts: if there is currently a class in the system named aName, then remove it.
Also needed by the refactory browser.
If anything untoward happens, report it in the Transcript.
-
renameClassNamed: oldName as: newName
( an extension from the stx:libcompat package )
-
-
unregisterExternalObject: anObject
( an extension from the stx:libcompat package )
-
Unregister the given object in the external objects array.
Do nothing if it isn't registered.
-
windowSystemName
( an extension from the stx:libcompat package )
-
not yet fully implemented (I have to figure out, what squeak returns in each case...)
Usage example(s):
Smalltalk windowSystemName
-> 'Win32'
|
Compatibility-V'Age
-
allClassesImplementing: aSelector
-
-
declareConstant: constantName poolName: poolNameArg value: value
-
visualAge compatible pool variable declaration.
called when a V'age application is filed in
(or one of its changes is accepted via the change browser)
-
declarePoolDictionary: poolDictionaryNameArg
-
visualAge compatible pool declaration.
called when a V'age application is filed in
(or one of its changes is accepted via the change browser)
-
declareVariable: varName poolName: poolNameArg
-
visualAge compatible pool declaration.
called when a V'age application is filed in
(or one of its changes is accepted via the change browser)
Compatibility-VW
-
defineClass: nameSymbol superclass: superclass indexedType: indexed private: private instanceVariableNames: instVars classInstanceVariableNames: classInstVars imports: imports category: category
-
-
defineClass: nameSymbol superclass: superclass indexedType: indexed private: private instanceVariableNames: instVars classInstanceVariableNames: classInstVars imports: imports category: category attributes: annotations
-
-
defineNameSpace: nameSymbol private: private imports: imports category: category
-
what to do ?
-
dialectName
-
Smalltalk dialectName
-
dialectReleaseVersion
-
Smalltalk dialectReleaseVersion
-
versionName
-
Smalltalk versionName
accessing
-
associationAt: aKey
-
return a key-value association for aKey.
Since ST/X's Smalltalk as no real dictionary, this is
simulated here.
-
associationAt: aKey ifAbsent: exceptionBlock
-
return a key-value association for aKey, or the value
from exceptionBlock, if no such key is present.
Since ST/X's Smalltalk as no real dictionary, this is simulated here.
Warning: this is a compatibility interface only, with a different semantic as
the original ST80 implementation. The returned assoc is created on the fly,
and not the one stored in the receiver (there are not assocs there)
-
at: aKey
-
retrieve the value stored under aKey, a symbol.
Return nil if not present
(this will be changed to trigger an error - better use #at:ifAbsent:)
Usage example(s):
TimeDuration toRun:[
1000000 timesRepeat:[
Smalltalk at:#SmallInteger
]
]
|
Usage example(s):
|classNames|
classNames := Smalltalk allClasses collect:#name as:Array.
(TimeDuration toRun:[
classNames do:[:eachClassName|
Smalltalk at:eachClassName
]
]) / classNames size
|
-
at: aKey ifAbsent: aBlock
-
retrieve the value stored at aKey.
If there is nothing stored under this key, return the value of
the evaluation of aBlock.
Usage example(s):
Smalltalk removeKey:#fooBar.
Smalltalk at:#fooBar <- returns nil
Smalltalk at:#fooBar ifAbsent:['sorry'] <- no error
|
-
at: aKey ifAbsentPut: aBlock
-
return the element indexed by aKey if present,
if not present, store the result of evaluating valueBlock
under aKey and return it.
-
at: aKey ifPresent: aBlock
-
try to retrieve the value stored at aKey.
If there is nothing stored under this key, do nothing.
Otherwise, evaluate aBlock, passing the retrieved value as argument.
Usage example(s):
Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what].
Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what].
Smalltalk at:#fooBar put:nil.
Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what].
|
-
at: aKey put: aValue
-
store the argument aValue under aKey, a symbol.
Return aValue (sigh).
-
debugging
-
retruns true if the application has been started with commandline argument --debug
-
includesKey: aKey
-
return true, if the key is known
-
keyAtIdentityValue: anObject
-
Smalltalk keyAtIdentityValue:Object
-
keyAtValue: anObject
-
return the symbol under which anObject is stored - or nil.
This is a slow access, since the receiver is searched sequentially.
NOTICE:
The value is searched using identity compare
Usage example(s):
Smalltalk keyAtValue:Object
|
-
keyAtValue: anObject ifAbsent: exceptionValue
-
return the symbol under which anObject is stored - or the value from exceptionValue.
This is a slow access, since the receiver is searched sequentially.
NOTICE:
The value is searched using identity compare
Usage example(s):
Smalltalk keyAtValue:Object ifAbsent:#foo
Smalltalk keyAtValue:1234 ifAbsent:#foo
|
-
keys
-
return a collection with all keys in the Smalltalk dictionary
-
removeKey: aKey
-
remove the association stored under the key-argument from the globals dictionary.
WARNING:
this is somewhat dangerous: conceptionally, the association is removed,
to which machine & byte compiled code refers if it accesses a global.
If there are still global accesses in some literalArray or from machine-compiled code,
it continues to reference the globals value via that obsolete association and gets a nil
value. (which is correct)
However, if that global is later reintroduced, a new association will be created and
the new global now referenced via the new association.
The old accesses will still see nil, although the globals value is actually non-nil
(this is questionable).
To avoid this problem, the #removeClass: method never removed the key.
-
startBlocks
-
-
values
-
return a collection with all values in the Smalltalk dictionary
browsing
-
browseAllCallsOn: aSelectorSymbol
-
startup a browser for all methods sending a particular message
Usage example(s):
Smalltalk browseAllCallsOn:#at:put:
|
-
browseAllSelect: aBlock
-
startup a browser for all methods for which aBlock returns true
Usage example(s):
Smalltalk browseAllSelect:[:m | m literals isNil]
|
-
browseChanges
-
startup a changes browser
Usage example(s):
-
browseClass: aClass
-
startup a browser on aClass.
The broser will only show that class (i.e. be a singleClass-browser).
See browseInClass: for a full browser, which has aClass selected initially.
Usage example(s):
Smalltalk browseClass:Array
|
-
browseImplementorsMatching: aSelectorSymbolOrMatchPattern
-
startup a browser for all methods implementing a message matching
Usage example(s):
Smalltalk browseImplementorsOf:#'at:put:'
Smalltalk browseImplementorsMatching:#'at:*'
|
-
browseImplementorsOf: aSelectorSymbol
-
startup a browser for all methods implementing a particular message
Usage example(s):
Smalltalk browseImplementorsOf:#at:put:
|
-
browseInClass: aClass
-
startup a full browser showing aClass.
The browser will be a full browser with aClass initially selected.
See browseClass: for a singleClass browser, which shows only a single class.
Usage example(s):
Smalltalk browseInClass:Array
|
-
browseInClass: aClass selector: selector
-
startup a full browser showing aClass>>selector.
The browser will be a full browser with aClass initially selected.
See browseClass: for a singleClass browser, which shows only a single class.
Usage example(s):
Smalltalk browseInClass:Array selector:#at:
|
class management
-
basicRemoveClass: aClass
-
remove the argument, aClass from the smalltalk dictionary;
we have to flush the caches since these methods are now void.
Also, class variables of aClass are removed.
-
changeCategoryOf: aClass to: newCategory
-
change a classes category, add a change record,
send change notifications
Usage example(s):
Smalltalk changeCategoryOf:NewApplication to:#myApplications
|
-
defineNameSpace: name private: private imports: imports category: category attributes: annotations
-
-
flushCachedClass: aClass
-
-
flushCachedClasses
-
Smalltalk flushCachedClasses
-
removeClass: aClass
-
remove the argument, aClass from the smalltalk dictionary;
we have to flush the caches since these methods are now void.
Also, class variables of aClass are removed.
Recompile accessors to aClass.
-
removeClasses: aCollectionOfClasses
-
remove aCollectionOfClasses from the smalltalk dictionary;
we have to flush the caches since these methods are now void.
Also, class variables of aClass are removed.
Recompile accessors to the classes - after all classes in the collection have been removed.
-
renameClass: aClass to: newName
-
rename aClass to newName. Most of the work is in
renaming the classVariables (create & copy over values)
and patching the classes methods to access the new variables.
copying
-
deepCopy
-
redefined to return self - there is only one Smalltalk dictionary
-
deepCopyUsing: aDictionary postCopySelector: postCopySelector
-
return a deep copy of the receiver.
Redefined to return the receiver - there is only one Smalltalk dictionary
-
shallowCopy
-
redefined to return self - there is only one Smalltalk dictionary
-
simpleDeepCopy
-
redefined to return self - there is only one Smalltalk dictionary
debugging ST/X
-
cellAt: aName
-
return the address of a global cell
- used internally for compiler only
-
compileTrace: aBoolean
-
dump generated inline code (NOOP if VM was compiled without the trace-debug option)
Usage example(s):
Smalltalk compileTrace:true
Smalltalk compileTrace:false
|
-
debugBreakPoint
-
call the dummy debug function, on which a breakpoint
can be put in adb, sdb, dbx or gdb.
WARNING: this method is for debugging only
it will be removed without notice.
-
exitWithCoreDump
-
abort the program and dump core
Usage example(s):
Be careful evaluating this:
Smalltalk exitWithCoreDump
|
-
fatalAbort
-
report a fatal-error, print a stack backtrace and exit with core dump.
(You may turn off the stack print with debugPrinting:false)
-
fatalAbort: aMessage
-
report a fatal-error; print a stack backtrace and exit with core dump
(You may turn off the stack print with debugPrinting:false)
-
ignoreHalt
-
return true, if halts are ignored.
Usually, this is done in standAlone applications
-
ignoreHalt: aBoolean
-
control if halts are to be ignored;
usually, this is done in standAlone applications
Usage example(s):
Smalltalk ignoreHalt:true.
self halt.
Smalltalk ignoreHalt:false.
self halt.
|
-
silent
-
returns the Silent class variable.
-
stxLog: formatString args: argArray flags: flagInt level: levelInt subSystem: subSystemString
-
use basic VM log interface
Usage example(s):
self stxLog:'Hello World: %d\n' args:#(4711) flags:0 level:2 subSystem:'Test'
|
-
verbose
-
-
verbose: aBoolean
-
-
vmInstructionTrace: aBoolean
-
enumerating
-
allBehaviorsDo: aBlock
-
evaluate the argument, aBlock for all classes and metaclasses in the system
Usage example(s):
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]
|
-
allClassCategories
-
return a set of all class categories in the system
Usage example(s):
Smalltalk allClassCategories
|
-
allClassesAndMetaclassesDo: aBlock
-
evaluate the argument, aBlock for all classes and metaclasses in the system.
-
allClassesDo: aBlock
-
evaluate the argument, aBlock for all classes in the system.
Enumerates non-meta classes only - not metaclasses
Usage example(s):
Smalltalk allClassesDo:[:aClass | aClass name printCR]
|
-
allClassesForWhich: filter
-
return a collection with all classes in the system,
for which filter evaluates to true.
Enumerates non-meta classes only - not metaclasses
Usage example(s):
Smalltalk
allClassesForWhich:[:cls | cls name startsWith:'Po']
|
-
allClassesForWhich: filter do: aBlock
-
evaluate the argument, aBlock for all classes in the system, for which filter evaluates to true.
Enumerates non-meta classes only - not metaclasses
Usage example(s):
Smalltalk
allClassesForWhich:[:cls | cls name startsWith:'Po']
do:[:aClass | Transcript showCR:aClass name]
|
-
allClassesInCategory: aCategory
-
return a collection of for all classes in aCategory;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic'
|
-
allClassesInCategory: aCategory do: aBlock
-
evaluate the argument, aBlock for all classes in the aCategory;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | Transcript showCR:aClass]
|
-
allClassesInCategory: aCategory inOrderDo: aBlock
-
evaluate the argument, aBlock for all classes in aCategory;
superclasses come first - then subclasses
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR]
|
-
allClassesInOrderDo: aBlock
-
evaluate the argument, aBlock for all classes in the system;
Evaluation order is by inheritance: superclasses come first.
Usage example(s):
Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name]
|
-
allClassesInPackage: aPackageID
-
evaluate the argument, aBlock for all classes in a package;
The order of the classes is not defined.
The returned collection may include private classes
Usage example(s):
Smalltalk allClassesInPackage:'bosch:dapasx'
|
-
allClassesInPackage: aPackageID do: aBlock
-
evaluate the argument, aBlock for all classes in a package;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInPackage:'bosch:dapasx' do:[:aClass | Transcript showCR:aClass]
|
-
allClassesMatchingCategory: aCategoryPattern
-
return a collection of for all classes matching aCategoryPattern;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInCategory:'Collections-Arrayed'
Smalltalk allClassesMatchingCategory:'Collections-*'
|
-
allClassesMatchingPackage: aPackageIDPattern
-
evaluate the argument, aBlock for all classes matching packagePattern;
The order of the classes is not defined.
The returned collection may include private classes
Usage example(s):
Smalltalk allClassesInPackage:'exept:bridgeFramework'
Smalltalk allClassesMatchingPackage:'exept:bridgeFramework*'
|
-
allKeysDo: aBlock
-
evaluate the argument, aBlock for all keys in the Smalltalk dictionary
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
allMethodCategories
-
return a set of all method-categories (protocols) in the system
Usage example(s):
Smalltalk allMethodCategories
|
-
allMethodsDo: aBlock
-
enumerate all methods in all classes
-
allMethodsForWhich: aBlock
-
return a collection of methods for which aBlock returns true
Usage example(s):
Smalltalk allMethodsForWhich:[:m | m isObsolete].
Smalltalk allMethodsForWhich:#isObsolete.
|
-
allMethodsForWhich: aCheckBlock do: actionBlock
-
enumerate methods for which aCheckBlock returns true
Usage example(s):
Smalltalk allMethodsForWhich:[:m | m isObsolete] do:[:m | Transcript showCR:m].
Smalltalk allMethodsForWhich:#isObsolete do:[:m | Transcript showCR:m].
|
-
allMethodsWithSelectorDo: aTwoArgBlock
-
enumerate all methods in all classes and evaluate aBlock
with method and selector as arguments.
-
associationsDo: aBlock
-
evaluate the argument, aBlock for all key/value pairs
in the Smalltalk dictionary
Usage example(s):
Smalltalk associationsDo:[:assoc | assoc printCR]
|
-
basicKeys
-
for rel > 5 only
-
do: aBlock
-
evaluate the argument, aBlock for all values in the Smalltalk dictionary
-
keysAndValuesDo: aBlock
-
evaluate the two-arg block, aBlock for all keys and values
-
keysAndValuesSelect: selectBlockWith2Args thenCollect: collectBlockWith2Args
-
Smalltalk
keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]]
thenCollect:[:nm :val | nm]
-
keysDo: aBlock
-
evaluate the argument, aBlock for all keys in the Smalltalk dictionary
initialization
-
basicInitializeSystem
-
initialize all other classes.
This one is the very first entry into the smalltalk world
[with error handling, via the initializeSystem],
right after startup, usually immediately followed by Smalltalk>>start.
Notice:
this is NOT called when an image is restarted; in this
case the show starts in Smalltalk>>restart.
Usage example(s):
'basicInitializeSystem' infoPrintCR.
|
-
initGlobalsFromEnvironment
-
setup globals from the shell-environment
Usage example(s):
Smalltalk initGlobalsFromEnvironment
Smalltalk language
Smalltalk languageTerritory
|
-
initInterrupts
-
initialize interrupts
Usage example(s):
-
initStandardStreams
-
initialize some well-known streams
Usage example(s):
Smalltalk initStandardStreams
|
-
initStandardTools
-
predefine some tools which we might need later
- if the view-classes exist,
they will redefine Inspector and Debugger for graphical interfaces
Usage example(s):
Smalltalk initStandardTools
|
-
initSystemPath
-
setup path where system files are searched for.
the default path is set to:
.
<directory of exe> (WIN32 only)
$HOME (if defined)
$HOME/.smalltalk (if defined & existing)
$SMALLTALK_LIBDIR (if defined & existing)
$STX_LIBDIR (if defined & existing)
$STX_TOPDIR (if defined & existing)
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only)
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir') (WIN32 only)
<standard places>
standard places (unix):
/opt/smalltalk/<release> (if existing)
/opt/smalltalk (if existing)
/usr/local/lib/smalltalk (if existing)
/usr/lib/smalltalk (if existing)
/lib/smalltalk (if existing)
win32:
\programs\exept\smalltalk (if existing)
\programs\smalltalk (if existing)
\smalltalk (if existing)
vms:
$stx:lib (if existing)
$stx:root (if existing)
of course, it is possible to add entries from the 'smalltalk.rc'
startup file; add expressions such as:
Smalltalk systemPath addFirst:'/foo/bar/baz'.
or:
Smalltalk systemPath addLast:'/fee/foe/foo'.
However, smalltalk.rc itself must be found along the above path.
Usage example(s):
Smalltalk initSystemPath
Smalltalk systemPath
SystemPath := nil.
PackagePath := nil.
OperatingSystem defaultSystemPath
OperatingSystem defaultPackagePath
|
-
initUserPreferences
-
setup other stuff
-
initializeClass: aClass
-
sent from VM via #initializeModules
-
initializeModules
-
perform module specific initialization and
send #initialize to all classes.
Notice: this is NOT called when an image is restarted
-
initializeModulesOnce
-
perform module specific initialization and
send #initialize to all classes.
Notice: this is not called when an image is restarted
-
initializeSystem
-
initialize all classes; setup dispatcher processes etc.
This one is the very first entry into the smalltalk world,
right after startup, usually immediately followed by Smalltalk>>start.
Here, a few specific initializations are done, then the actual initialization is
done inside an error handler in basicInitializeSystem.
Notice:
this is called by the VM's main entry. You will not find senders from Smalltalk.
Also Notice:
this is NOT called when an image is restarted;
in this case the show starts in Smalltalk>>restart.
-
initializeVerboseFlags
-
notice: (currently) -V is a VM flag, not visible here
-
isInitialized
-
this returns true, if the system is properly initialized;
i.e. false during startup.
Especially, the whole display/viewing stuff and process escheduling
is not working correctly until initialized.
-
reinitStandardStreams
-
reinitialize some well-known streams.
Tis must be done very early during startup, to allow for
debug and trace messages to be output
(otherwise, the file-descriptors are invalid)
message control
-
silentLoading
-
returns the Silentloading class variable, which globally controls if compilation
messages are shown on the transcript during a fileIn.
-
silentLoading: aBoolean
-
allows access to the Silentloading class variable, which controls
messages (especially during fileIn) onto the transcript.
You can save a snapshot with this flag set to true, which makes
the image come up silent. Can also be set, to read in files unlogged.
-
silentlyLoadingDo: aBlock
-
evaluates aBlock with silent loading on - no compilation messages (except errors)
are shown on the transcript
misc accessing
-
beHeadless: aBoolean
-
set/clear the headlessOperation flag.
-
beSTScript: aBoolean
-
set/clear the isSTScript flag.
-
standAloneApp: aBoolean
-
set/clear the StandAlone flag.
misc ui support
-
inspectorClass
( an extension from the stx:libtool package )
-
redefined to use DictionaryInspector
(instead of the default Inspector).
patch support
-
checkClass: classOrClassname forVersion: versionString
-
when installing patches, check that the class named by classOrClassname exists
and that the version is <= versionString.
Raise an exception, if one of the conditions is not met.
Usage example(s):
self checkClass:#Smalltalk forVersion:'200.1'.
self checkClass:#Smalltalk forVersion:'1.1'.
self checkClass:#Bla forVersion:'1.1'.
|
private-system management-packages
-
basicLoadPackage: aPackageString fromDirectory: packageDirOrStringOrNil asAutoloaded: doLoadAsAutoloaded
-
load a package referenced by aPackageString - a string like 'stx:libbasic'.
The package is either located in packageDirOrStringOrNil, or in the current directory (if nil).
Raise an error, if the load fails
-
loadExtensionsForPackage: aPackageId
-
evaluating or here - want all extensions to be loaded
-
loadExtensionsForPackage: aPackageId language: programmingLanguage
-
do not try again
-
loadExtensionsFromDirectory: packageDirOrString
-
evaluating or here - want all extensions to be loaded
-
loadExtensionsFromDirectory: packageDirOrString language: language
-
false
-
loadPackage: aPackageStringArg asAutoloaded: doLoadAsAutoloaded
-
make certain, that some particular package is loaded into the system.
Raises an error if the package is unloadable or not found.
Usage example(s):
so you can load stx packages with loadPackage:'goodies/soap'
|
Usage example(s):
Smalltalk loadPackage:'stx:libbasic'
Smalltalk loadPackage:'stx:goodies/persistency'
Smalltalk loadPackage:'exept:ctypes'
Smalltalk loadPackage:'xxx:ctypes'
|
-
loadPackage: packageId fromAllSourceFilesInDirectory: aDirectory
-
load all source files found in aDirectory and treat them like
a package. Allows for initial import of alien ST-code as a new package.
Experimental.
Raises an error if the package is unloadable or not found.
-
loadPackage: packageId fromClassLibrary: aFilename
-
load a package from a compiled classLib.
Raise an error if not ok (only returns false if the error is proceeded)
Experimental.
-
loadPackage: aPackageString fromDirectory: packageDirOrStringOrNil asAutoloaded: doLoadAsAutoloaded
-
load a package referenced by aPackageString - a string like 'stx:libbasic'.
The package is either located in packageDirOrStringOrNil, or in the current directory (if nil).
Raises an error if the package is unloadable or not found.
Usage example(s):
Smalltalk loadPackage:'stx:goodies/communication'
Smalltalk
loadPackage:'foo:goodies/communication'
fromDirectory:'/tmp'
asAutoloaded:false
|
-
loadPackage: packageId fromLoadAllFile: aFilename
-
load a package from a loadAll - loader script.
Experimental.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
loadPackage: aPackageId fromZIPArchive: f asAutoloaded: doLoadAsAutoloaded
-
load a package from a .zip delivery file.
Experimental.
queries
-
allClasses
-
return an unordered collection of all classes in the system.
Only globally anchored classes are returned
(i.e. anonymous ones have to be acquired by Behavior allSubInstances).
Enumerates non-meta classes only - not metaclasses
Usage example(s):
CachedClasses := nil.
Smalltalk allClasses
to get the list sorted by name:
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name]
|
-
allClassesAndMetaclasses
-
return an unordered collection of all classes with their metaclasses in the system.
-
allClassesWithAllPrivateClasses
-
return an unordered collection of all classes in the Smalltalk namespace.
Only globally anchored classes are returned; Namespaces are not included.
(i.e. anonymous ones have to be acquired by Behavior allSubInstances)
Usage example(s):
Smalltalk allClassesWithAllPrivateClasses
|
-
allClassesWithAllPrivateClassesDo: aBlock
-
enumerate all classes in the Smalltalk namespace.
Only globally anchored classes are returned; Namespaces are not included.
(i.e. anonymous ones have to be acquired by Behavior allSubInstances)
-
allExtensionMethods
-
return a collection of all extension methods
(methods added from another package)
-
allExtensionsForPackage: aProjectID
-
return a collection of all extension methods for a given projectID
-
allImplementorsOf: aSelector
-
return a collection of classes which implement the given selector
Usage example(s):
Smalltalk allImplementorsOf:#isNil
(Smalltalk allImplementorsOf:#add:) size
|
-
allImplementorsOf: aSelector do: aBlock
-
enumerate all classes which implement the given selector
Usage example(s):
Smalltalk allImplementorsOf:#isNil do:[:cls | Transcript showCR:cls]
Smalltalk allImplementorsOf:#add: do:[:cls | Transcript showCR:cls]
|
-
allLoadedPackageIDs
-
Smalltalk allLoadedPackageIDs
-
allLoadedProjectIDs
-
Smalltalk allLoadedProjectIDs
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
allNonExtensionMethods
-
return a collection of all methods thatare not extension methods
(methods added from the classe's package)
-
allPackageIDs
-
Smalltalk allPackageIDs
-
allPackageIdsIncludingUnloadedClasses: includeUnloadedClasses
-
Returns all package ids.
Excludes packages coming from unloaded classes if includeUnloadedClasses is false.
-
allProjectIDs
-
Smalltalk allProjectIDs
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
allProjectsIdsIncludingUnloadedClasses: includeUnloadedClasses
-
Returns all projects ids.
Excludes projects coming from unloaded classes if includeUnloadedClasses is false.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
classCategoryCompletion: aPartialCategory
-
given a partial class category name, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching categories
Usage example(s):
Smalltalk classCategoryCompletion:'Sys'
Smalltalk classCategoryCompletion:'System'
Smalltalk classCategoryCompletion:'System-BinaryStorage'
|
-
classNamed: aStringOrSymbol
-
return the class with name aStringOrSymbol, or nil if absent.
To get to the metaClass, append ' class' to the string.
To get a nameSpace or private class, prefix the name as required.
If a private class of an autoloaded class is referenced, the owning class
will be loaded.
Usage example(s):
Smalltalk classNamed:'Object' => Object
Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData' => BasicAuthenticationData (private in Authentication::BasicAuthenticator)
Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class' => BasicAuthenticationData class (private in Authentication::BasicAuthenticator)
Smalltalk classNamed:'Authentication::BasicAuthenticator'
Smalltalk classNamed:'fooBar' => nil
Smalltalk classNamed:'true' => nil
Smalltalk classNamed:'Object class' => Object class
Smalltalk classNamed:'Metaclass' => Metaclass
Smalltalk classNamed:'Array' => Array
Smalltalk classNamed:'Array class' => Array class
Smalltalk classNamed:#'Array' => Array
|
-
classNames
-
return a collection of all classNames in the system
Usage example(s):
-
classnameCompletion: aPartialClassName
-
given a partial classname, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching names
-
classnameCompletion: aPartialClassName inEnvironment: anEnvironment
-
given a partial classname, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching names
Usage example(s):
Smalltalk classnameCompletion:'Arr'
Smalltalk classnameCompletion:'Arra'
Smalltalk classnameCompletion:'arra'
Smalltalk classnameCompletion:'*rray'
Smalltalk classnameCompletion:'Arr cl'
Smalltalk classnameCompletion:'*rray cl'
|
-
defaultNameSpace
-
return the default namespace, where new classes are installed,
if NO special nameSpace handler is present
-
globalNameCompletion: aPartialGlobalName
-
given a partial globalName, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching names
-
globalnameCompletion: aPartialGlobalName
-
given a partial globalName, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching names
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
hasClassNamed: aString
-
-
hasNameSpaces
-
can be redefined by dummy namespaces/environments, to suppress
the namespace display in a browser (PocketSmalltalk)
-
hasNamespaces
-
can be redefined by dummy namespaces/environments, to suppress
the namespace display in a browser (PocketSmalltalk)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
hasSelectorNameSpaces
-
for now return false
Selector namespaces are being implemented and supported by the VM,
but not yet fully supported by all tools...
Therefore, for now, do not generate code which uses this feature.
-
includes: something
-
this should come from Collection.
will change the inheritance - Smalltalk is actually a collection
-
includesIdentical: something
-
this should come from Collection.
will change the inheritance - Smalltalk is actually a collection
-
isBrowserStartable
-
return true, if this is an application class,
which can be started from the browser
-
isNameSpace
-
return true, if the receiver is a nameSpace.
-
isRealNameSpace
-
return true, if the receiver is a nameSpace, but not Smalltalk (which is also a class).
-
isTopLevelNameSpace
-
-
isTopLevelNamespace
-
obsolete - use isTopLevelNameSpace
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
keyIsClassVariableNameKey: aKey
-
self keyIsClassVariableNameKey:'foo::bar'
self keyIsClassVariableNameKey:'foo:bar'
self keyIsClassVariableNameKey:':bar'
self keyIsClassVariableNameKey:'::bar'
-
loadedClassNamed: aString
-
Same as #classNamed,
but a private class of an autoloaded class will not be found.
Usage example(s):
Smalltalk loadedClassNamed:'Object'
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData'
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class'
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator'
Smalltalk loadedClassNamed:'fooBar'
Smalltalk loadedClassNamed:'true'
Smalltalk loadedClassNamed:'Object class'
Smalltalk loadedClassNamed:'Metaclass'
Smalltalk loadedClassNamed:'Array'
Smalltalk loadedClassNamed:'Array class'
|
-
methodProtocolCompletion: aPartialProtocolName
-
given a partial method protocol name, return an array consisting of
2 entries: 1st: the best (longest) match
2nd: collection consisting of matching protocols
Usage example(s):
Smalltalk methodProtocolCompletion:'doc'
Smalltalk methodProtocolCompletion:'docu'
Smalltalk methodProtocolCompletion:'documenta'
|
-
numberOfGlobals
-
return the number of global variables in the system
Usage example(s):
Smalltalk numberOfGlobals
|
-
referencesAny: aCollection
-
redefined, since the references are only kept in the VM's symbol table
-
referencesDerivedInstanceOf: aClass
-
redefined, since the references are only kept in the VM's symbol table
-
referencesInstanceOf: aClass
-
redefined, since the references are only kept in the VM's symbol table
-
referencesObject: anObject
-
redefined, since the references are only kept in the VM's symbol table
-
resolveName: aName inClass: aClass
-
resolve aName as if compiled within aClass;
i.e. if it has a private class with this name, return it;
if aName is known within the classes namespace, return that.
Otherwise, return a global with that name.
This should be used whereever Smalltalk>>at: used to be used,
to resolve a global by name.
-
selectorCompletion: aPartialSymbolName
-
given a partial selector, return an array consisting of
2 entries: 1st: the longest match
2nd: collection consisting of matching implemented selectors
-
selectorCompletion: aPartialSymbolName inEnvironment: anEnvironment
-
given a partial selector, return an array consisting of
2 entries: 1st: the longest match
2nd: collection consisting of matching implemented selectors
Usage example(s):
Smalltalk selectorCompletion:'at:p'
Smalltalk selectorCompletion:'nextP'
Smalltalk selectorCompletion:'nextp'
|
-
someImplementorOf: aSelector
-
return any class, which implement the given selector. Nil if there is none.
(useful to search, if there is one at all)
Usage example(s):
Smalltalk someImplementorOf:#isNil
Smalltalk someImplementorOf:#add:
|
startup
-
browserWindowStartup
-
invoked, when st/x is started as a plugin in a (currently firefox) browser.
In contrast to squeak (where a single window is used to show the display bitmap),
the browser window is used as a pseudo root-window for a single aplication window.
If required, that app must ensure that multiple apps (if any) are setup as a
multiwindow application.
Actually, control is transferred to PluginSupport, which is suppoesed to know what to do
-
defineCommandLineAsWorkspaceVariablesForScripts
-
enable this, so we can provide _$1.._$n in the script
-
displayInitializationDone
-
inform the restart, that the display has been initialized
-
executeScript: arg
-
this is used to execute a script;
i.e. when stx is started with --script file.st
-
executeStartBlocks
-
-
hideSplashWindow
-
-
lateOpenDisplay
-
this is called when a view is opened without a display being already opened.
-
mainStartup: graphicalMode
-
common start/restart action, if there is a Display, initialize it
and start dispatching; otherwise go into a read-eval-print loop.
-
openDisplay
-
try to open a display connection.
If so, also read display- and keyboard.rc
-
providingDisplayDo: aBlock
-
provide a Display, if needed
-
readEvalPrintLoop
-
say hello, then go into a read-eval-print loop
-
restart
-
startup after an image has been loaded;
This is called by the VM's main entry - you should not find senders from Smalltalk.
there are three change-notifications made to dependents of ObjectMemory,
which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
#earlySystemInstallation is sent for ST80 compatibility
#earlyRestart is send first, nothing has been setup yet.
(should be used to flush all device dependent entries)
#restarted is send right after.
(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)
Usage example(s):
because the Processor may restart processes which use
|
Usage example(s):
reinitialize the Processor - restartable processes
|
Usage example(s):
are now restarted here (but not yet scheduled).
|
Usage example(s):
reinstall Transcript, if not changed during restart.
|
Usage example(s):
reinitialization (restart) of Display is normally performed
|
Usage example(s):
in the restart script. If this has not been run for some reason,
|
Usage example(s):
reinstall Transcript, if not changed during restart.
|
-
showSplashMessage: aString
-
put the message into the splash screen (if there is one).
Use this for messages during startup
-
showSplashMessage: aMessageStringOrNil color: rgbValueOrNil
-
put the message into the splash screen (if there is one).
-
splashInfo: aString
-
like infoPrintCR,
but in addition put the message into the splash screen (if there is one).
Use this for info messages during startup
-
start
-
low level entry from the VM's main.
After initializeSystem, this is the very first real entry into the Smalltalk world.
Analyzes the command line and checks what to do
(i.e. script/repl/eval or full blown IDE).
Also handles --load and various debug options.
Caveat:
this has become too complicated and desperately needs a rewrite.
Also:
Be very careful when changing things here;
especially be careful to ensure that the scripting options are robust against any
missing packages; so the error handlers should not depend on any stream, logger etc. features.
Usage example(s):
Set the BaseDir for the ST/X development system
started in directory: stx/projects/smalltalk'
|
Usage example(s):
read startup and patches file
|
Usage example(s):
Usage example(s):
this will force fileIn of filename only, no standard startup.
|
Usage example(s):
E, P and F this will force evaluation of expr only, no standard startup
|
Usage example(s):
self startSchedulerAndBackgroundCollector.
|
Usage example(s):
('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
|
Usage example(s):
JV@2011-11-01: DO NOT check defaultRC exist - this prevents smalltalk to
to be started with different working directory than stx/projects/smalltalk !!!
|
Usage example(s):
ObjectMemory startBackgroundCollectorAt:5.
|
Usage example(s):
ObjectMemory startBackgroundFinalizationAt:5.
|
-
startSchedulerAndBackgroundCollector
-
-
startStartBlockProcess
-
at the end of the smalltalk initialization, start all actions that
were delayed until the ProcessorScheduler is running in a separate process
startup and exit
-
addExitBlock: aBlock
-
add a block to be executed when Smalltalk finishes.
This feature is currently not used anywhere - but could be useful for
cleanup in stand alone applications.
Better use: ObjectMemory>>#addDependent: and handle the change message
#aboutToQuit.
-
addImageStartBlock: aBlock
-
add a blocks to be executed in a separate process after
everything has been initialized.
These blocks will be executed after an image restart.
-
addStartBlock: aBlock
-
to be called ONLY during very early startup (before the process scheduler
is started) to add a block to be executed in a separate process after
everything has been initialized.
Used to allow a startup script (which is executed BEFORE the scheduler and
UI display is startup up) to add actions which require those subsystems to
be operating.
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
(see smalltalk.rc / private.rc).
ONLY to be called from such an rc file.
-
exit
-
finish the Smalltalk system
Usage example(s):
Be careful evaluating this
Smalltalk exit
|
-
exit: statusInteger
-
finish the Smalltalk system
Usage example(s):
Be careful evaluating this
Smalltalk exit:1
|
-
exitIfStandalone
-
if this is a standalone application, exit.
Otherwise give a warning and abort.
Call this in your code instead of Smalltalk exit,
so the code can be tested in the IDE without danger of shuttong down ST/X
-
exitIfStandalone: statusInteger
-
if this is a standalone application, exit.
Otherwise give a warning and abort.
Call this in your code instead of Smalltalk exit,
so the code can be tested in the IDE without danger of shuttong down ST/X
Usage example(s):
Smalltalk exitIfStandalone:1
|
-
exitOrError: exitCode
-
exit only if running as standalone application.
Raise an error in the development system.
Useful for testing standalone apps which should not kill
your development system.
Usage example(s):
-
exitWithErrorMessage: msg
-
startup queries
-
commandLine
-
return the full command line arguments (with which ST/X was started)
Usage example(s):
-
commandLineArgumentNamed: aString
-
extract a named argument from the command line arguments.
This searches for the given string in the command line and returns the next argument after it.
Usage example(s):
self commandLineArgumentNamed:'-display'
|
-
commandLineArguments
-
return the user command line arguments;
This is a collection of strings (separated command line words),
from which the internal startup arguments have already been removed.
I.e. if started with: 'smalltalk -I -f xxx foo bar baz',
the commandLineArguments will be #('foo' 'bar' 'baz').
In contrast, the value returned by #commandLine will be the full set of words.
-
commandName
-
return the excutables name - this is normally 'stx',
but can be something else for standAlone apps.
Usage example(s):
-
hasNoConsole
-
return true, if this is a console-less application (i.e. I am winstx)
i.e. there should be no writing to stdout/stderr
Usage example(s):
-
ignoreAssertions
-
return true, if assertions are to be ignored (i.e. not executed).
This is false by default in an IDE (i.e. full smalltalk),
but can be set to true for standAlone applications
(whether that is a good idea and helps, is another question)
However, it may make the app a little faster, if assertions are compatational
expensive, as they are skipped (the stc compiler is generatig code which skips those).
-
ignoreAssertions: aBoolean
-
set to true, if assertions are to be ignored (i.e. not executed).
This is false by default in an IDE (i.e. full smalltalk),
but can be set to true for standAlone applications
(whether that is a good idea and helps, is another question)
However, it may make the app a little faster, if assertions are compatational
expensive, as they are skipped (the stc compiler is generatig code which skips those).
-
isDebuggableApp
-
return true, if we want to see a Debugger, MiniDebugger or extended debugging output
in some situations.
I.e. if this is either the ST/X IDE itself, or a standalone app started with --debug
Usage example(s):
Smalltalk isDebuggableApp
|
-
isHeadless
-
return true, if this is a headless application
i.e. no default Display connection is required/used
Usage example(s):
-
isPlugin
-
return true, if this is a plugin application
i.e. running in a browserWindow
Usage example(s):
-
isSTScript
-
return true, if this is stscript. i.e. the stx scripting engine.
Usage example(s):
-
isSharedLibraryComponent
-
return true, if this is a shared library component of another application
i.e. a dll within another app.
Usage example(s):
Smalltalk isSharedLibraryComponent
|
-
isSmalltalkDevelopmentSystem
-
return true, if this is a real smalltalk system
i.e. NOT a stripped or a linked standAlone application (such as the webServer)
and NOT a plugIn (i.e. running in a browser)
and NOT a sharedLibrary component (i.e. a dll in another app).
This is used to determine, whether debugging is possible/desired or not.
Usage example(s):
Smalltalk isSmalltalkDevelopmentSystem
|
-
isStandAloneApp
-
return true, if this is a standAlone application
i.e. a stripped & linked application (such as the webServer)
in contrast to a full smalltalk (development) system.
Usage example(s):
Smalltalk isStandAloneApp
|
-
isStandAloneDebug
-
return true, if this is a standAlone application which
was started with the -debug option.
Usage example(s):
Smalltalk isStandAloneDebug
|
-
startupArguments
-
return the arguments passed to StartupClass when stx gets started.
Usually these are nil,
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
a simple way to configure and create stand-alone applications
Usage example(s):
Smalltalk startupArguments
|
-
startupClass
-
return the class, that will get the start message when smalltalk
starts and its non-nil. Usually this is nil,
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
a simple way to configure and create stand-alone applications
Usage example(s):
-
startupClass: aClass selector: aSymbol arguments: anArrayOrNil
-
set the class, selector and arguments to be performed when smalltalk
starts. Setting those before saving a snapshot, will make the saved
image come up executing your application (instead of the normal mainloop)
-
startupSelector
-
return the selector, that will be sent to StartupClass.
Usually this is nil,
but saving an image with a non-nil StartupClass/StartupSelector allows for
a simple way to configure and create stand-alone applications
Usage example(s):
Smalltalk startupSelector
|
-
wasStartedFromImage
-
return true, if this smalltalk was started from an image,
as opposed to a fresh and clean startup
Usage example(s):
Smalltalk wasStartedFromImage
|
system environment
-
language
-
return the language setting
Usage example(s):
-
language: aLanguageSymbol
-
set the language - send out change notifications
Usage example(s):
-
language: aLanguageSymbol territory: aTerritorySymbol
-
set the language & territory - send out change notifications
Usage example(s):
Smalltalk language:#de territory:#de
Smalltalk language:#de territory:#swg
|
-
languageAndTerritory
-
return the language and territory in the format lang-terr (i.e. de-de, en-us)
Usage example(s):
Smalltalk languageAndTerritory
|
-
languageCodeset
-
-
languageModifier
-
-
languageTerritory
-
return the language territory setting
-
languageTerritory: aTerritorySymbol
-
set the language territory - send out change notifications
Usage example(s):
Time now
Smalltalk languageTerritory:#us.
Time now
Smalltalk languageTerritory:#de.
Time now
|
-
setLanguage: aLanguageSymbol
-
set the language - without change notification
-
setLanguage: aLanguageSymbol territory: aTerritorySymbol
-
set the language & territory - no change notification
-
verifyLanguageTerritory: aTerritorySymbol
-
verify territory - return a possibly fixed symbol
system management
-
compressSources
-
compress the sources file, and remove all method source strings
from the system and replace them by refs to a string in the source file.
This is a bit different in ST/X than in other smalltalks,
since we use per-class sourcefiles for the compiled classes,
and a mix of in-memory strings and one-for-all sourceFile for
incremental compiled methods.
Therefore, only those sources which are not coming from compiled
methods are put into the 'st.src' file - all others are untouched.
This is being automated - so don't care for now.
Usage example(s):
Smalltalk compressSources
|
-
generateSingleSourceFile
-
generate the sources file, and remove all method source strings
from the system and replace them by refs to a string in the source file.
This makes the image independent from the per-class source files
and makes transportation of endUser applications easier, since
only 3 files (executable, image and sourceFile) need to be
transported.
Usage example(s):
Smalltalk generateSingleSourceFile
|
-
installAutoloadedClassFromSourceFile: aFilename
-
install aFilename (which must be a smalltalk source file) as autoloaded class
(extract the class definition chunk from the file and create an autoloaded
class stub for it)
-
installAutoloadedClassNamed: clsName category: cat package: package revision: revisionOrNil
-
create & install an autoload stub for a class named: clsName,
to be loaded from package.
If revisionOrNil is non-nil, set it up to load exactly that revision
(otherwise, the newest revision will be loaded
-
installAutoloadedClassNamed: clsName category: cat package: package revision: revisionOrNil numClassInstVars: numClassInstVarsOrNil
-
create & install an autoload stub for a class named: clsName,
to be loaded from package.
If revisionOrNil is non-nil, set it up to load exactly that revision
(otherwise, the newest revision will be loaded
-
installAutoloadedClasses
-
scan all packages and install all classes found there as
autoloaded. This takes some time ...
Usage example(s):
Smalltalk installAutoloadedClasses
|
-
installAutoloadedClassesFrom: anAbbrevFilePath
-
read the given abbreviation file; install all classes found there as
autoloaded. This takes some time ...
Usage example(s):
Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'
Smalltalk installAutoloadedClassesFrom:'../../goodies/communication/abbrev.stc'
|
-
installAutoloadedClassesFromAbbrevFile: aFilename
-
self installAutoloadedClassesFromAbbrevFile:('../../goodies/communication/abbrev.stc' asFilename)
self installAutoloadedClassesFromAbbrevFile:('../../libtool/abbrev.stc' asFilename)
-
installAutoloadedClassesFromStream: anAbbrevFileStream
-
read the given abbreviation file;
install all classes found there as autoloaded, and also update the
abbreviation (className-to-fileName mapping) table.
This takes some time ...
-
loadBinaries
-
return true, if binaries should be loaded into the system,
false if this should be suppressed. The default is false (for now).
-
loadBinaries: aBoolean
-
turn on/off loading of binary objects
-
logDoits
-
return true if doits should go into the changes file
as well as changes - by default, this is off, since
it can blow up the changes file enormously ...
-
logDoits: aBoolean
-
turn on/off logging of doits in the changes file.
By default, this is off, since it can blow up the
changes file enormously ...
-
makeBytecodeMethods
-
walk over all methods and make each a bytecode method
iff it does not contain primitive C code.
Experimental and not yet used.
Usage example(s):
Smalltalk makeBytecodeMethods
|
-
recursiveInstallAutoloadedClassesFrom: aTopDirectory
-
scan all packages and install all classes found there as
autoloaded. This takes some time ...
Usage example(s):
Smalltalk recursiveInstallAutoloadedClassesFrom:'..\..\..\cg\private\euler'
|
-
recursiveInstallAutoloadedClassesFrom: aTopDirectory maxLevels: maxLevels
-
scan all packages and install all classes found there as
autoloaded. This takes some time ...
Usage example(s):
Smalltalk recursiveInstallAutoloadedClassesFrom:'..\..\..\cg\private\euler'
|
-
recursiveInstallAutoloadedClassesFrom: aDirectory rememberIn: dirsConsulted maxLevels: maxLevels noAutoload: noAutoloadIn packageTop: packageTopPath
-
read all abbrev.stc files from and under aDirectory
and install autoloaded classes.
If a file called NOAUTOLOAD is found, no classes there are installed as autoloaded,
but classes in subdirectories are installed, if the subdirectory contains a file
named AUTOLOAD.
If a file called NOSUBAUTOLOAD is found, no classes there and below are installed as autoloaded.
If a file called NOPACKAGES is found, no further searching is done in that directory or below.
-
recursiveInstallAutoloadedClassesFrom: aDirectory rememberIn: dirsConsulted maxLevels: maxLevels noAutoload: noAutoloadIn packageTop: packageTopPath showSplashInLevels: showSplashInLevels
-
read all abbrev.stc files from and under aDirectory
and install autoloaded classes.
If a file called NOAUTOLOAD is found, no classes there are installed as autoloaded,
but classes in subdirectories are installed, if the subdirectory contains a file
named AUTOLOAD.
If a file called NOSUBAUTOLOAD is found, no classes there and below are installed as autoloaded.
If a file called NOPACKAGES is found, no further searching is done in that directory or below.
-
replaceReferencesTo: anObject with: newRef
-
if the receiver refers to the argument, anObject, replace this reference with newRef.
Return true, if any reference was changed.
Notice: this does not change the class-reference.
-
saveEmergencyImage: aBoolean
-
set/clear the flag which controls if ST/X should save an
emergency image in case of a broken display connection.
The default is true.
This may be useful, if you work with an unsecure display
(serial line), and want to have a chance of proceeding after
a crash. In multiheaded applications, this only affects
crashes of the master Display connection (the initial connection);
errors on other displays are reported to the views and treated
like window destroy from the windowManager.
-
systemOrganization
-
for partial ST80 compatibility;
In ST80, Smalltalk organization returns a systemOrganizer, which
keeps track of class-categories, while all classes return a classOrganizer
from #organization, which keeps track of method categories of that class.
Since in ST/X, Smalltalk is a class, there is now a conflict.
To make a workaround possible, use #systemOrganization when porting
VW apps to ST/X to get the class-categories.
Read the documentation in SystemOrganizer for more info.
system management-fileIn
-
fileIn: aFileNameOrString
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
This method can load almost anything which makes sense:
.st - source files
.cls - binary smalltalk bytecode files
.so - binary compiled machine code class libraries
[.class - java bytecode -- soon to come]
Usage example(s):
Smalltalk fileIn:'source/TicTacToe.st'
Smalltalk fileIn:'binary/TicTacToe.cls'
Smalltalk fileIn:'binary/TicTacToe.so'
Smalltalk fileIn:'foo.st'
|
-
fileIn: aFileName inPackage: aPackageID
-
read in the named file in a packages directory.
-
fileIn: aFileName lazy: lazy
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
If lazy is true, no code is generated for methods, instead stubs
are created which compile themself when first executed. This allows
for much faster fileIn (but slows down the first execution later).
Since no syntax checks are done when doing lazy fileIn, use this only for
code which is known to be syntactically correct.
Usage example(s):
Smalltalk fileIn:'source/TicTacToe.st' lazy:true
|
-
fileIn: aFileName lazy: lazy silent: silent
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
If lazy is true, no code is generated for methods, instead stubs
are created which compile themself when first executed. This allows
for much faster fileIn (but slows down the first execution later).
Since no syntax checks are done when doing lazy fileIn, use this only for
code which is known to be syntactically correct.
If silent is true, no compiler messages are output to the transcript.
Giving nil for silent/lazy will use the current settings.
-
fileIn: aFileNameOrString lazy: lazy silent: silent logged: logged
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
If lazy is true, no code is generated for methods, instead stubs
are created which compile themself when first executed. This allows
for much faster fileIn (but slows down the first execution later).
Since no syntax checks are done when doing lazy fileIn, use this only for
code which is known to be syntactically correct.
If silent is true, no compiler messages are output to the transcript.
Giving nil for silent/lazy will use the current settings.
This method can load almost anything which makes sense:
.st - source files
.cls - binary smalltalk bytecode files
.so - binary compiled machine code class libraries
[.class - java bytecode -- soon to come]
Usage example(s):
Smalltalk fileIn:'clients/TicTacToe/TicTacToe.st' lazy:true silent:true
Smalltalk fileIn:'keyboard.rc'
|
-
fileIn: aFileName logged: logged
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
The argument logged controls, if the changefile is to be updated.
Usage example(s):
Smalltalk fileIn:'source/TicTacToe.st' logged:false
|
-
fileIn: aFileName silent: silent
-
read in the named file - look for it in some standard places;
return true if ok, false if failed.
If silent is true, no compiler messages are output to the transcript.
Usage example(s):
Smalltalk fileIn:'source/TicTacToe.st' silent:true
|
-
fileInChanges
-
read in the last changes file - bringing the system to the state it
had when left the last time.
WARNING: this method is rubbish: it should only read things after the
last '**snapshot**' - entry
(instead of the complete changes file).
Usage example(s):
-
fileInClass: aClassName
-
find a source/object file for aClassName and -if found - load it.
search is in some standard places trying driver-file (.ld), object-file (.o) and
finally source file (.st) in that order.
The file is first searched for using the class name, then the abbreviated name.
-
fileInClass: aClassName fromObject: aFileName
-
read in the named object file and dynamic-link it into the system
- look for it in some standard places.
Only install the named class from this object file.
Return true if ok, false if failed.
Usage example(s):
Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so'
Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so'
|
-
fileInClass: aClassName initialize: doInit
-
find a source/object file for aClassName and -if found - load it.
search is in some standard places trying driver-file (.ld), object-file (.o) and
finally source file (.st) in that order.
The file is first searched for using the class name, then the abbreviated name.
-
fileInClass: aClassName initialize: doInit lazy: loadLazy
-
find a source/object file for aClassName and -if found - load it.
search is in some standard places trying driver-file (.ld), object-file (.o) and
finally source file (.st) in that order.
The file is first searched for using the class name, then the abbreviated name.
-
fileInClass: aClassName initialize: doInit lazy: loadLazy silent: beSilent
-
find a source/object file for aClassName and -if found - load it.
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and
finally source file (.st), in that order.
The file is first searched for using the class name, then the abbreviated name.
The argument doInit controlls if the class should be sent a #initialize after the
load; loadLazy tells if it should be loaded lazily. beSilent tells if the compiler
should not send notes to the transcript; it can be true, false or nil, where
nil uses the value from SilentLoading.
-
fileInClass: aClassName package: package
-
find a source/object file for aClassName and -if found - load it.
search is in some standard places trying driver-file (.ld), object-file (.o) and
finally source file (.st) in that order.
The file is first searched for using the class name, then the abbreviated name.
-
fileInClass: aClassName package: package initialize: doInit lazy: loadLazy silent: beSilent
-
find a source/object file for aClassName and -if found - load it.
This is the workhorse for autoloading.
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and
finally source file (.st), in that order.
The file is first searched for using the class name, then the abbreviated name.
The argument doInit controlls if the class should be sent a #initialize after the
load; loadLazy tells if it should be loaded lazily. beSilent tells if the compiler
should not send notes to the transcript; it can be true, false or nil, where
nil uses the value from SilentLoading.
-
fileInClassLibrary: aClassLibraryName
-
find an object file containing a binary class library in some standard places
and load it. This install all of its contained classes.
Return true if ok, false if not.
Changed to raise an error if not OK (i.e. only returns false if the error is proceeded)
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.
Usage example(s):
Smalltalk fileInClassLibrary:'libtable'
Smalltalk fileInClassLibrary:'binary/libwidg3'
Smalltalk fileInClassLibrary:'foo'
|
-
fileInClassLibrary: aClassLibraryName inPackage: packageID
-
find an object file containing a binary class library in some standard places
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.
Usage example(s):
Smalltalk fileInClassLibrary:'libtable'
Smalltalk fileInClassLibrary:'binary/libwidg3'
Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
|
-
fileInSourceFile: filenameArg lazy: loadLazy silent: beSilent
-
Try all available programming languages for a matching suffix
-
fileInStream: streamArg
-
-
fileInStream: streamArg lazy: lazy silent: silent logged: logged addPath: morePath
-
read sourceCode from aStream;
return true if ok, false if failed.
If lazy is true, no code is generated for methods, instead stubs
are created which compile themself when first executed. This allows
for much faster fileIn (but slows down the first execution later).
Since no syntax checks are done when doing lazy fileIn, use this only for
code which is known to be syntactically correct.
If silent is true, no compiler messages are output to the transcript.
Giving nil for silent/lazy will use the current settings.
If morePath is nonNil, it is prepended to the systemPath temporarily during the
fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more)
using a relative path.
Usage example(s):
Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true
|
-
isClassLibraryLoaded: name
-
return true, if a particular class library is already loaded
Usage example(s):
Smalltalk isClassLibraryLoaded:'libstx_libbasic'
Smalltalk isClassLibraryLoaded:'libstx_libwidg3'
Smalltalk isClassLibraryLoaded:'libstx_libboss'
|
-
loadClassLibraryIfAbsent: name
-
dynamically load a classLibrary, if not already loaded
and the system supports dynamic loading.
Return true, if the library is loaded, false if not.
Changed to raise an error if not ok (i.e. only returns false if the error is proceeded)
This entry is called without system specific filename
extensions - it is portable among different architectures
as long as corresponding files (x.so / x.dll / x.sl / x.o)
are be present ...
Usage example(s):
Smalltalk loadClassLibraryIfAbsent:'libbasic'
Smalltalk loadClassLibraryIfAbsent:'libwidg3'
Smalltalk loadClassLibraryIfAbsent:'foo'
|
-
secureFileIn: aFileName
-
read in the named file, looking for it at standard places.
Catch various errors during fileIn.
Return true if ok, false if failed
-
silentFileIn: aFilename
-
same as fileIn:, but do not output 'compiled...'-messages on Transcript.
Main use is during startup.
system management-files
-
addIdeTopDirectoryToPackagePath
-
one above "stx"
-
addWorkspaceDirectoryToPackagePath
-
-
bitmapFileStreamFor: aFileName
-
search aFileName in some standard places;
return a readonly fileStream or nil if not found.
Searches in subdirectories named 'bitmaps' in the SystemPath.
Notice: this does not look in the package-specific bitmaps directories.
-
bitmapFromFileNamed: aFileName forClass: aClass
-
backward compatibility:
search aFileName in some standard places:
first in the redefinable bitmaps path,
then in the classes own package directory if existing.
Return an image or nil.
Usage example(s):
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View
|
-
bitmapFromFileNamed: aFileName inPackage: aPackage
-
backward compatibility:
search aFileName in some standard places:
first in the redefinable bitmaps path,
then in the package directory if existing.
Return an image or nil.
Usage example(s):
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
|
-
classNameForFile: aFileName
-
return the className which corresponds to an abbreviated fileName,
or nil if no special translation applies. The given filename arg may
include a '.st' suffix (but no other).
Usage example(s):
Smalltalk classNameForFile:'SmallInteger.st'
Smalltalk classNameForFile:'Tools__NewSystemBrowser.st'
Smalltalk classNameForFile:'Tools::NewSystemBrowser.st'
Smalltalk classNameForFile:'DrawObj'
Smalltalk classNameForFile:'DrawObj.st'
Smalltalk classNameForFile:'ArrColl.st'
Smalltalk classNameForFile:'ArrColl.chg'
|
-
constructPathFor: aDirectoryName
-
search for aDirectory in SystemPath;
return a collection of paths which include that directory.
-
fileNameForClass: aClassOrClassName
-
return a actual or expected (or most wanted) filename for aClassOrClassName
- only the base name (without directory part) and without suffix.
Usage example(s):
Smalltalk fileNameForClass:#Complex
Smalltalk fileNameForClass:'SmallInteger'
Smalltalk fileNameForClass:'PCFilename'
Smalltalk fileNameForClass:'UnixOperatingSystem'
Smalltalk fileNameForClass:'Launcher'
Smalltalk fileNameForClass:'SomeUnknownClass'
Smalltalk fileNameForClass:HTML::Encoder
Smalltalk fileNameForClass:OSI::FTAMOperation
Smalltalk fileNameForClass:'OSI::Foobar'
Smalltalk fileNameForClass:(Workflow::UnsuccessfulFinishReasons)
Workflow::UnsuccessfulFinishReasons classFilename
|
-
filenameAbbreviations
-
return a dictionary containing the classname-to-filename
mappings. (needed for sys5.3 users, where filenames are limited
to 14 chars)
Usage example(s):
Smalltalk filenameAbbreviations
|
-
findPackageDirectoryForPackage: aPackage
-
find a packages directory along a number of standard places
Usage example(s):
Smalltalk findPackageDirectoryForPackage:'stx:libview/resources'
Smalltalk findPackageDirectoryForPackage:'stx:libview'
|
-
flushPathCaches
-
forget pathCaches - these are collections containing valid directory names,
where system files (resource, bitmaps etc.) are found.
A flush is only required, if a new system directory has been created while
the system is active, and those files should override the others
(for example, if you created a private resource directory)
Usage example(s):
Smalltalk flushPathCaches
|
-
getBinaryFileName: aFileName
-
obsolete
search aFileName in some standard places
(subdirectories named 'binary' in SystemPath);
return the absolute filename or nil if none is found.
-
getBitmapFileName: aFileName
-
for backward compatibility:
search aFileName in some standard places
(subdirectories named 'bitmaps' in SystemPath);
Return the pathName or nil if none is found.
Usage example(s):
Smalltalk getBitmapFileName:'SBrowser.xbm'
|
-
getBitmapFileName: aFileName forPackage: aPackageIDOrNil
-
for backward compatibility.
search aFileName in some standard places:
first in the redefinable bitmaps path,
then in the package directory if existing.
Return a path or nil.
Search order is:
bitmaps/<pkg>/file
resources/<pkg>/bitmaps/file
<pkg>/bitmaps/file
-
getPackageDirectoryForPackage: aPackageID
-
search for a particular package; return its directory, or nil.
Stand alone applications might get nil, if there are only binaries installed.
Usage example(s):
Smalltalk getPackageDirectoryForPackage:(Array package)
Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps'
Smalltalk getPackageDirectoryForPackage:'stx:libview'
|
-
getPackageFileName: aFileName
-
search aFileName in some standard places
(packagePath and subdirectories named 'packages' in SystemPath);
return the absolute filename as string or nil if none is found.
Usage example(s):
Smalltalk getPackageFileName:'stx/libview/resources/normal.style'
Smalltalk getPackageFileName:'stx/libview/styles/normal.style'
Smalltalk getPackageFileName:'stx/libview/source.zip'
Smalltalk getPackageFileName:'exept/expecco/plugin'
|
-
getPackageSourceFileName: filenameWithoutSuffixArg
-
search aFileName in some standard places and try all available languages
-
getResourceFileName: aFileName
-
search aFileName in some standard places
(subdirectories named 'resources' in SystemPath);
return the absolute filename or nil if none is found.
Obsolete: you must now provide a package argument.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
getResourceFileName: aFileName forClass: aClassOrNil
-
search aFileName in some standard places
(subdirectories named 'resource' in SystemPath);
and in aClasses package directory.
Return the absolute filename or nil if none is found.
Usage example(s):
Smalltalk getResourceFileName:'de.rs' forClass:SystemBrowser
|
-
getResourceFileName: aFileName forPackage: aPackageIDOrNil
-
search aFileName in some standard places
(subdirectories named 'resource' in SystemPath);
and in a packages directory.
Return the absolute filename or nil if none is found.
Search order is:
resources/<pkg>/file
<pkg>/resources/file
Usage example(s):
Smalltalk projectDirectoryForPackage:'stx:libtool'
Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool'
Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'
Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'
Smalltalk getResourceFileName:'styles/mswindowsXP.style' forPackage:'stx:libview'
Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
|
-
getSourceFileName: aFileName
-
search aFileName in some standard places
(subdirectories named 'source' in SystemPath);
return the absolute filename or nil if none is found.
This is used to find a sourceFile for a methods source,
if no sourceCodeManager is available.
Usage example(s):
Smalltalk getSourceFileName:'Smalltalk.st'
Smalltalk getSourceFileName:'stx/libbasic/ArrayedCollection.st'
|
-
getSystemFileName: aFileNameOrString
-
search aFileNameOrString in some standard places;
return the absolute filename or nil if none is found.
see comment in Smalltalk>>initSystemPath.
This should be used to access resources such as bitmaps, doc-files,
and other help files.
Usage example(s):
Smalltalk getSystemFileName:'doc/online/english/TOP.html'
Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm'
Smalltalk getSystemFileName:'bitmaps/foo'
Smalltalk getSystemFileName:'resources/View.rs'
Smalltalk getSystemFileName:'resources/iris.style'
|
-
imageFromFileNamed: aFileName forClass: aClass
-
search aFileName in some standard places:
first in the redefinable bitmaps path, then in the classes
own package directory if existing.
Return an image or nil.
Usage example(s):
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View
|
-
imageFromFileNamed: aFileName inPackage: aPackage
-
search aFileName in some standard places:
first in the redefinable bitmaps path,
then in the package directory if existing.
Return an image or nil.
Search order is:
bitmaps/<pkg>/file
resources/<pkg>/bitmaps/file
<pkg>/bitmaps/file
Usage example(s):
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies'
Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg'
Smalltalk imageFromFileNamed:'ComboDn_xp.xpm' inPackage:'stx:libwidg'
|
-
libraryFileNameOfClass: aClassOrClassName
-
for a given class, return the name of a classLibrary which contains
binary code for it.
Read the libinfo file 'liblist.stc' (which is created during the compilation process)
for an entry for aClassOrClassName.
Search for the className in the first col, and return the value found in
the 2nd col.
Return nil if no entry is found.
A nil returns means that this class is either built-in or not present
in a package-class library (i.e. either as separate .o or separate .st file).
Otherwise, the returned name is the classLibrary object of that class.
The classes code can be loaded from that file if binary loading is supported.
Usage example(s):
Smalltalk libraryFileNameOfClass:'ClockView'
Smalltalk libraryFileNameOfClass:'Bag'
|
-
packagePath
-
return a collection of additional directory names, where smalltalk
looks for package directories.
Notice, that directories named 'packages' under the systemPath are
always consulted - even if not in the packagePath
Usage example(s):
Smalltalk packagePath
Smalltalk packagePath addLast:'/opt/smalltalk'
Smalltalk packagePath addFirst:'/usr/local/otherPackages'
|
-
packagePath: aPath
-
set the packagePath;
a collection of additional directorynames, where smalltalk
looks for package directories.
Notice, that directories named 'packages' under the systemPath are
always consulted - even if not in the packagePath
Usage example(s):
Smalltalk packagePath:#( '.' '/opt/stx' '/opt/smalltalk' '/usr/local/otherPackages')
|
-
projectDirectoryForClass: aClass
-
given a class, return the path to its package directory;
nil if not found.
Usage example(s):
Smalltalk projectDirectoryForClass:Array
Smalltalk projectDirectoryForClass:View
|
-
projectDirectoryForPackage: aPackage
-
given a packageID, return the path to its package directory;
nil if not found.
Usage example(s):
Smalltalk projectDirectoryForPackage:'stx:libbasic'
Smalltalk projectDirectoryForPackage:'exept:smartcard'
Smalltalk projectDirectoryForPackage:'stx'
Smalltalk projectDirectoryForPackage:'bosch'
Smalltalk projectDirectoryForPackage:'bosch:foo'
|
-
readAbbreviations
-
read classname to filename mappings from include/abbrev.stc.
sigh - all for those poor sys5.3 or MSDOS people with short filenames ...
Usage example(s):
Smalltalk readAbbreviations
|
-
readAbbreviationsFromStream: aStream
-
read classname to filename mappings from aStream.
sigh - all for those poor sys5.3 or MSDOS people with short filenames ...
-
realSystemPath
-
return the realSystemPath - that's the directory names from
SystemPath which exist and are readable
-
recursiveReadAllAbbreviationsFrom: aDirectory
-
-
recursiveReadAllAbbreviationsFrom: aDirectory maxLevels: maxLevels
-
read all abbreviations from and under aDirectory.
-
reinitializePackagePath
-
-
relativePackagePathForPackage: aPackage
-
PackageToPathMapping := Dictionary new.
PackageToPathMapping at:'expeccoNET:server' put:'expeccoNET_oldVersion/server'.
PackageToPathMapping at:'expeccoNET:server/ui' put:'expeccoNET_oldVersion/server/ui'.
Smalltalk relativePackagePathForPackage:'stx:libview/resources'
Smalltalk relativePackagePathForPackage:'stx:libview'
-
resourceDirectoryForPackage: aPackage
-
given a packageID, return the path to its resource directory;
nil if not found.
Usage example(s):
Smalltalk resourceDirectoryForPackage:'stx:libbasic'
Smalltalk resourceDirectoryForPackage:'exept:expecco'
Smalltalk resourceDirectoryForPackage:'exept:smartcard'
|
-
resourceFileStreamFor: aFileName
-
search aFileName in some standard places;
return a readonly fileStream or nil if not found.
Searches in subdirectories named 'resource' in SystemPath
-
resourceFileStreamFor: aFileName forClass: aClassOrNil
-
search aFileName in some standard places and in the classes
package-resource directory.
Return a readonly fileStream or nil if not found.
Searches in subdirectories named 'resource' in SystemPath
-
searchPath: aPath for: aFileName in: aDirName
-
search aPath for a subdirectory named aDirName with an readable file
named aFileName.
Answer nil if no readable file could be found.
-
setFilename: aFileNameString forClass: aClassNameString package: aPackageNameString
-
overwrite old abbreviation with new one,
to allow fixing of bad abbrev files
-
sourceDirectoryNameOfClass: aClassOrClassName
-
for a given class, return the pathname relative to TOP of the classes source code.
Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process)
for an entry for aClassOrClassName.
Search for the className in the first col, and return the value found in
the 3rd col.
Return nil if no entry is found.
Usage example(s):
Smalltalk sourceDirectoryNameOfClass:'ClockView'
Smalltalk sourceDirectoryNameOfClass:'Bag'
Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView'
Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass'
|
-
sourceFileStreamFor: aFileName
-
search aFileName in some standard places;
return a readonly fileStream or nil if not found.
Searches in subdirectories named 'source' in SystemPath
-
systemFileStreamFor: aFileName
-
search aFileName in some standard places;
return a readonly fileStream or nil if not found.
see comment in Smalltalk>>initSystemPath
-
systemPath
-
return a collection of directorynames, where smalltalk
looks for system files
(usually in subdirs such as resources, bitmaps, source etc.)
see comment in Smalltalk>>initSystemPath.
Usage example(s):
Smalltalk systemPath
Smalltalk systemPath addLast:'someOtherDirectoryPath'
|
-
systemPath: aPath
-
set the collection of directorynames, where smalltalk
looks for system files
(usually in subdirs such as resources, bitmaps, source etc.)
see comment in Smalltalk>>initSystemPath.
Usage example(s):
Smalltalk systemPath
Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath')
|
-
withAbbreviationsFromStream: aStream do: aBlock
-
read classname to filename mappings from aStream.
Evaluate aBlock for each tuple:
class-name , abbrev-name, package
Sigh - all for those poor sys5.3 or MSDOS people with short filenames...
system management-packages
-
isPackageLoaded: aPackageIdOrPackage
-
Smalltalk isPackageLoaded:'stx:goodies/persistency'
Smalltalk isPackageLoaded:'stx:goodies/refactoryBrowser/lint'
Smalltalk isPackageLoaded:'stx:goodies/refactoryBrowser/lint/spelling'
-
knownLoadablePackagesDo: aBlock
-
enumerate loadable packages from the packages folder.
Usage example(s):
Smalltalk knownLoadablePackagesDo:[:packageID :type :path |
Transcript showCR:'%1 (%2) in %3' with:packageID with:type with:path.
]
|
-
loadPackage: aPackageIdOrPackage
-
make certain, that some particular package is loaded into the system.
Raises and error if the package is unloadable or not found.
Usage example(s):
Smalltalk loadPackage:'stx:libbasic'
Smalltalk loadPackage:'stx:goodies/persistency'
Smalltalk loadPackage:'cg:cparser'
Smalltalk loadPackage:'cg:cparser' asAutoloaded:true
Smalltalk loadPackage:'cg:rose' asAutoloaded:true
Smalltalk loadPackage:'foo:bar'
|
-
makeLib: aPackageIdOrPackage
-
make certain, that some particular library is uptodate and compiled
Usage example(s):
Smalltalk makeLib:'cg:electronics/tests'
Smalltalk loadPackage:'cg:electronics/tests'
|
-
makePackage: aPackageIdOrPackage
-
make certain, that some particular package is uptodate and compiled
Usage example(s):
Smalltalk makePackage:'cg:electronics'
Smalltalk loadPackage:'cg:electronics'
|
-
makePackage: aPackageIdOrPackage libOnly: libOnly
-
make certain, that some particular package is uptodate and compiled
Usage example(s):
Smalltalk makePackage:'cg:electronics'
Smalltalk loadPackage:'cg:electronics'
|
-
packageDirectoryForPackageId: aPackageId
-
used by classes to find the location of their resource- and bitmap directories.
Notice that the directory structure is different between the development
environment (top for packages is ../../../stx) and delivered stand alone executables,
where the top is specified via a shell environment variable, and is typically ../lib.
At runtime, Smalltalk knows about the systemPath setting.
Usage example(s):
Smalltalk packageDirectoryForPackageId:'stx:libbasic'
Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency'
Smalltalk packageDirectoryForPackageId:'exept:ctypes'
Smalltalk getPackageFileName:'stx/libview'
|
-
require: className fromPackage: aPackageIdOrPackage
-
make certain, that some particular package is loaded into the system,
and that a class named className is present.
Returns the class, or raises an error, if the load fails.
Usage example(s):
Smalltalk require:#Array fromPackage:'stx:libbasic'
|
-
requirePackage: aPackageIdOrPackage
-
make certain, that some particular package is loaded into the system.
Raises a proceedable PackageNotFoundError error, if the load fails
Returns the package-definition class or nil (if exception was proceeded).
Usage example(s):
Smalltalk requirePackage:'foobar'
Smalltalk requirePackage:'stx:libbasic'
Smalltalk requirePackage:'stx:goodies/bla'
Smalltalk requirePackage:'stx:goodies/regression'
Smalltalk requirePackage:'exept:ctypes'
Smalltalk requirePackage:'cg:rose'
Smalltalk requirePackage:'stx:foobar'
|
-
requirePackage: aPackageIdOrPackage onError: exceptionValue
-
make certain, that some particular package is loaded into the system.
Returns the value from exceptionValue, if the load fails,
otherwise returns the package-definition class or nil (if exception was proceeded).
Usage example(s):
Smalltalk requirePackage:'foobar'
Smalltalk requirePackage:'foobar' onError:[]
Smalltalk requirePackage:'foobar'
Smalltalk requirePackage:'foobar' onError:[nil]
Smalltalk requirePackage:'stx:foobar'
Smalltalk requirePackage:'stx:foobar' onError:['ouch']
|
-
unloadPackage: aPackageIdOrPackage
-
Smalltalk loadPackage:'stx:goodies/persistency'
Smalltalk unloadPackage:'stx:goodies/persistency'
system management-undeclared variables
-
clearUndeclaredVariables
-
remove all undeclared variables
-
undeclaredPrefix
-
the prefix used for undeclared variables
testing-system
-
isAmber
-
is this an Amber Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isAmber to your Amber Smalltalk,
returning true there.
-
isDolphinSmalltalk
-
is this a Dolphin Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isDolphinSmalltalk to your dolphin,
returning true there.
-
isGemStone
-
is this a GemStone Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isGemStone to your GemStone/S,
returning true there.
-
isPharo
-
is this a Pharo Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isPharo to your Pharo,
returning true there.
-
isSmalltalkMT
-
is this a Smalltalk-MT system ?
Return false here - this may be useful to write portable
applications - add #isSmalltalkMT to your smalltalk-MT,
returning true there.
-
isSmalltalkV
-
is this a Smalltalk/V system ?
Return false here - this may be useful to write portable
applications - add #isSmalltalkV to your smalltalkV,
returning true there.
-
isSmalltalkX
-
is this a Smalltalk/X system ?
Return true here - this may be useful to write portable
applications.
Add #isSmalltalkX to your other smalltalks, returning false there.
Notice: the ST/X compilers know about this, and inline the code
(not generating code for the false branch).
So in ST/X, this check costs you absolutely nothing.
-
isSqueak
-
is this a SqueakSmalltalk system ?
Return false here - this may be useful to write portable
applications - add #isSqueak to your squeak,
returning true there.
-
isSqueakLike
-
is this a Squeak, Pharo, Cuis or similar Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isSqueakLike to your squeak, pharo,...
returning true there.
-
isVisualAge
-
is this a VisualAge Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isVisualAge to your visualAge,
returning true there.
-
isVisualSmalltalkEnterprise
-
is this a VSE Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isVisualSmallalkEnterprise to your VSE,
returning true there.
-
isVisualWorks
-
is this a VisualWorks Smalltalk system ?
Return false here - this may be useful to write portable
applications - add #isVisualWorks to your visualWorks,
returning true there.
time-versions
-
configuration
-
for developers only: return the configuration, with which
this smalltalk was compiled.
Usage example(s):
for developers only: return the configuration, with which
this smalltalk was compiled.
|
Usage example(s):
-
copyrightString
-
return a copyright string
Usage example(s):
Smalltalk copyrightString
|
-
distributorString
-
return a string describing the distributor of this software
Usage example(s):
Smalltalk distributorString
|
-
expirationTime
-
for developers only: return the time when the system will expire.
after this time it will not run any longer.
It returns nil, if no expiration time has been set (system runs forever :-))
Usage example(s):
-
fullVersionString
-
return a full version string
Usage example(s):
Smalltalk fullVersionString
|
-
hello
-
return a greeting string
Usage example(s):
Smalltalk language:#us.
Smalltalk hello
Smalltalk language:#de.
Smalltalk hello
Smalltalk language:#no.
Smalltalk hello
Transcript showCR:(Smalltalk hello)
Stdout showCR:(Smalltalk hello)
|
-
imageRestartTime
-
return a timestamp for the moment when this image was restarted.
If we do not execute from an image (i.e. fresh start), return nil.
Usage example(s):
Smalltalk imageStartTime
Smalltalk imageRestartTime
|
-
imageSaveTime
-
return a timestamp for the moment when this image was saved
-
imageStartTime
-
return a timestamp for the moment when this system started the first time
(i.e. the first initial start without an image)
Usage example(s):
Smalltalk imageStartTime
Smalltalk imageRestartTime
|
-
majorVersionNr
-
return the major version number.
This is only incremented for very fundamental changes,
which make old object files totally incompatible
(for example, if the layout/representation of fundamental
classes changes).
ST/X revision Naming is:
<major>.<minor>.<revision>.<release>
Usage example(s):
-
minorVersionNr
-
return the minor version number.
This is incremented for changes which make some old object
files incompatible, or the protocol changes such that some
classes need rework.
ST/X revision Naming is:
<major>.<minor>.<revision>.<release>
Usage example(s):
-
releaseIdentification
-
for developers only: return the release
(to further identify the version in case of errors)
Usage example(s):
Smalltalk releaseIdentification
|
-
releaseNr
-
return the release number.
Now releaseNr is the build number (BUILD_NUMBER from Jenkins)
ST/X revision Naming is:
<major>.<minor>.<revision>.<release>
Usage example(s):
return the release number.
Now releaseNr is the build number (BUILD_NUMBER from Jenkins)
ST/X revision Naming is:
...
|
Usage example(s):
Smalltalk releaseNr
Smalltalk versionString
|
-
revisionNr
-
return the revision number.
Incremented for releases which fix bugs/add features
and represent a stable workable version which got published
to the outside world.
ST/X revision Naming is:
<major>.<minor>.<revision>.<release>
Usage example(s):
Smalltalk revisionNr
Smalltalk hello string
|
-
timeStamp
-
return a string useful for timestamping a file.
The returned string is padded with spaces for a constant
length (to avoid changing a files size in fileOut with unchanged
class).
-
timeStamp: aStream
-
write a string useful for timestamping a file onto aStream.
ST80 compatibility
-
timeStampString
-
return a string useful for timestamping a file.
-
version3String
-
return the version string, but only 3parts major.minor.revision
This is needed for OSX, where the linker only supports this particular format
Usage example(s):
-
versionBuildNumber
-
return the executable's build number - that's the jenkins build #.
0 if not built by jenkins
Usage example(s):
Smalltalk versionBuildNumber
|
-
versionBuildNumberString
-
return the executable's build number - that's the jenkins build #.
Empty if not built by jenkins
Usage example(s):
Smalltalk versionBuildNumberString
|
-
versionDate
-
return the executable's build date - that's the date when the smalltalk
executable was compiled
Usage example(s):
-
versionString
-
return the version string, 4 parts major.minor.revision,buildNr
Usage example(s):
-
vmMajorVersionNr
-
return the VMs major version number.
Usage example(s):
Smalltalk vmMajorVersionNr
|
|