gnu smalltalk library reference · store smalltalk code compiling to the receiver on astream 1.5.5...
TRANSCRIPT
gnu Smalltalk Library ReferenceVersion 3.2.5
24 November 2017
by Paolo Bonzini
Permission is granted to copy, distribute and/or modify this document underthe terms of the GNU Free Documentation License, Version 1.2 or any laterversion published by the Free Software Foundation; with no Invariant Sections,with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the licenseis included in the section entitled “GNU Free Documentation License”.
1
3
1 Base classes
1.1 Tree
Classes documented in this manual are boldfaced.
AutoloadObjectBehaviorClassDescriptionClassMetaclass
BlockClosureBooleanFalseTrue
CObjectCAggregateCArrayCPtrCString
CCallableCCallbackDescriptorCFunctionDescriptor
CCompoundCStructCUnion
CScalarCCharCDoubleCFloatCIntCLongCLongDoubleCLongLongCShortCSmalltalkCUCharCByteCBoolean
CUIntCULongCULongLongCUShort
ContextPart
4 GNU Smalltalk Library Reference
BlockContextMethodContext
ContinuationCTypeCPtrCTypeCArrayCType
CScalarCTypeCStringCType
DelayDirectoryDLDDumperProxyAlternativeObjectProxyNullProxyVersionableObjectProxy
PluggableProxySingletonProxy
DynamicVariableExceptionErrorArithmeticErrorZeroDivide
MessageNotUnderstoodSystemExceptions.InvalidValueSystemExceptions.EmptyCollectionSystemExceptions.InvalidArgumentSystemExceptions.AlreadyDefinedSystemExceptions.ArgumentOutOfRangeSystemExceptions.IndexOutOfRange
SystemExceptions.InvalidSizeSystemExceptions.NotFoundSystemExceptions.PackageNotAvailable
SystemExceptions.InvalidProcessStateSystemExceptions.InvalidStateSystemExceptions.NotIndexableSystemExceptions.ProcessTerminatedSystemExceptions.ReadOnlyObjectSystemExceptions.WrongClassSystemExceptions.MustBeBoolean
SystemExceptions.MutationErrorSystemExceptions.NotEnoughElementsSystemExceptions.NotImplementedSystemExceptions.NotYetImplementedSystemExceptions.ShouldNotImplementSystemExceptions.SubclassResponsibilitySystemExceptions.WrongMessageSent
SystemExceptions.VMError
Chapter 1: Base classes 5
SystemExceptions.BadReturnSystemExceptions.NoRunnableProcessSystemExceptions.PrimitiveFailedSystemExceptions.CInterfaceErrorSystemExceptions.FileErrorSystemExceptions.WrongArgumentCount
SystemExceptions.SecurityErrorSystemExceptions.UserInterruptSystemExceptions.VerificationError
HaltNotificationSystemExceptions.EndOfStreamSystemExceptions.ProcessBeingTerminatedWarning
SystemExceptions.UnhandledExceptionExceptionSetFilePathFileVFS.ArchiveMemberVFS.TmpFileArchiveMemberVFS.StoredZipMember
VFS.FileWrapperVFS.ArchiveFileVFS.ZipFile
FileSegmentGetoptIterableCollectionBagHashedCollectionDictionaryBindingDictionaryAbstractNamespaceNamespaceRootNamespaceSystemDictionary
LookupTableIdentityDictionaryMethodDictionary
WeakValueLookupTableWeakValueIdentityDictionary
WeakKeyDictionaryWeakKeyIdentityDictionary
SetIdentitySetWeakSetWeakIdentitySet
6 GNU Smalltalk Library Reference
MappedCollectionSequenceableCollectionArrayedCollectionArrayWeakArray
ByteArrayCharacterArrayStringSymbol
UnicodeStringCompiledCodeCompiledBlockCompiledMethod
IntervalLargeArrayedCollectionLargeArrayLargeByteArrayLargeWordArray
WordArrayLinkedListSemaphore
OrderedCollectionRunArraySortedCollection
StreamFileDescriptorFileStream
GeneratorObjectDumperPositionableStreamReadStreamWriteStreamReadWriteStream
RandomTextCollector
Kernel.PackageInfoPackage
LinkProcessCallinProcess
SymLinkMagnitudeCharacterUnicodeCharacter
DateDateTime
LookupKey
Chapter 1: Base classes 7
AssociationHomedAssociationVariableBinding
DeferredVariableBindingProcessVariable
NumberFloatFloatDFloatEFloatQ
FractionIntegerLargeIntegerLargeNegativeIntegerLargePositiveIntegerLargeZeroInteger
SmallIntegerScaledDecimal
TimeDuration
MemoryMessageDirectedMessage
MethodInfoNetClients.URIResolverNetClients.URLObjectMemoryPackageLoaderPermissionPointProcessEnvironmentProcessorSchedulerRectangleRecursionLockRegexRegexResultsSecurityPolicySharedQueueUndefinedObjectValueAdaptorNullValueHolderPluggableAdaptorDelayedAdaptor
ValueHolderPromise
8 GNU Smalltalk Library Reference
1.2 AbstractNamespace
Defined in namespace SmalltalkSuperclass: BindingDictionaryCategory: Language-Implementation
I am a special form of dictionary. Classes hold on an instance of me; it is calledtheir ‘environment’.
1.2.1 AbstractNamespace class: instance creation
new Disabled - use #new to create instances
primNew: parent name: spaceNamePrivate - Create a new namespace with the given name and parent, and add tothe parent a key that references it.
1.2.2 AbstractNamespace: accessing
allAssociationsAnswer a Dictionary with all of the associations in the receiver and each of itssuperspaces (duplicate keys are associated to the associations that are deeperin the namespace hierarchy)
allBehaviorsDo: aBlockEvaluate aBlock once for each class and metaclass in the namespace.
allClassObjectsDo: aBlockEvaluate aBlock once for each class and metaclass in the namespace.
allClassesDo: aBlockEvaluate aBlock once for each class in the namespace.
allMetaclassesDo: aBlockEvaluate aBlock once for each metaclass in the namespace.
classAt: aKeyAnswer the value corrisponding to aKey if it is a class. Fail if either aKey isnot found or it is associated to something different from a class.
classAt: aKey ifAbsent: aBlockAnswer the value corrisponding to aKey if it is a class. Evaluate aBlock andanswer its result if either aKey is not found or it is associated to somethingdifferent from a class.
1.2.3 AbstractNamespace: compiling
addSharedPool: aDictionaryImport the given bindings for classes compiled with me as environment.
import: aDictionaryImport the given bindings for classes compiled with me as environment.
removeSharedPool: aDictionaryRemove aDictionary from my list of direct pools.
Chapter 1: Base classes 9
sharedPoolDictionariesAnswer the shared pools (not names) imported for my classes.
1.2.4 AbstractNamespace: copying
copyEmpty: newSizeAnswer an empty copy of the receiver whose size is newSize
whileCurrentDo: aBlockEvaluate aBlock with the current namespace set to the receiver. Answer theresult of the evaluation.
1.2.5 AbstractNamespace: namespace hierarchy
addSubspace: aSymbolCreate a namespace named aSymbol, add it to the receiver’s subspaces, andanswer it.
allSubassociationsDo: aBlockInvokes aBlock once for every association in each of the receiver’s subspaces.
allSubspacesAnswer the direct and indirect subspaces of the receiver in a Set
allSubspacesDo: aBlockInvokes aBlock for all subspaces, both direct and indirect.
allSuperspacesDo: aBlockEvaluate aBlock once for each of the receiver’s superspaces
includesClassNamed: aStringAnswer whether the receiver or any of its superspaces include the given class –note that this method (unlike #includesKey:) does not require aString to beinterned and (unlike #includesGlobalNamed:) only returns true if the global isa class object.
includesGlobalNamed: aStringAnswer whether the receiver or any of its superspaces include the given key –note that this method (unlike #includesKey:) does not require aString to beinterned but (unlike #includesClassNamed:) returns true even if the global isnot a class object.
removeSubspace: aSymbolRemove my subspace named aSymbol from the hierarchy.
selectSubspaces: aBlockReturn a Set of subspaces of the receiver satisfying aBlock.
selectSuperspaces: aBlockReturn a Set of superspaces of the receiver satisfying aBlock.
siblings Answer all the other children of the same namespace as the receiver.
siblingsDo: aBlockEvaluate aBlock once for each of the other root namespaces, passing the names-pace as a parameter.
10 GNU Smalltalk Library Reference
subspaces Answer the receiver’s direct subspaces
subspacesDo: aBlockInvokes aBlock for all direct subspaces.
superspaceAnswer the receiver’s superspace.
superspace: aNamespaceSet the superspace of the receiver to be ’aNamespace’. Also adds the receiveras a subspace of it.
withAllSubspacesAnswer a Set containing the receiver together with its direct and indirect sub-spaces
withAllSubspacesDo: aBlockInvokes aBlock for the receiver and all subclasses, both direct and indirect.
1.2.6 AbstractNamespace: overrides for superspaces
inheritedKeysAnswer a Set of all the keys in the receiver and its superspaces
set: key to: newValueAssign newValue to the variable named as specified by ‘key’. This methodwon’t define a new variable; instead if the key is not found it will search insuperspaces and raising an error if the variable cannot be found in any of thesuperspaces. Answer newValue.
set: key to: newValue ifAbsent: aBlockAssign newValue to the variable named as specified by ‘key’. This methodwon’t define a new variable; instead if the key is not found it will search insuperspaces and evaluate aBlock if it is not found. Answer newValue.
values Answer a Bag containing the values of the receiver
1.2.7 AbstractNamespace: printing
name Answer the receiver’s name
name: aSymbolChange the receiver’s name to aSymbol
nameIn: aNamespaceAnswer Smalltalk code compiling to the receiver when the current namespaceis aNamespace
printOn: aStreamPrint a representation of the receiver
storeOn: aStreamStore Smalltalk code compiling to the receiver
Chapter 1: Base classes 11
1.2.8 AbstractNamespace: testing
isNamespaceAnswer ‘true’.
isSmalltalkAnswer ‘false’.
1.3 AlternativeObjectProxy
Defined in namespace SmalltalkSuperclass: DumperProxyCategory: Streams-Files
I am a proxy that uses the same ObjectDumper to store an object which isnot the object to be dumped, but from which the dumped object can be re-constructed. I am an abstract class, using me would result in infinite loopsbecause by default I try to store the same object again and again. See themethod comments for more information
1.3.1 AlternativeObjectProxy class: instance creation
acceptUsageForClass: aClassThe receiver was asked to be used as a proxy for the class aClass. Answerwhether the registration is fine. By default, answer true except if Alterna-tiveObjectProxy itself is being used.
on: anObjectAnswer a proxy to be used to save anObject. IMPORTANT: this methodMUST be overridden so that the overridden version sends #on: to super passingan object that is NOT the same as anObject (alternatively, you can override#dumpTo:, which is what NullProxy does), because that would result in aninfinite loop! This also means that AlternativeObjectProxy must never be useddirectly – only as a superclass.
1.3.2 AlternativeObjectProxy: accessing
object Reconstruct the object stored in the proxy and answer it. A subclass willusually override this
object: theObjectSet the object to be dumped to theObject. This should not be overridden.
primObjectReconstruct the object stored in the proxy and answer it. This method mustnot be overridden
12 GNU Smalltalk Library Reference
1.4 ArithmeticError
Defined in namespace SmalltalkSuperclass: ErrorCategory: Language-Exceptions
An ArithmeticError exception is raised by numeric classes when a programtries to do something wrong, such as extracting the square root of a negativenumber.
1.4.1 ArithmeticError: description
descriptionAnswer a textual description of the exception.
isResumableAnswer true. Arithmetic exceptions are by default resumable.
1.5 Array
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable
My instances are objects that have array-like properties: they are directly in-dexable by integers starting at 1, and they are fixed in size. I inherit objectcreation behavior messages such as #with:, as well as iteration and generalaccess behavior from SequenceableCollection.
1.5.1 Array class: instance creation
from: anArrayAnswer anArray, which is expected to be an array specified with a brace-syntaxexpression per my inherited protocol.
1.5.2 Array: built ins
at: anIndex ifAbsent: aBlockAnswer the index-th indexed instance variable of the receiver
replaceFrom: start to: stop with: byteArray startingAt: replaceStartReplace the characters from start to stop with new characters whose ASCIIcodes are contained in byteArray, starting at the replaceStart location ofbyteArray
1.5.3 Array: mutating objects
multiBecome: anArrayTransform every object in the receiver in each corresponding object in anArray.anArray and the receiver must have the same size
1.5.4 Array: printing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
Chapter 1: Base classes 13
printOn: aStreamPrint a representation for the receiver on aStream
storeLiteralOn: aStreamStore a Smalltalk literal compiling to the receiver on aStream
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.5.5 Array: testing
isArray Answer ‘true’.
1.6 ArrayedCollection
Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable
My instances are objects that are generally fixed size, and are accessed by aninteger index. The ordering of my instance’s elements is determined externally;I will not rearrange the order of the elements.
1.6.1 ArrayedCollection class: instance creation
join: aCollectionWhere aCollection is a collection of SequenceableCollections, answer a newinstance with all the elements therein, in order.
join: aCollection separatedBy: sepCollectionWhere aCollection is a collection of SequenceableCollections, answer a newinstance with all the elements therein, in order, each separated by an occurrenceof sepCollection.
new: size withAll: anObjectAnswer a collection with the given size, whose elements are all set to anObject
streamContents: aBlockCreate a ReadWriteStream on an empty instance of the receiver; pass the streamto aBlock, then retrieve its contents and answer them.
with: element1Answer a collection whose only element is element1
with: element1 with: element2Answer a collection whose only elements are the parameters in the order theywere passed
with: element1 with: element2 with: element3Answer a collection whose only elements are the parameters in the order theywere passed
with: element1 with: element2 with: element3 with: element4Answer a collection whose only elements are the parameters in the order theywere passed
14 GNU Smalltalk Library Reference
with: element1 with: element2 with: element3 with: element4 with: element5Answer a collection whose only elements are the parameters in the order theywere passed
withAll: aCollectionAnswer a collection whose elements are the same as those in aCollection
1.6.2 ArrayedCollection: basic
, aSequenceableCollectionAnswer a new instance of an ArrayedCollection containing all the elements inthe receiver, followed by all the elements in aSequenceableCollection
add: value This method should not be called for instances of this class.
atAll: keyCollectionAnswer a collection of the same kind returned by #collect:, that only includesthe values at the given indices. Fail if any of the values in keyCollection is outof bounds for the receiver.
copyFrom: start to: stopAnswer a new collection containing all the items in the receiver from the start-thand to the stop-th
copyWith: anElementAnswer a new instance of an ArrayedCollection containing all the elements inthe receiver, followed by the single item anElement
copyWithout: oldElementAnswer a copy of the receiver to which all occurrences of oldElement are re-moved
1.6.3 ArrayedCollection: built ins
size Answer the size of the receiver
1.6.4 ArrayedCollection: compiler
literalEquals: anObjectNot commented.
literalHashNot commented.
1.6.5 ArrayedCollection: copying Collections
copyReplaceAll: oldSubCollection with: newSubCollectionAnswer a new collection in which all the sequences matching oldSubCollectionare replaced with newSubCollection
copyReplaceFrom: start to: stop with: replacementCollectionAnswer a new collection of the same class as the receiver that contains thesame elements as the receiver, in the same order, except for elements fromindex ‘start’ to index ‘stop’.
Chapter 1: Base classes 15
If start < stop, these are replaced by the contents of the replacementCollection.Instead, If start = (stop + 1), like in ‘copyReplaceFrom: 4 to: 3 with: anArray’,then every element of the receiver will be present in the answered copy; theoperation will be an append if stop is equal to the size of the receiver or, if itis not, an insert before index ‘start’.
copyReplaceFrom: start to: stop withObject: anObjectAnswer a new collection of the same class as the receiver that contains thesame elements as the receiver, in the same order, except for elements fromindex ‘start’ to index ‘stop’.
If start < stop, these are replaced by stop-start+1 copies of anObject. Instead,If start = (stop + 1), then every element of the receiver will be present in theanswered copy; the operation will be an append if stop is equal to the size ofthe receiver or, if it is not, an insert before index ‘start’.
reverse Answer the receivers’ contents in reverse order
1.6.6 ArrayedCollection: enumerating the elements of a collection
collect: aBlockAnswer a new instance of an ArrayedCollection containing all the results ofevaluating aBlock passing each of the receiver’s elements
reject: aBlockAnswer a new instance of an ArrayedCollection containing all the elements inthe receiver which, when passed to aBlock, answer false
select: aBlockAnswer a new instance of an ArrayedCollection containing all the elements inthe receiver which, when passed to aBlock, answer true
with: aSequenceableCollection collect: aBlockEvaluate aBlock for each pair of elements took respectively from the receiverand from aSequenceableCollection; answer a collection of the same kind of thereceiver, made with the block’s return values. Fail if the receiver has not thesame size as aSequenceableCollection.
1.6.7 ArrayedCollection: sorting
sorted Return a copy of the receiver sorted according to the default sort block, whichuses #<= to compare items.
sorted: sortBlockReturn a copy of the receiver sorted according to the given sort block, whichaccepts pair of items and returns true if the first item is less than the secondone.
1.6.8 ArrayedCollection: storing
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
16 GNU Smalltalk Library Reference
1.6.9 ArrayedCollection: streams
writeStreamAnswer a WriteStream streaming on the receiver
1.7 Association
Defined in namespace SmalltalkSuperclass: LookupKeyCategory: Language-Data types
My instances represent a mapping between two objects. Typically, my "key"object is a symbol, but I don’t require this. My "value" object has no conven-tions associated with it; it can be any object at all.
1.7.1 Association class: basic
key: aKey value: aValueAnswer a new association with the given key and value
1.7.2 Association: accessing
environmentAnswer nil. This is present to achieve polymorphism with instances of Vari-ableBinding.
environment: aNamespaceDo nothing. This is present to achieve polymorphism with instances of Vari-ableBinding.
key: aKey value: aValueSet the association’s key to aKey, and its value to aValue
value Answer the association’s value
value: aValueSet the association’s value to aValue
1.7.3 Association: finalization
mourn Finalize the receiver
1.7.4 Association: printing
printOn: aStreamPut on aStream a representation of the receiver
1.7.5 Association: storing
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
Chapter 1: Base classes 17
1.7.6 Association: testing
= anAssociationAnswer whether the association’s key and value are the same as anAssociation’s,or false if anAssociation is not an Association. As a special case, identical valuesare considered equal even if #= returns false (as is the case for NaN floating-point values).
hash Answer an hash value for the receiver
1.8 Autoload
Defined in namespace SmalltalkSuperclass: noneCategory: Examples-Useful tools
I am not a part of the normal Smalltalk kernel class system. I provide theability to do late ("on-demand") loading of class definitions. Through me, youcan define any class to be loaded when any message is sent to the class itself(such as to create an instance) or to its metaclass (such as #methodsFor: toextend it with class-side methods).
1.8.1 Autoload class: instance creation
class: nameSymbol from: fileNameStringMake Smalltalk automatically load the class named nameSymbol from file-NameString when needed
class: nameSymbol in: aNamespace from: fileNameStringMake Smalltalk automatically load the class named nameSymbol and residingin aNamespace from fileNameString when needed
class: nameSymbol in: aNamespace loader: anObjectMake Smalltalk automatically load the class named nameSymbol and residingin aNamespace. When the class is needed, anObject will be sent #autoload.By default, instances of FilePath and Package can be used.
class: nameSymbol loader: anObjectMake Smalltalk automatically load the class named nameSymbol. When theclass is needed, anObject will be sent #autoload. By default, instances ofFilePath and Package can be used.
1.8.2 Autoload: accessing
class We need it to access the metaclass instance, because that’s what will load thefile.
doesNotUnderstand: aMessageLoad the class and resend the message to it
18 GNU Smalltalk Library Reference
1.9 Bag
Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Unordered
My instances are unordered collections of objects. You can think of me as aset with a memory; that is, if the same object is added to me twice, then I willreport that that element has been stored twice.
1.9.1 Bag class: basic
new Answer a new instance of the receiver
new: size Answer a new instance of the receiver, with space for size distinct objects
1.9.2 Bag: adding
add: newObjectAdd an occurrence of newObject to the receiver. Answer newObject. Fail ifnewObject is nil.
add: newObject withOccurrences: anIntegerIf anInteger > 0, add anInteger occurrences of newObject to the receiver. IfanInteger < 0, remove them. Answer newObject. Fail if newObject is nil.
1.9.3 Bag: enumerating the elements of a collection
asSet Answer a set with the elements of the receiver
do: aBlockEvaluate the block for all members in the collection.
1.9.4 Bag: extracting items
sortedByCountAnswer a collection of counts with elements, sorted by decreasing count.
1.9.5 Bag: printing
printOn: aStreamPut on aStream a representation of the receiver
1.9.6 Bag: removing
remove: oldObject ifAbsent: anExceptionBlockRemove oldObject from the collection and return it. If can’t be found, answerinstead the result of evaluationg anExceptionBlock
1.9.7 Bag: storing
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
Chapter 1: Base classes 19
1.9.8 Bag: testing collections
= aBag Answer whether the receiver and aBag contain the same objects
hash Answer an hash value for the receiver
includes: anObjectAnswer whether we include anObject
occurrencesOf: anObjectAnswer the number of occurrences of anObject found in the receiver
size Answer the total number of objects found in the receiver
1.10 Behavior
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I am the parent class of all "class" type methods. My instances know about thesubclass/superclass relationships between classes, contain the description thatinstances are created from, and hold the method dictionary that’s associatedwith each class. I provide methods for compiling methods, modifying the classinheritance hierarchy, examining the method dictionary, and iterating over theclass hierarchy.
1.10.1 Behavior: accessing class hierarchy
allSubclassesAnswer the direct and indirect subclasses of the receiver in a Set
allSuperclassesAnswer all the receiver’s superclasses in a collection
subclasses Answer the direct subclasses of the receiver in a Set
superclass Answer the receiver’s superclass (if any, otherwise answer nil)
withAllSubclassesAnswer a Set containing the receiver together with its direct and indirect sub-classes
withAllSuperclassesAnswer the receiver and all of its superclasses in a collection
1.10.2 Behavior: accessing instances and variables
allClassVarNamesReturn all the class variables understood by the receiver
allInstVarNamesAnswer the names of every instance variables the receiver contained in thereceiver’s instances
allInstancesReturns a set of all instances of the receiver
20 GNU Smalltalk Library Reference
allSharedPoolDictionariesReturn the shared pools defined by the class and any of its superclasses, in thecorrect search order.
allSharedPoolsReturn the names of the shared pools defined by the class and any of its super-classes, in the correct search order.
classPool Answer the class pool dictionary. Since Behavior does not support classes withclass variables, we answer an empty one; adding variables to it results in anerror.
classVarNamesAnswer all the class variables for instances of the receiver
indexOfInstVar: aStringAnswer the index of aString in the fixed instance variables of the instances ofthe receiver, or 0 if the variable is missing.
indexOfInstVar: aString ifAbsent: aBlockAnswer the index of aString in the fixed instance variables of the instances ofthe receiver, or 0 if the variable is missing.
instVarNamesAnswer an Array containing the instance variables defined by the receiver
instanceCountReturn a count of all the instances of the receiver
sharedPoolsReturn the names of the shared pools defined by the class
subclassInstVarNamesAnswer the names of the instance variables the receiver inherited from its su-perclass
1.10.3 Behavior: accessing the method dictionary
>> selectorReturn the compiled method associated with selector, from the local methoddictionary. Error if not found.
allSelectorsAnswer a Set of all the selectors understood by the receiver
compiledMethodAt: selectorReturn the compiled method associated with selector, from the local methoddictionary. Error if not found.
compiledMethodAt: selector ifAbsent: aBlockReturn the compiled method associated with selector, from the local methoddictionary. Evaluate aBlock if not found.
formattedSourceStringAt: selectorAnswer the method source code as a formatted string (if available) for the givenselector. Requires package Parser.
Chapter 1: Base classes 21
lookupAllSelectors: aSelectorAnswer a Set of all the compiled method associated with selector. from thelocal method dictionary and all of the superclasses.
lookupSelector: aSelectorReturn the compiled method associated with selector, from the local methoddictionary or one of a superclass; return nil if not found.
parseTreeFor: selectorAnswer the parse tree for the given selector, or nil if there was an error. Requiresthe Parser package to be loaded.
selectorAt: methodReturn selector for the given CompiledMethod
selectors Answer a Set of the receiver’s selectors
sourceCodeAt: selectorAnswer source code (if available) for the given selector.
sourceCodeAt: selector ifAbsent: aBlockAnswer source code (if available) for the given selector.
sourceMethodAt: selectorThis is too dependent on the original implementation
1.10.4 Behavior: built ins
basicNewInFixedSpaceCreate a new instance of a class with no indexed instance variables. The in-stance is guaranteed not to move across garbage collections. Like #basicNew,this method should not be overridden.
basicNewInFixedSpace: numInstanceVariablesCreate a new instance of a class with indexed instance variables. The instancehas numInstanceVariables indexed instance variables. The instance is guaran-teed not to move across garbage collections. Like #basicNew:, this methodshould not be overridden.
flushCacheInvalidate the method cache kept by the virtual machine. This message shouldnot need to be called by user programs.
methodsFor: category ifTrue: conditionCompile the following code inside the receiver, with the given category, if con-dition is true; else ignore it
primCompile: codeCompile the code, a string or readable stream, with no category. Fail if thecode does not obey Smalltalk syntax. Answer the generated CompiledMethodif it does.
Do not send this in user code; use #compile: or related methods instead.
22 GNU Smalltalk Library Reference
primCompile: code ifError: aBlockAs with #primCompile:, but evaluate aBlock (passing the file name, line num-ber and description of the error) if the code does not obey Smalltalk syntax.
Do not send this in user code; use #compile:ifError: or related methods instead.
someInstancePrivate - Answer the first instance of the receiver in the object table
1.10.5 Behavior: builtin
basicNew Create a new instance of a class with no indexed instance variables; this methodmust not be overridden.
basicNew: numInstanceVariablesCreate a new instance of a class with indexed instance variables. The instancehas numInstanceVariables indexed instance variables; this method must not beoverridden.
new Create a new instance of a class with no indexed instance variables
new: numInstanceVariablesCreate a new instance of a class with indexed instance variables. The instancehas numInstanceVariables indexed instance variables.
1.10.6 Behavior: compilation
scopeDictionaryAnswer the dictionary that is used when the receiver is before a period inSmalltalk source code.
1.10.7 Behavior: compilation (alternative)
methods Don’t use this, it’s only present to file in from Smalltalk/V
methodsForDon’t use this, it’s only present to file in from Dolphin Smalltalk
methodsFor: category ifFeatures: featuresStart compiling methods in the receiver if this implementation of Smalltalk hasthe given features, else skip the section
methodsFor: category stamp: notUsedDon’t use this, it’s only present to file in from Squeak
privateMethodsDon’t use this, it’s only present to file in from IBM Smalltalk
publicMethodsDon’t use this, it’s only present to file in from IBM Smalltalk
1.10.8 Behavior: compiling
compilerClassReturn the class that will be used to compile the parse nodes into bytecodes.
Chapter 1: Base classes 23
1.10.9 Behavior: compiling methods
methodsFor: aCategoryStringCalling this method prepares the parser to receive methods to be compiledand installed in the receiver’s method dictionary. The methods are put in thecategory identified by the parameter.
poolResolutionAnswer a PoolResolution class to be used for resolving pool variables whilecompiling methods on this class.
1.10.10 Behavior: creating a class hierarchy
addSubclass: aClassAdd aClass asone of the receiver’s subclasses.
removeSubclass: aClassRemove aClass from the list of the receiver’s subclasses
superclass: aClassSet the receiver’s superclass.
1.10.11 Behavior: enumerating
allInstancesDo: aBlockInvokes aBlock for all instances of the receiver
allSubclassesDo: aBlockInvokes aBlock for all subclasses, both direct and indirect.
allSubinstancesDo: aBlockInvokes aBlock for all instances of each of the receiver’s subclasses.
allSuperclassesDo: aBlockInvokes aBlock for all superclasses, both direct and indirect.
selectSubclasses: aBlockReturn a Set of subclasses of the receiver satisfying aBlock.
selectSuperclasses: aBlockReturn a Set of superclasses of the receiver satisfying aBlock.
subclassesDo: aBlockInvokes aBlock for all direct subclasses.
withAllSubclassesDo: aBlockInvokes aBlock for the receiver and all subclasses, both direct and indirect.
withAllSuperclassesDo: aBlockInvokes aBlock for the receiver and all superclasses, both direct and indirect.
1.10.12 Behavior: evaluating
evalString: aString to: anObjectAnswer the stack top at the end of the evaluation of the code in aString. Thecode is executed as part of anObject
24 GNU Smalltalk Library Reference
evalString: aString to: anObject ifError: aBlockAnswer the stack top at the end of the evaluation of the code in aString. IfaString cannot be parsed, evaluate aBlock (see compile:ifError:). The code isexecuted as part of anObject
evaluate: codeEvaluate Smalltalk expression in ’code’ and return result.
evaluate: code ifError: blockEvaluate ’code’. If a parsing error is detected, invoke ’block’
evaluate: code notifying: requestorEvaluate Smalltalk expression in ’code’. If a parsing error is encountered, send#error: to requestor
evaluate: code to: anObjectEvaluate Smalltalk expression as part of anObject’s method definition
evaluate: code to: anObject ifError: blockEvaluate Smalltalk expression as part of anObject’s method definition. Thismethod is used to support Inspector expression evaluation. If a parsing erroris encountered, invoke error block, ’block’
1.10.13 Behavior: instance creation
newInFixedSpaceCreate a new instance of a class without indexed instance variables. The in-stance is guaranteed not to move across garbage collections. If a subclass over-rides #new, the changes will apply to this method too.
newInFixedSpace: numInstanceVariablesCreate a new instance of a class with indexed instance variables. The instancehas numInstanceVariables indexed instance variables. The instance is guaran-teed not to move across garbage collections. If a subclass overrides #new:, thechanges will apply to this method too.
1.10.14 Behavior: instance variables
addInstVarName: aStringAdd the given instance variable to instance of the receiver
instanceVariableNames: instVarNamesSet the instance variables for the receiver to be those in instVarNames
removeInstVarName: aStringRemove the given instance variable from the receiver and recompile all of thereceiver’s subclasses
1.10.15 Behavior: method dictionary
addSelector: selector withMethod: compiledMethodAdd the given compiledMethod to the method dictionary, giving it the passedselector. Answer compiledMethod
Chapter 1: Base classes 25
compile: codeCompile method source. If there are parsing errors, answer nil. Else, return aCompiledMethod result of compilation
compile: code ifError: blockCompile method source. If there are parsing errors, invoke exception block,’block’ passing file name, line number and error. Return a CompiledMethodresult of compilation
compile: code notifying: requestorCompile method source. If there are parsing errors, send #error: to the re-questor object, else return a CompiledMethod result of compilation
compileAllRecompile all selectors in the receiver. Ignore errors.
compileAll: aNotifierRecompile all selectors in the receiver. Notify aNotifier by sending #error:messages if something goes wrong.
compileAllSubclassesRecompile all selector of all subclasses. Notify aNotifier by sending #error:messages if something goes wrong.
compileAllSubclasses: aNotifierRecompile all selector of all subclasses. Notify aNotifier by sending #error:messages if something goes wrong.
createGetMethod: whatCreate a method accessing the variable ‘what’.
createGetMethod: what default: valueCreate a method accessing the variable ‘what’, with a default value of ‘value’,using lazy initialization
createSetMethod: whatCreate a method which sets the variable ‘what’.
decompile: selectorDecompile the bytecodes for the given selector.
defineAsyncCFunc: cFuncNameString withSelectorArgs: selectorAndArgs args:argsArray
Please lookup the part on the C interface in the manual. This method isdeprecated, you should use the asyncCCall:args: attribute.
defineCFunc: cFuncNameString withSelectorArgs: selectorAndArgs returning:returnTypeSymbol args: argsArray
Please lookup the part on the C interface in the manual. This method isdeprecated, you should use the cCall:returning:args: attribute.
edit: selectorOpen Emacs to edit the method with the passed selector, then compile it
26 GNU Smalltalk Library Reference
methodDictionaryAnswer the receiver’s method dictionary. Don’t modify the method dictionaryunless you exactly know what you’re doing
methodDictionary: aDictionarySet the receiver’s method dictionary to aDictionary
recompile: selectorRecompile the given selector, answer nil if something goes wrong or the newCompiledMethod if everything’s ok.
recompile: selector notifying: aNotifierRecompile the given selector. If there are parsing errors, send #error: to theaNotifier object, else return a CompiledMethod result of compilation
removeSelector: selectorRemove the given selector from the method dictionary, answer the Compiled-Method attached to that selector
removeSelector: selector ifAbsent: aBlockRemove the given selector from the method dictionary, answer the Compiled-Method attached to that selector. If the selector cannot be found, answer theresult of evaluating aBlock.
selectorsAndMethodsDo: aBlockEvaluate aBlock, passing for each evaluation a selector that’s defined in thereceiver and the corresponding method.
1.10.16 Behavior: parsing class declarations
parseInstanceVariableString: variableStringAs with #parseVariableString:, but answer symbols that name the variablesinstead of strings.
parseVariableString: aStringAnswer an array of instance variable names. aString should specify these intraditional file-in ‘instanceVariableNames’ format. Signal an error if aStringcontains something other than valid Smalltalk variables.
1.10.17 Behavior: pluggable behavior (not yet implemented)
debuggerClassAnswer which class is to be used to debug a chain of contexts which includes thereceiver. nil means ’do not debug’; other classes are sent #debuggingPriorityand the one with the highest priority is picked.
decompilerClassAnswer the class that can be used to decompile methods, or nil if there is none(as is the case now).
evaluatorClassAnswer the class that can be used to evaluate doits, or nil if there is none (asis the case now).
Chapter 1: Base classes 27
parserClassAnswer the class that can be used to parse methods, or nil if there is none (asis the case now).
1.10.18 Behavior: printing hierarchy
hierarchyIndentAnswer the indent to be used by #printHierarchy - 4 by default
printFullHierarchyPrint my full hierarchy (i.e. all my superclasses and subclasses) on the terminal.
printHierarchyPrint my entire subclass hierarchy on the terminal.
1.10.19 Behavior: source code
formattedSourceStringAt: aSelector ifAbsent: aBlockAnswer the method source code as a formatted string. Requires package Parser.
1.10.20 Behavior: still unclassified
allSharedPoolDictionariesDo: aBlockAnswer the shared pools visible from methods in the metaclass, in the correctsearch order.
parseNodeAt: selectorAvailable only when the Parser package is loaded–Answer an RBMethodNodethat compiles to my method named by selector.
updateInstanceVars: variableArray shape: shapeUpdate instance variables and instance spec of the class and all its subclasses.variableArray lists the new variables, including inherited ones.
1.10.21 Behavior: support for lightweight classes
article Answer an article (‘a’ or ‘an’) which is ok for the receiver’s name
asClass Answer the first superclass that is a full-fledged Class object
environmentAnswer the namespace that this class belongs to - the same as the superclass,since Behavior does not support namespaces yet.
name Answer the class name; this prints to the name of the superclass enclosed inbraces. This class name is used, for example, to print the receiver.
nameIn: aNamespaceAnswer the class name when the class is referenced from aNamespace - a dummyone, since Behavior does not support names.
printOn: aStream in: aNamespaceAnswer the class name when the class is referenced from aNamespace - a dummyone, since Behavior does not support names.
28 GNU Smalltalk Library Reference
securityPolicyNot commented.
securityPolicy: aSecurityPolicyThis method should not be called for instances of this class.
1.10.22 Behavior: testing functionality
isBehavior Answer ‘true’.
1.10.23 Behavior: testing the class hierarchy
includesBehavior: aClassReturns true if aClass is the receiver or a superclass of the receiver.
inheritsFrom: aClassReturns true if aClass is a superclass of the receiver
kindOfSubclassReturn a string indicating the type of class the receiver is
shape Answer the symbolic shape of my instances.
shape: shapeGive the provided shape to the receiver’s instances. The shape can be nil, orone of #byte #int8 #character #short #word #ushort #int #uint #int64#uint64 #utf32 #float #double or #pointer. In addition, the special value#inherit means to use the shape of the superclass; note however that this isa static setting, and subclasses that used #inherit are not mutated when thesuperclass adopts a different shape.
1.10.24 Behavior: testing the form of the instances
instSize Answer how many fixed instance variables are reserved to each of the receiver’sinstances
isBits Answer whether my instances’ variables are immediate, non-OOP values.
isFixed Answer whether the receiver’s instances have no indexed instance variables
isIdentity Answer whether x = y implies x == y for instances of the receiver
isImmediateAnswer whether, if x is an instance of the receiver, x copy == x
isPointers Answer whether the instance variables of the receiver’s instances are objects
isVariable Answer whether the receiver’s instances have indexed instance variables
1.10.25 Behavior: testing the method dictionary
canUnderstand: selectorReturns true if the instances of the receiver understand the given selector
hasMethodsReturn whether the receiver has any methods defined
Chapter 1: Base classes 29
includesSelector: selectorReturns true if the local method dictionary contains the given selector
scopeHas: name ifTrue: aBlockIf methods understood by the receiver’s instances have access to a symbol named’name’, evaluate aBlock
whichClassIncludesSelector: selectorAnswer which class in the receiver’s hierarchy contains the implementation ofselector used by instances of the class (nil if none does)
whichSelectorsAccess: instVarNameAnswer a Set of selectors which access the given instance variable
whichSelectorsAssign: instVarNameAnswer a Set of selectors which read the given instance variable
whichSelectorsRead: instVarNameAnswer a Set of selectors which read the given instance variable
whichSelectorsReferTo: anObjectReturns a Set of selectors that refer to anObject
whichSelectorsReferToByteCode: aByteCodeReturn the collection of selectors in the class which reference the byte code,aByteCode
1.11 BindingDictionary
Defined in namespace SmalltalkSuperclass: DictionaryCategory: Language-Implementation
I am a special form of dictionary that provides special ways to access my keys,which typically begin with an uppercase letter; also, my associations are actuallyVariableBinding instances.
My keys are (expected to be) symbols, so I use == to match searched keys tothose in the dictionary – this is done expecting that it brings a bit more speed.
1.11.1 BindingDictionary: accessing
define: aSymbolDefine aSymbol as equal to nil inside the receiver. Fail if such a variable alreadyexists (use #at:put: if you don’t want to fail)
doesNotUnderstand: aMessageTry to map unary selectors to read accesses to the Namespace, andone-argument keyword selectors to write accesses. Note that: a) this worksonly if the selector has an uppercase first letter; and b) ‘aNamespace Variable:value’ is the same as ‘aNamespace set: #Variable to: value’, not the sameas ‘aNamespace at: #Variable put: value’ — the latter always refers to thecurrent namespace, while the former won’t define a new variable, insteadsearching in superspaces (and raising an error if the variable cannot be found).
30 GNU Smalltalk Library Reference
environmentAnswer the environment to which the receiver is connected. This can be theclass for a dictionary that holds class variables, or the super-namespace. Ingeneral it is used to compute the receiver’s name.
environment: anObjectSet the environment to which the receiver is connected. This can be the classfor a dictionary that holds class variables, or the super-namespace. In generalit is used to compute the receiver’s name.
import: aSymbol from: aNamespaceAdd to the receiver the symbol aSymbol, associated to the same value as inaNamespace. Fail if aNamespace does not contain the given key.
name Answer the receiver’s name, which by default is the same as the name of thereceiver’s environment.
nameIn: aNamespaceAnswer the receiver’s name when referred to from aNamespace; by default thecomputation is deferred to the receiver’s environment.
1.11.2 BindingDictionary: basic & copying
= arg Answer whether the receiver is equal to arg. The equality test is by defaultthe same as that for equal objects. = must not fail; answer false if the receivercannot be compared to arg
hash Answer an hash value for the receiver. This is the same as the object’s #iden-tityHash.
1.11.3 BindingDictionary: copying
copy Answer the receiver.
copyEmpty: newSizeAnswer an empty copy of the receiver whose size is newSize
copyEmptyForCollectAnswer an empty copy of the receiver which is filled in to compute the resultof #collect:
copyEmptyForCollect: sizeAnswer an empty copy of the receiver which is filled in to compute the resultof #collect:
deepCopy Answer the receiver.
shallowCopyAnswer the receiver.
1.11.4 BindingDictionary: forward declarations
at: key put: valueStore value as associated to the given key. If any, recycle Associations tem-porarily stored by the compiler inside the ‘Undeclared’ dictionary.
Chapter 1: Base classes 31
1.11.5 BindingDictionary: printing
printOn: aStream in: aNamespacePrint the receiver’s name when referred to from aNamespace; by default thecomputation is deferred to the receiver’s environment.
1.11.6 BindingDictionary: testing
species Answer ‘IdentityDictionary’.
1.12 BlockClosure
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I am a factotum class. My instances represent Smalltalk blocks, portions ofexecuteable code that have access to the environment that they were declaredin, take parameters, and can be passed around as objects to be executed bymethods outside the current class. Block closures are sent a message to computetheir value and create a new execution context; this property can be used inthe construction of control flow methods. They also provide some methods thatare used in the creation of Processes from blocks.
1.12.1 BlockClosure class: instance creation
block: aCompiledBlockAnswer a BlockClosure that activates the passed CompiledBlock.
block: aCompiledBlock receiver: anObjectAnswer a BlockClosure that activates the passed CompiledBlock with the givenreceiver.
block: aCompiledBlock receiver: anObject outerContext: aContextAnswer a BlockClosure that activates the passed CompiledBlock with the givenreceiver.
numArgs: args numTemps: temps bytecodes: bytecodes depth: depth literals:literalArray
Answer a BlockClosure for a new CompiledBlock that is created using thepassed parameters. To make it work, you must put the BlockClosure into aCompiledMethod’s literals.
1.12.2 BlockClosure class: testing
isImmediateAnswer whether, if x is an instance of the receiver, x copy == x
1.12.3 BlockClosure: accessing
argumentCountAnswer the number of arguments passed to the receiver
32 GNU Smalltalk Library Reference
block Answer the CompiledBlock which contains the receiver’s bytecodes
block: aCompiledBlockSet the CompiledBlock which contains the receiver’s bytecodes
finalIP Answer the last instruction that can be executed by the receiver
fixTemps This should fix the values of the temporary variables used in the block that areordinarily shared with the method in which the block is defined. Not definedyet, but it is not harmful that it isn’t. Answer the receiver.
initialIP Answer the initial instruction pointer into the receiver.
method Answer the CompiledMethod in which the receiver lies
numArgs Answer the number of arguments passed to the receiver
numTempsAnswer the number of temporary variables used by the receiver
outerContextAnswer the method/block context which is the immediate outer of the receiver
outerContext: containingContextSet the method/block context which is the immediate outer of the receiver
receiver Answer the object that is used as ‘self’ when executing the receiver (if nil, itmight mean that the receiver is not valid though...)
receiver: anObjectSet the object that is used as ‘self’ when executing the receiver
stackDepthAnswer the number of stack slots needed for the receiver
1.12.4 BlockClosure: built ins
cull: arg1 Evaluate the receiver, passing arg1 as the only parameter if the receiver hasparameters.
cull: arg1 cull: arg2Evaluate the receiver, passing arg1 and arg2 as parameters if the receiver acceptsthem.
cull: arg1 cull: arg2 cull: arg3Evaluate the receiver, passing arg1, arg2 and arg3 as parameters if the receiveraccepts them.
value Evaluate the receiver passing no parameters
value: arg1Evaluate the receiver passing arg1 as the only parameter
value: arg1 value: arg2Evaluate the receiver passing arg1 and arg2 as the parameters
value: arg1 value: arg2 value: arg3Evaluate the receiver passing arg1, arg2 and arg3 as the parameters
Chapter 1: Base classes 33
valueWithArguments: argumentsArrayEvaluate the receiver passing argArray’s elements as the parameters
1.12.5 BlockClosure: control structures
repeat Evaluate the receiver ’forever’ (actually until a return is executed or the processis terminated).
whileFalse Evaluate the receiver until it returns true
whileFalse: aBlockEvaluate the receiver. If it returns false, evaluate aBlock and restart
whileTrue Evaluate the receiver until it returns false
whileTrue: aBlockEvaluate the receiver. If it returns true, evaluate aBlock and restart
1.12.6 BlockClosure: exception handling
ifError: aBlockEvaluate the receiver; when #error: is called, pass to aBlock the receiver andthe parameter, and answer the result of evaluating aBlock. If another exceptionis raised, it is passed to an outer handler; if no exception is raised, the result ofevaluating the receiver is returned.
on: anException do: aBlockEvaluate the receiver; when anException is signaled, evaluate aBlock passinga Signal describing the exception. Answer either the result of evaluating thereceiver or the parameter of a Signal>>#return:
on: e1 do: b1 on: e2 do: b2Evaluate the receiver; when e1 or e2 are signaled, evaluate respectively b1 or b2,passing a Signal describing the exception. Answer either the result of evaluatingthe receiver or the argument of a Signal>>#return:
on: e1 do: b1 on: e2 do: b2 on: e3 do: b3Evaluate the receiver; when e1, e2 or e3 are signaled, evaluate respectively b1,b2 or b3, passing a Signal describing the exception. Answer either the result ofevaluating the receiver or the parameter of a Signal>>#return:
on: e1 do: b1 on: e2 do: b2 on: e3 do: b3 on: e4 do: b4Evaluate the receiver; when e1, e2, e3 or e4 are signaled, evaluate respectivelyb1, b2, b3 or b4, passing a Signal describing the exception. Answer either theresult of evaluating the receiver or the parameter of a Signal>>#return:
on: e1 do: b1 on: e2 do: b2 on: e3 do: b3 on: e4 do: b4 on: e5 do: b5Evaluate the receiver; when e1, e2, e3, e4 or e5 are signaled, evaluate respec-tively b1, b2, b3, b4 or b5, passing a Signal describing the exception. Answereither the result of evaluating the receiver or the parameter of a Signal>>-#return:
34 GNU Smalltalk Library Reference
1.12.7 BlockClosure: multiple process
fork Create a new process executing the receiver and start it
forkAt: priorityCreate a new process executing the receiver with given priority and start it
forkWithoutPreemptionEvaluate the receiver in a process that cannot be preempted. If the receiverexpect a parameter, pass the current process.
newProcessCreate a new process executing the receiver in suspended state. The priority isthe same as for the calling process. The receiver must not contain returns
newProcessWith: anArrayCreate a new process executing the receiver with the passed arguments, andleave it in suspended state. The priority is the same as for the calling process.The receiver must not contain returns
valueWithoutInterruptsEvaluate aBlock and delay all interrupts that are requested to the active processduring its execution to after aBlock returns.
valueWithoutPreemptionEvaluate the receiver with external interrupts disabled. This effectively dis-ables preemption as long as the block does not explicitly yield control, wait onsemaphores, and the like.
1.12.8 BlockClosure: overriding
copy Answer the receiver.
deepCopy Answer a shallow copy.
1.12.9 BlockClosure: testing
hasMethodReturnAnswer whether the block contains a method return
1.12.10 BlockClosure: unwind protection
ensure: aBlockEvaluate the receiver; when any exception is signaled exit returning the resultof evaluating aBlock; if no exception is raised, return the result of evaluatingaBlock when the receiver has ended
ifCurtailed: aBlockEvaluate the receiver; if its execution triggers an unwind which truncates theexecution of the block (‘curtails’ the block), evaluate aBlock. The three caseswhich can curtail the execution of the receiver are: a non-local return in thereceiver, a non-local return in a block evaluated by the receiver which returnspast the receiver itself, and an exception raised and not resumed during theexecution of the receiver.
Chapter 1: Base classes 35
valueWithUnwindEvaluate the receiver. Any errors caused by the block will cause a backtrace,but execution will continue in the method that sent #valueWithUnwind, afterthat call. Example: [ 1 / 0 ] valueWithUnwind. ’unwind works!’ printNl.
Important: this method is public, but it is intended to be used in very specialcases (as a rule of thumb, use it only when the corresponding C code uses thegst prepare execution environment and gst finish execution environmentfunctions). You should usually rely on #ensure: and #on:do:.
1.13 BlockContext
Defined in namespace SmalltalkSuperclass: ContextPartCategory: Language-Implementation
My instances represent executing Smalltalk blocks, which are portions of exe-cuteable code that have access to the environment that they were declared in,take parameters, and result from BlockClosure objects created to be executedby methods outside the current class. Block contexts are created by messagessent to compute a closure’s value. They contain a stack and also provide somemethods that can be used in inspection or debugging.
1.13.1 BlockContext: accessing
caller Answer the context that called the receiver
home Answer the MethodContext to which the receiver refers, or nil if it has beenoptimized away
isBlock Answer whether the receiver is a block context
isDisabled Answers false, because contexts that are skipped when doing a return are alwaysMethodContexts. BlockContexts are removed from the chain whenever a non-local return is done, while MethodContexts need to stay there in case there isa non-local return from the #ensure: block.
isEnvironmentTo create a valid execution environment for the interpreter even before it starts,GST creates a fake context whose selector is nil and which can be used as amarker for the current execution environment. Answer whether the receiver isthat kind of context (always false, since those contexts are always MethodCon-texts).
isUnwind Answers whether the context must continue execution even after a non-local re-turn (a return from the enclosing method of a block, or a call to the #continue:method of ContextPart). Such contexts are created only by #ensure: and arealways MethodContexts.
nthOuterContext: nAnswer the n-th outer block/method context for the receiver
outerContextAnswer the outer block/method context for the receiver
36 GNU Smalltalk Library Reference
1.13.2 BlockContext: debugging
isInternalExceptionHandlingContextAnswer whether the receiver is a context that should be hidden to the userwhen presenting a backtrace. Such contexts are never blocks, but check therest of the chain.
1.13.3 BlockContext: printing
printOn: aStreamPrint a representation for the receiver on aStream
1.14 Boolean
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
I have two instances in the Smalltalk system: true and false. I provide methodsthat are conditional on boolean values, such as conditional execution and loops,and conditional testing, such as conditional and and conditional or. I shouldsay that I appear to provide those operations; my subclasses True and Falseactually provide those operations.
1.14.1 Boolean class: testing
isIdentity Answer whether x = y implies x == y for instances of the receiver
isImmediateAnswer whether, if x is an instance of the receiver, x copy == x
1.14.2 Boolean: basic
& aBooleanThis method’s functionality should be implemented by subclasses of Boolean
and: aBlockThis method’s functionality should be implemented by subclasses of Boolean
eqv: aBooleanThis method’s functionality should be implemented by subclasses of Boolean
ifFalse: falseBlockThis method’s functionality should be implemented by subclasses of Boolean
ifFalse: falseBlock ifTrue: trueBlockThis method’s functionality should be implemented by subclasses of Boolean
ifTrue: trueBlockThis method’s functionality should be implemented by subclasses of Boolean
ifTrue: trueBlock ifFalse: falseBlockThis method’s functionality should be implemented by subclasses of Boolean
not This method’s functionality should be implemented by subclasses of Boolean
Chapter 1: Base classes 37
or: aBlock This method’s functionality should be implemented by subclasses of Boolean
xor: aBooleanThis method’s functionality should be implemented by subclasses of Boolean
| aBooleanThis method’s functionality should be implemented by subclasses of Boolean
1.14.3 Boolean: C hacks
asCBooleanValueThis method’s functionality should be implemented by subclasses of Boolean
1.14.4 Boolean: overriding
deepCopy Answer the receiver.
shallowCopyAnswer the receiver.
1.14.5 Boolean: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
1.15 ByteArray
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable
My instances are similar to strings in that they are both represented as a se-quence of bytes, but my individual elements are integers, where as a String’selements are characters.
1.15.1 ByteArray class: instance creation
fromCData: aCObject size: anIntegerAnswer a ByteArray containing anInteger bytes starting at the location pointedto by aCObject
1.15.2 ByteArray: basic
= aCollectionAnswer whether the receiver’s items match those in aCollection
indexOf: anElement startingAt: anIndexAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
38 GNU Smalltalk Library Reference
indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlockAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
1.15.3 ByteArray: built ins
asCData: aCTypeAllocate memory with malloc for a copy of the receiver, and return it convertedto a CObject with the given type
at: anIndex ifAbsent: aBlockAnswer the index-th indexed instance variable of the receiver
byteAt: indexAnswer the index-th indexed instance variable of the receiver
byteAt: index put: valueStore the ‘value’ byte in the index-th indexed instance variable of the receiver
hash Answer an hash value for the receiver
replaceFrom: start to: stop with: aByteArray startingAt: replaceStartReplace the characters from start to stop with the bytes contained in aByteAr-ray (which, actually, can be any variable byte class), starting at the replaceStartlocation of aByteArray
replaceFrom: start to: stop withString: aString startingAt: replaceStartReplace the characters from start to stop with the ASCII codes contained inaString (which, actually, can be any variable byte class), starting at the re-placeStart location of aString
1.15.4 ByteArray: CObject
asCData Allocate memory with malloc for a copy of the receiver, and return a pointerto it as a CByte.
castTo: typeGive access to the receiver as a value with the given CType.
1.15.5 ByteArray: converting
asString Answer a String whose character’s ASCII codes are the receiver’s contents
asUnicodeStringAnswer a UnicodeString whose character’s codes are the receiver’s contents.This is not implemented unless you load the I18N package.
1.15.6 ByteArray: more advanced accessing
charAt: indexAccess the C char at the given index in the receiver. The value is returned asa Smalltalk Character. Indices are 1-based just like for other Smalltalk access.
Chapter 1: Base classes 39
charAt: index put: valueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indicesare 1-based just like for other Smalltalk access.
doubleAt: indexAccess the C double at the given index in the receiver. Indices are 1-based justlike for other Smalltalk access.
doubleAt: index put: valueStore the Smalltalk Float object identified by ‘value’, at the given index inthe receiver, writing it like a C double. Indices are 1-based just like for otherSmalltalk access.
floatAt: indexAccess the C float at the given index in the receiver. Indices are 1-based justlike for other Smalltalk access.
floatAt: index put: valueStore the Smalltalk Float object identified by ‘value’, at the given index inthe receiver, writing it like a C float. Indices are 1-based just like for otherSmalltalk access.
intAt: indexAccess the C int at the given index in the receiver. Indices are 1-based just likefor other Smalltalk access.
intAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index in thereceiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalkaccess.
longAt: indexAccess the C long int at the given index in the receiver. Indices are 1-basedjust like for other Smalltalk access.
longAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(long) bytes. Indices are 1-based just like for otherSmalltalk access.
longDoubleAt: indexAccess the C long double at the given index in the receiver. Indices are 1-basedjust like for other Smalltalk access.
longDoubleAt: index put: valueStore the Smalltalk Float object identified by ‘value’, at the given index inthe receiver, writing it like a C double. Indices are 1-based just like for otherSmalltalk access.
objectAt: indexAccess the Smalltalk object (OOP) at the given index in the receiver. Indicesare 1-based just like for other Smalltalk access.
40 GNU Smalltalk Library Reference
objectAt: index put: valueStore a pointer (OOP) to the Smalltalk object identified by ‘value’, at the givenindex in the receiver. Indices are 1-based just like for other Smalltalk access.
shortAt: indexAccess the C short int at the given index in the receiver. Indices are 1-basedjust like for other Smalltalk access.
shortAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(short) bytes. Indices are 1-based just like for otherSmalltalk access.
stringAt: indexAccess the string pointed by the C ‘char *’ at the given index in the receiver.Indices are 1-based just like for other Smalltalk access.
stringAt: index put: valueStore the Smalltalk String object identified by ‘value’, at the given index inthe receiver, writing it like a *FRESHLY ALLOCATED* C string. It is thecaller’s responsibility to free it if necessary. Indices are 1-based just like forother Smalltalk access.
ucharAt: indexAccess the C unsigned char at the given index in the receiver. The valueis returned as a Smalltalk Character. Indices are 1-based just like for otherSmalltalk access.
ucharAt: index put: valueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indicesare 1-based just like for other Smalltalk access.
uintAt: indexAccess the C unsigned int at the given index in the receiver. Indices are 1-basedjust like for other Smalltalk access.
uintAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index in thereceiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalkaccess.
ulongAt: indexAccess the C unsigned long int at the given index in the receiver. Indices are1-based just like for other Smalltalk access.
ulongAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(long) bytes. Indices are 1-based just like for otherSmalltalk access.
Chapter 1: Base classes 41
unsignedCharAt: indexAccess the C unsigned char at the given index in the receiver. The valueis returned as a Smalltalk Character. Indices are 1-based just like for otherSmalltalk access.
unsignedCharAt: index put: valueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indicesare 1-based just like for other Smalltalk access.
unsignedIntAt: indexAccess the C unsigned int at the given index in the receiver. Indices are 1-basedjust like for other Smalltalk access.
unsignedIntAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index in thereceiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalkaccess.
unsignedLongAt: indexAccess the C unsigned long int at the given index in the receiver. Indices are1-based just like for other Smalltalk access.
unsignedLongAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(long) bytes. Indices are 1-based just like for otherSmalltalk access.
unsignedShortAt: indexAccess the C unsigned short int at the given index in the receiver. Indices are1-based just like for other Smalltalk access.
unsignedShortAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(short) bytes. Indices are 1-based just like for otherSmalltalk access.
ushortAt: indexAccess the C unsigned short int at the given index in the receiver. Indices are1-based just like for other Smalltalk access.
ushortAt: index put: valueStore the Smalltalk Integer object identified by ‘value’, at the given index inthe receiver, using sizeof(short) bytes. Indices are 1-based just like for otherSmalltalk access.
1.15.7 ByteArray: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeLiteralOn: aStreamPut a Smalltalk literal evaluating to the receiver on aStream.
42 GNU Smalltalk Library Reference
storeOn: aStreamPut Smalltalk code evaluating to the receiver on aStream.
1.16 CAggregate
Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface
1.16.1 CAggregate class: accessing
alignof Answer the receiver’s instances required aligment
sizeof Answer the receiver’s instances size
1.16.2 CAggregate: accessing
elementTypeAnswer the type over which the receiver is constructed.
1.17 CallinProcess
Defined in namespace SmalltalkSuperclass: ProcessCategory: Language-Processes
I represent a unit of computation for which external C code requested execution,so I must store the returned value once my computation terminates and I mustnot survive across image saves (since those who invoked me no longer exist). Iam otherwise equivalent to a Process.
1.17.1 CallinProcess: debugging
detach Continue running the receiver as a normal Process, and return nil from thecallin.
1.18 CArray
Defined in namespace SmalltalkSuperclass: CAggregateCategory: Language-C interface
1.18.1 CArray: accessing
alignof Answer the receiver’s required aligment
sizeof Answer the receiver’s size
1.19 CArrayCType
Defined in namespace SmalltalkSuperclass: CPtrCTypeCategory: Language-C interface
Chapter 1: Base classes 43
1.19.1 CArrayCType class: instance creation
elementType: aCTypeThis method should not be called for instances of this class.
elementType: aCType numberOfElements: anIntegerAnswer a new instance of CPtrCType that maps an array whose elements areof the given CType, and whose size is exactly anInteger elements (of course,anInteger only matters for allocation, not for access, since no out-of-boundsprotection is provided for C objects).
from: typePrivate - Called by CType>>from: for arrays
1.19.2 CArrayCType: accessing
alignof Answer the alignment of the receiver’s instances
numberOfElementsAnswer the number of elements in the receiver’s instances
sizeof Answer the size of the receiver’s instances
1.19.3 CArrayCType: basic
= anObjectReturn whether the receiver and anObject are equal.
hash Return a hash code for the receiver.
1.19.4 CArrayCType: storing
storeOn: aStreamAs with super.
1.20 CBoolean
Defined in namespace SmalltalkSuperclass: CByteCategory: Language-C interface
I return true if a byte is not zero, false otherwise.
1.20.1 CBoolean class: conversion
type Answer a CType for the receiver
1.20.2 CBoolean: accessing
value Get the receiver’s value - answer true if it is != 0, false if it is 0.
value: aBooleanSet the receiver’s value - it’s the same as for CBytes, but we get a Boolean, nota Character
44 GNU Smalltalk Library Reference
1.21 CByte
Defined in namespace SmalltalkSuperclass: CUCharCategory: Language-C interface
You know what a byte is, don’t you?!?
1.21.1 CByte class: conversion
cObjStoredTypeNothing special in the default case - answer a CType for the receiver
type Answer a CType for the receiver
1.21.2 CByte: accessing
cObjStoredTypeNothing special in the default case - answer the receiver’s CType
value Answer the value the receiver is pointing to. The returned value is a SmallInte-ger
value: aValueSet the receiver to point to the value, aValue (a SmallInteger).
1.22 CCallable
Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface
I am not part of the Smalltalk definition. My instances contain informationabout C functions that can be called from within Smalltalk, such as numberand type of parameters. This information is used by the C callout mechanismto perform the actual call-out to C routines.
1.22.1 CCallable class: instance creation
for: aCObject returning: returnTypeSymbol withArgs: argsArrayAnswer a CFunctionDescriptor with the given address, return type and argu-ments. The address will be reset to NULL upon image save (and it’s the user’stask to figure out a way to reinitialize it!)
1.22.2 CCallable: accessing
isValid Answer whether the object represents a valid function.
returnTypeNot commented.
1.22.3 CCallable: calling
asyncCall Perform the call-out for the function represented by the receiver. The arguments(and the receiver if one of the arguments has type #self or #selfSmalltalk) are
Chapter 1: Base classes 45
taken from the parent context. Asynchronous call-outs don’t return a value,but if the function calls back into Smalltalk the process that started the call-outis not suspended.
asyncCallNoRetryFrom: aContextPerform the call-out for the function represented by the receiver. The arguments(and the receiver if one of the arguments has type #self or #selfSmalltalk) aretaken from the base of the stack of aContext. Asynchronous call-outs don’treturn a value, but if the function calls back into Smalltalk the process thatstarted the call-out is not suspended. Unlike #asyncCallFrom:, this methoddoes not attempt to find functions in shared objects.
callInto: aValueHolderPerform the call-out for the function represented by the receiver. The arguments(and the receiver if one of the arguments has type #self or #selfSmalltalk) aretaken from the parent context, and the the result is stored into aValueHolder.aValueHolder is also returned.
callNoRetryFrom: aContext into: aValueHolderPerform the call-out for the function represented by the receiver. The arguments(and the receiver if one of the arguments has type #self or #selfSmalltalk) aretaken from the base of the stack of aContext, and the result is stored intoaValueHolder. aValueHolder is also returned. Unlike #callFrom:into:, thismethod does not attempt to find functions in shared objects.
1.22.4 CCallable: restoring
link Rebuild the object after the image is restarted.
1.23 CCallbackDescriptor
Defined in namespace SmalltalkSuperclass: CCallableCategory: Language-C interface
I am not part of the Smalltalk definition. My instances are able to convertblocks into C functions that can be passed to C.
1.23.1 CCallbackDescriptor class: instance creation
for: aBlock returning: returnTypeSymbol withArgs: argsArrayAnswer a CCallbackDescriptor with the given block, return type and arguments.
1.23.2 CCallbackDescriptor: accessing
block Answer the block of the function represented by the receiver.
block: aBlockSet the block of the function represented by the receiver.
1.23.3 CCallbackDescriptor: restoring
link Make the address of the function point to the registered address.
46 GNU Smalltalk Library Reference
1.24 CChar
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.24.1 CChar class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.24.2 CChar: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.24.3 CChar: conversion
asByteArray: sizeConvert size bytes pointed to by the receiver to a String
asString Convert the data pointed to by the receiver, up to the first NULL byte, to aString
asString: sizeConvert size bytes pointed to by the receiver to a String
1.25 CCompound
Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface
1.25.1 CCompound class: instance creation
gcNew Allocate a new instance of the receiver, backed by garbage-collected storage.
new Allocate a new instance of the receiver. To free the memory after GC, rememberto call #addToBeFinalized.
1.25.2 CCompound class: subclass creation
alignof Answer 1, the alignment of an empty struct
classPragmasReturn the pragmas that are written in the file-out of this class.
compileSize: size align: alignmentPrivate - Compile sizeof and alignof methods
Chapter 1: Base classes 47
declarationReturn the description of the fields in the receiver class.
declaration: arrayThis method’s functionality should be implemented by subclasses of CCom-pound
declaration: array inject: startOffset into: aBlockCompile methods that implement the declaration in array. To compute theoffset after each field, the value of the old offset plus the new field’s size ispassed to aBlock, together with the new field’s alignment requirements.
emitFieldNameTo: str for: namePrivate - Emit onto the given stream the code for adding the given selector tothe CCompound’s #examineOn: method.
newStruct: structName declaration: arrayThe old way to create a CStruct. Superseded by #subclass:declaration:...
sizeof Answer 0, the size of an empty struct
subclass: structName declaration: array classVariableNames: cvn poolDictionaries: pdcategory: category
Create a new class with the given name that contains code to implement thegiven C struct. All the parameters except ‘array’ are the same as for a standardclass creation message; see documentation for more information
1.25.3 CCompound: debugging
examineOn: aStreamPrint the contents of the receiver’s fields on aStream
fieldSelectorListAnswer a list of selectors whose return values should be printed by#examineOn:.
1.26 CDouble
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.26.1 CDouble class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.26.2 CDouble: accessing
alignof Answer the receiver’s required aligment
48 GNU Smalltalk Library Reference
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.27 CFloat
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.27.1 CFloat class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.27.2 CFloat: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.28 CFunctionDescriptor
Defined in namespace SmalltalkSuperclass: CCallableCategory: Language-C interface
I am not part of the Smalltalk definition. My instances contain informationabout C functions that can be called from within Smalltalk, such as numberand type of parameters. This information is used by the C callout mechanismto perform the actual call-out to C routines.
1.28.1 CFunctionDescriptor class: instance creation
for: funcName returning: returnTypeSymbol withArgs: argsArrayAnswer a CFunctionDescriptor with the given function name, return type andarguments. funcName must be a String.
1.28.2 CFunctionDescriptor class: testing
addressOf: functionAnswer whether a function is registered (on the C side) with the given nameor is dynamically loadable.
isFunction: functionAnswer whether a function is registered (on the C side) with the given name.
Chapter 1: Base classes 49
1.28.3 CFunctionDescriptor: accessing
name Answer the name of the function (on the C side) represented by the receiver
name: aStringSet the name of the function (on the C side) represented by the receiver
1.28.4 CFunctionDescriptor: printing
printOn: aStreamPrint a representation of the receiver onto aStream
1.28.5 CFunctionDescriptor: restoring
link Make the address of the function point to the registered address.
1.29 Character
Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types
My instances represent the 256 characters of the character set. I provide mes-sages to translate between integers and character objects, and provide namesfor some of the common unprintable characters.
Character is always used (mostly for performance reasons) when referring tocharacters whose code point is between 0 and 127. Above 127, instead, morecare is needed: Character refers to bytes that are used as part of encoding of acharacter, while UnicodeCharacter refers to the character itself.
1.29.1 Character class: built ins
asciiValue: anIntegerReturns the character object corresponding to anInteger. Error if anInteger isnot an integer, or not in 0..127.
codePoint: anIntegerReturns the character object, possibly an UnicodeCharacter, corresponding toanInteger. Error if anInteger is not an integer, or not in 0..16r10FFFF.
value: anIntegerReturns the character object corresponding to anInteger. Error if anInteger isnot an integer, or not in 0..255.
1.29.2 Character class: constants
backspace Returns the character ’backspace’
bell Returns the character ’bel’
cr Returns the character ’cr’
eof Returns the character ’eof’, also known as ’sub’
eot Returns the character ’eot’, also known as ’Ctrl-D’
50 GNU Smalltalk Library Reference
esc Returns the character ’esc’
ff Returns the character ’ff’, also known as ’newPage’
lf Returns the character ’lf’, also known as ’nl’
newPage Returns the character ’newPage’, also known as ’ff’
nl Returns the character ’nl’, also known as ’lf’
nul Returns the character ’nul’
space Returns the character ’space’
tab Returns the character ’tab’
1.29.3 Character class: initializing lookup tables
initialize Initialize the lookup table which is used to make case and digit-to-char con-versions faster. Indices in Table are ASCII values incremented by one. Indices1-256 classify chars (0 = nothing special, 2 = separator, 48 = digit, 55 = upper-case, 3 = lowercase), indices 257-512 map to lowercase chars, indices 513-768map to uppercase chars.
1.29.4 Character class: instance creation
digitValue: anIntegerReturns a character that corresponds to anInteger. 0-9 map to $0-$9, 10-35map to $A-$Z
1.29.5 Character class: testing
isImmediateAnswer whether, if x is an instance of the receiver, x copy == x
1.29.6 Character: built ins
= char Boolean return value; true if the characters are equal
asInteger Returns the integer value corresponding to self. #codePoint, #asciiValue,#value, and #asInteger are synonyms.
asciiValue Returns the integer value corresponding to self. #codePoint, #asciiValue,#value, and #asInteger are synonyms.
codePoint Returns the integer value corresponding to self. #codePoint, #asciiValue,#value, and #asInteger are synonyms.
value Returns the integer value corresponding to self. #codePoint, #asciiValue,#value, and #asInteger are synonyms.
1.29.7 Character: coercion methods
* aNumberReturns a String with aNumber occurrences of the receiver.
Chapter 1: Base classes 51
asLowercaseReturns self as a lowercase character if it’s an uppercase letter, otherwise returnsthe character unchanged.
asString Returns the character self as a string. Only valid if the character is between 0and 255.
asSymbol Returns the character self as a symbol.
asUnicodeStringReturns the character self as a Unicode string.
asUppercaseReturns self as a uppercase character if it’s an lowercase letter, otherwise returnsthe character unchanged.
1.29.8 Character: comparing
< aCharacterCompare the character’s ASCII value. Answer whether the receiver’s is theleast.
<= aCharacterCompare the character’s ASCII value. Answer whether the receiver’s is theleast or their equal.
> aCharacterCompare the character’s ASCII value. Answer whether the receiver’s is thegreatest.
>= aCharacterCompare the character’s ASCII value. Answer whether the receiver’s is thegreatest or their equal.
1.29.9 Character: converting
asCharacterReturn the receiver, since it is already a character.
digitValue Returns the value of self interpreted as a digit. Here, ’digit’ means either 0-9,or A-Z, which maps to 10-35.
1.29.10 Character: printing
displayOn: aStreamPrint a representation of the receiver on aStream. Unlike #printOn:, thismethod strips the leading dollar.
printOn: aStreamPrint a representation of the receiver on aStream
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
52 GNU Smalltalk Library Reference
1.29.11 Character: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.29.12 Character: testing
isAlphaNumericTrue if self is a letter or a digit
isDigit True if self is a 0-9 digit
isDigit: radixAnswer whether the receiver is a valid character in the given radix.
isLetter True if self is an upper- or lowercase letter
isLowercaseTrue if self is a lowercase letter
isPathSeparatorReturns true if self is a path separator ($/ or $\ under Windows, $/ only underUnix systems including Mac OS X).
isPunctuationReturns true if self is one of ’.,:;!?’
isSeparatorReturns true if self is a space, cr, tab, nl, or newPage
isUppercaseTrue if self is uppercase
isVowel Returns true if self is a, e, i, o, or u; case insensitive
1.29.13 Character: testing functionality
isCharacterAnswer True. We’re definitely characters
1.30 CharacterArray
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Text
My instances represent a generic textual (string) data type. I provide accessingand manipulation methods for strings.
1.30.1 CharacterArray class: basic
fromString: aCharacterArrayMake up an instance of the receiver containing the same characters as aChar-acterArray, and answer it.
Chapter 1: Base classes 53
lineDelimiterAnswer a CharacterArray which one can use as a line delimiter. This is meantto be used on subclasses of CharacterArray.
1.30.2 CharacterArray class: multibyte encodings
isUnicode Answer whether the receiver stores bytes (i.e. an encoded form) or characters(if true is returned).
1.30.3 CharacterArray: basic
valueAt: anIndex ifAbsent: aBlockAnswer the ascii value of the anIndex-th character of the receiver, or evaluateaBlock and answer the result if the index is out of range.
1.30.4 CharacterArray: built ins
valueAt: indexAnswer the ascii value of index-th character variable of the receiver
valueAt: index put: valueStore (Character value: value) in the index-th indexed instance variable of thereceiver
1.30.5 CharacterArray: comparing
< aCharacterArrayReturn true if the receiver is less than aCharacterArray, ignoring case differ-ences.
<= aCharacterArrayReturns true if the receiver is less than or equal to aCharacterArray, ignoringcase differences. If is receiver is an initial substring of aCharacterArray, it isconsidered to be less than aCharacterArray.
= aString Answer whether the receiver’s items match those in aCollection
> aCharacterArrayReturn true if the receiver is greater than aCharacterArray, ignoring case dif-ferences.
>= aCharacterArrayReturns true if the receiver is greater than or equal to aCharacterArray, ignoringcase differences. If is aCharacterArray is an initial substring of the receiver, itis considered to be less than the receiver.
indexOf: aCharacterArray matchCase: aBoolean startingAt: anIndexAnswer an Interval of indices in the receiver which match the aCharacterArraypattern. # in aCharacterArray means ’match any character’, * in aCharacter-Array means ’match any sequence of characters’. The first item of the returnedinterval is >= anIndex. If aBoolean is false, the search is case-insensitive, elseit is case-sensitive. If no Interval matches the pattern, answer nil.
54 GNU Smalltalk Library Reference
match: aCharacterArrayAnswer whether aCharacterArray matches the pattern contained in the receiver.# in the receiver means ’match any character’, * in receiver means ’match anysequence of characters’.
match: aCharacterArray ignoreCase: aBooleanAnswer whether aCharacterArray matches the pattern contained in the receiver.# in the receiver means ’match any character’, * in receiver means ’match anysequence of characters’. The case of alphabetic characters is ignored if aBooleanis true.
sameAs: aCharacterArrayReturns true if the receiver is the same CharacterArray as aCharacterArray,ignoring case differences.
1.30.6 CharacterArray: converting
asByteArrayReturn the receiver, converted to a ByteArray of ASCII values
asClassPoolKeyReturn the receiver, ready to be put in a class pool dictionary
asGlobalKeyReturn the receiver, ready to be put in the Smalltalk dictionary
asInteger Parse an Integer number from the receiver until the input character is invalidand answer the result at this point
asLowercaseReturns a copy of self as a lowercase CharacterArray
asNumber Parse a Number from the receiver until the input character is invalid and answerthe result at this point
asPoolKey Return the receiver, ready to be put in a pool dictionary
asString But I already am a String! Really!
asSymbol Returns the symbol corresponding to the CharacterArray
asUnicodeStringAnswer a UnicodeString whose character’s codes are the receiver’s contents Thisis not implemented unless you load the I18N package.
asUppercaseReturns a copy of self as an uppercase CharacterArray
fileName But I don’t HAVE a file name!
filePos But I don’t HAVE a file position!
isNumeric Answer whether the receiver denotes a number
trimSeparatorsReturn a copy of the reciever without any spaces on front or back. The imple-mentation is protected against the ‘all blanks’ case.
Chapter 1: Base classes 55
1.30.7 CharacterArray: multibyte encodings
encoding Answer the encoding used by the receiver.
isUnicode Answer whether the receiver stores bytes (i.e. an encoded form) or characters(if true is returned).
numberOfCharactersAnswer the number of Unicode characters in the receiver. This is not imple-mented unless you load the I18N package.
1.30.8 CharacterArray: still unclassified
withUnixShellEscapesAnswer the receiver with special shell characters converted to a backslash se-quence.
withWindowsShellEscapesAnswer the receiver with Windows shell characters escaped properly.
1.30.9 CharacterArray: string processing
% aCollectionAnswer the receiver with special escape sequences replaced by elements of aCol-lection. %n (1<=n<=9, A<=n<=Z) are replaced by the n-th element of aCollec-tion (A being the 10-th element and so on until the 35th). %(string) sequencesare accessed as strings, which makes sense only if aCollection is a Dictionaryor LookupTable. In addition, the special pattern %<trueString|falseString>nor %<trueString|falseString>(string) is replaced with one of the two strings de-pending on the element of aCollection being true or false. The replaced elementsare ‘displayed’ (i.e. their displayString is used).
bindWith: s1Answer the receiver with every %1 replaced by the displayString of s1
bindWith: s1 with: s2Answer the receiver with every %1 or %2 replaced by s1 or s2, respectively. s1and s2 are ‘displayed’ (i.e. their displayString is used) upon replacement.
bindWith: s1 with: s2 with: s3Answer the receiver with every %1, %2 or %3 replaced by s1, s2 or s3, re-spectively. s1, s2 and s3 are ‘displayed’ (i.e. their displayString is used) uponreplacement.
bindWith: s1 with: s2 with: s3 with: s4Answer the receiver with every %1, %2, %3 or %4 replaced by s1, s2, s3 or s4,respectively. s1, s2, s3 and s4 are ‘displayed’ (i.e. their displayString is used)upon replacement.
bindWithArguments: aCollectionAnswer the receiver with special escape sequences replaced by elements of aCol-lection. %n (1<=n<=9, A<=n<=Z) are replaced by the n-th element of aCollec-tion (A being the 10-th element and so on until the 35th). %(string) sequences
56 GNU Smalltalk Library Reference
are accessed as strings, which makes sense only if aCollection is a Dictionaryor LookupTable. In addition, the special pattern %<trueString|falseString>nor %<trueString|falseString>(string) is replaced with one of the two strings de-pending on the element of aCollection being true or false. The replaced elementsare ‘displayed’ (i.e. their displayString is used).
contractTo: smallSizeEither return myself, or a copy shortened to smallSize characters by insertingan ellipsis (three dots: ...)
lines Answer an Array of Strings each representing one line in the receiver.
linesDo: aBlockEvaluate aBlock once for every newline delimited line in the receiver, passingthe line to the block.
subStrings Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of white space charac-ters
subStrings: sepAnswer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every occurrence of one of the char-acters in sep
substrings Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of white space charac-ters. This message is preserved for backwards compatibility; the ANSI standardmandates ‘subStrings’, with an uppercase s.
substrings: sepAnswer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every occurrence of one of the charac-ters in sep. This message is preserved for backwards compatibility; the ANSIstandard mandates ‘subStrings:’, with an uppercase s.
withShellEscapesAnswer the receiver with special shell characters converted to a backslash se-quence.
1.30.10 CharacterArray: testing functionality
isCharacterArrayAnswer ‘true’.
1.31 CInt
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
Chapter 1: Base classes 57
1.31.1 CInt class: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s size
1.31.2 CInt: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s instances size
1.32 Class
Defined in namespace SmalltalkSuperclass: ClassDescriptionCategory: Language-Implementation
I am THE class object. My instances are the classes of the system. I provideinformation commonly attributed to classes: namely, the class name, class com-ment (you wouldn’t be reading this if it weren’t for me), a list of the instancevariables of the class, and the class category.
1.32.1 Class class: initialize
initialize Perform the special initialization of root classes.
1.32.2 Class: accessing instances and variables
addClassVarName: aStringAdd a class variable with the given name to the class pool dictionary.
addClassVarName: aString value: valueBlockAdd a class variable with the given name to the class pool dictionary, andevaluate valueBlock as its initializer.
addSharedPool: aDictionaryAdd the given shared pool to the list of the class’ pool dictionaries
allClassVarNamesAnswer the names of the variables in the receiver’s class pool dictionary and ineach of the superclasses’ class pool dictionaries
bindingFor: aStringAnswer the variable binding for the class variable with the given name
category Answer the class category
category: aStringChange the class category to aString
58 GNU Smalltalk Library Reference
classPool Answer the class pool dictionary
classPragmasReturn the pragmas that are written in the file-out of this class.
classVarNamesAnswer the names of the variables in the class pool dictionary
comment Answer the class comment
comment: aStringChange the class name
environmentAnswer ‘environment’.
environment: aNamespaceSet the receiver’s environment to aNamespace and recompile everything
initialize redefined in children (?)
initializeAsRootClassPerform special initialization reserved to root classes.
name Answer the class name
removeClassVarName: aStringRemoves the class variable from the class, error if not present, or still in use.
removeSharedPool: aDictionaryRemove the given dictionary to the list of the class’ pool dictionaries
sharedPoolsReturn the names of the shared pools defined by the class
superclass: aClassSet the receiver’s superclass.
1.32.3 Class: filing
fileOutDeclarationOn: aFileStreamFile out class definition to aFileStream. Requires package Parser.
fileOutOn: aFileStreamFile out complete class description: class definition, class and instance methods.Requires package Parser.
1.32.4 Class: instance creation
extend Redefine a version of the receiver in the current namespace. Note: this methodcan bite you in various ways when sent to system classes; read the section onnamespaces in the manual for some examples of the problems you can encounter.
inheritShapeAnswer whether subclasses will have by default the same shape as this class.The default is false.
Chapter 1: Base classes 59
subclass: classNameStringDefine a subclass of the receiver with the given name. If the class is alreadydefined, don’t modify its instance or class variables but still, if necessary, re-compile everything needed.
subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a fixed subclass of the receiver with the given name, instance variables,class variables, pool dictionaries and category. If the class is already defined, ifnecessary, recompile everything needed.
variable: shape subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a variable subclass of the receiver with the given name, shape, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed. The shape can be one of#byte #int8 #character #short #ushort #int #uint #int64 #uint64 #utf32#float #double or #pointer.
variableByteSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a byte variable subclass of the receiver with the given name, instancevariables (must be ”), class variables, pool dictionaries and category. If theclass is already defined, if necessary, recompile everything needed.
variableSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a variable pointer subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed.
variableWordSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a word variable subclass of the receiver with the given name, instancevariables (must be ”), class variables, pool dictionaries and category. If theclass is already defined, if necessary, recompile everything needed.
1.32.5 Class: instance creation - alternative
categoriesFor: method are: categoriesDon’t use this, it is only present to file in from IBM Smalltalk
subclass: classNameString classInstanceVariableNames: stringClassInstVarNamesinstanceVariableNames: stringInstVarNames classVariableNames:stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
60 GNU Smalltalk Library Reference
subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableByteSubclass: classNameString classInstanceVariableNames:stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries:stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableByteSubclass: classNameString classVariableNames: stringOfClassVarNamespoolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableLongSubclass: classNameString classInstanceVariableNames:stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries:stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableLongSubclass: classNameString classVariableNames: stringOfClassVarNamespoolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNamesinstanceVariableNames: stringInstVarNames classVariableNames:stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
1.32.6 Class: pragmas
pragmaHandlerFor: aSymbolAnswer the (possibly inherited) registered handler for pragma aSymbol, or nilif not found.
registerHandler: aBlock forPragma: pragmaWhile compiling methods, on every encounter of the pragma with the givenname, call aBlock with the CompiledMethod and an array of pragma argumentvalues.
1.32.7 Class: printing
article Answer an article (‘a’ or ‘an’) which is ok for the receiver’s name
printOn: aStreamPrint a representation of the receiver on aStream
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
Chapter 1: Base classes 61
1.32.8 Class: saving and loading
binaryRepresentationVersionAnswer a number >= 0 which represents the current version of the object’srepresentation. The default implementation answers zero.
convertFromVersion: version withFixedVariables: fixed indexedVariables: indexed for:anObjectDumper
This method is called if a VersionableObjectProxy is attached to a class. Itreceives the version number that was stored for the object (or nil if the objectdid not use a VersionableObjectProxy), the fixed instance variables, the indexedinstance variables, and the ObjectDumper that has read the object. The defaultimplementation ignores the version and simply fills in an instance of the receiverwith the given fixed and indexed instance variables (nil if the class instancesare of fixed size). If instance variables were removed from the class, extras areignored; if the class is now fixed and used to be indexed, indexed is not used.
nonVersionedInstSizeAnswer the number of instance variables that the class used to have whenobjects were stored without using a VersionableObjectProxy. The default im-plementation answers the current instSize.
1.32.9 Class: security
check: aPermissionNot commented.
securityPolicyAnswer ‘securityPolicy’.
securityPolicy: aSecurityPolicyNot commented.
1.32.10 Class: still unclassified
allSharedPoolDictionariesDo: aBlockAnswer the shared pools visible from methods in the metaclass, in the correctsearch order.
fileOutHeaderOn: aFileStreamNot commented.
1.32.11 Class: testing
= aClass Returns true if the two class objects are to be considered equal.
1.32.12 Class: testing functionality
asClass Answer the receiver.
isClass Answer ‘true’.
62 GNU Smalltalk Library Reference
1.33 ClassDescription
Defined in namespace SmalltalkSuperclass: BehaviorCategory: Language-Implementation
My instances provide methods that access classes by category, and allow wholecategories of classes to be filed out to external disk files.
1.33.1 ClassDescription: compiling
compile: code classified: categoryNameCompile code in the receiver, assigning the method to the given category. An-swer the newly created CompiledMethod, or nil if an error was found.
compile: code classified: categoryName ifError: blockCompile method source and install in method category, categoryName. If thereare parsing errors, invoke exception block, ’block’ (see compile:ifError:). Returnthe method
compile: code classified: categoryName notifying: requestorCompile method source and install in method category, categoryName. If thereare parsing errors, send an error message to requestor
1.33.2 ClassDescription: conversion
asClass This method’s functionality should be implemented by subclasses of ClassDe-scription
asMetaclassAnswer the metaclass associated to the receiver
binding Answer a VariableBinding object whose value is the receiver
1.33.3 ClassDescription: copying
copy: selector from: aClassCopy the given selector from aClass, assigning it the same category
copy: selector from: aClass classified: categoryNameCopy the given selector from aClass, assigning it the given category
copyAll: arrayOfSelectors from: classCopy all the selectors in arrayOfSelectors from class, assigning them the samecategory they have in class
copyAll: arrayOfSelectors from: class classified: categoryNameCopy all the selectors in arrayOfSelectors from aClass, assigning them the givencategory
copyAllCategoriesFrom: aClassCopy all the selectors in aClass, assigning them the original category
copyCategory: categoryName from: aClassCopy all the selectors in from aClass that belong to the given category
Chapter 1: Base classes 63
copyCategory: categoryName from: aClass classified: newCategoryNameCopy all the selectors in from aClass that belong to the given category, reclas-sifying them as belonging to the given category
1.33.4 ClassDescription: filing
fileOut: fileNameOpen the given file and to file out a complete class description to it. Requirespackage Parser.
fileOutCategory: categoryName to: fileNameFile out all the methods belonging to the method category, categoryName, tothe fileName file. Requires package Parser.
fileOutOn: aFileStreamFile out complete class description: class definition, class and instance methods.Requires package Parser.
fileOutSelector: selector to: fileNameFile out the given selector to fileName. Requires package Parser.
1.33.5 ClassDescription: organization of messages and classes
classify: aSelector under: aStringPut the method identified by the selector aSelector under the category givenby aString.
createGetMethod: whatCreate a method accessing the variable ‘what’.
createGetMethod: what default: valueCreate a method accessing the variable ‘what’, with a default value of ‘value’,using lazy initialization
createSetMethod: whatCreate a method which sets the variable ‘what’.
defineAsyncCFunc: cFuncNameString withSelectorArgs: selectorAndArgs args:argsArray
See documentation. This function is deprecated, you should use the<asyncCCall: ... > special syntax instead.
defineCFunc: cFuncNameString withSelectorArgs: selectorAndArgs returning:returnTypeSymbol args: argsArray
See documentation. This function is deprecated, you should use the<asyncCCall: ... > special syntax instead.
removeCategory: aStringRemove from the receiver every method belonging to the given category
whichCategoryIncludesSelector: selectorAnswer the category for the given selector, or nil if the selector is not found
64 GNU Smalltalk Library Reference
1.33.6 ClassDescription: parsing class declarations
addSharedPool: aDictionaryAdd the given shared pool to the list of the class’ pool dictionaries
import: aDictionaryAdd the given shared pool to the list of the class’ pool dictionaries
1.33.7 ClassDescription: printing
classVariableStringThis method’s functionality should be implemented by subclasses of ClassDe-scription
instanceVariableStringAnswer a string containing the name of the receiver’s instance variables.
nameIn: aNamespaceAnswer the class name when the class is referenced from aNamespace
printOn: aStream in: aNamespacePrint on aStream the class name when the class is referenced from aNamespace
sharedVariableStringThis method’s functionality should be implemented by subclasses of ClassDe-scription
1.33.8 ClassDescription: still unclassified
fileOutCategory: category toStream: aFileStreamFile out all the methods belonging to the method category, category, toaFileStream. Requires package Parser.
fileOutSelector: aSymbol toStream: aFileStreamFile out all the methods belonging to the method category, category, toaFileStream. Requires package Parser.
1.34 CLong
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.34.1 CLong class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
Chapter 1: Base classes 65
1.34.2 CLong: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.35 CLongDouble
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.35.1 CLongDouble class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.35.2 CLongDouble: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.36 CLongLong
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.36.1 CLongLong class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.36.2 CLongLong: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
66 GNU Smalltalk Library Reference
1.37 CObject
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface
I am not part of the standard Smalltalk kernel class hierarchy. My instancescontain values that are not interpreted by the Smalltalk system; they frequentlyhold "pointers" to data outside of the Smalltalk environment. The C calloutmechanism allows my instances to be transformed into their corresponding Cvalues for use in external routines.
1.37.1 CObject class: conversion
type Nothing special in the default case - answer a CType for the receiver
1.37.2 CObject class: instance creation
address: anIntegerAnswer a new object pointing to the passed address, anInteger
alloc: nBytesAllocate nBytes bytes and return an instance of the receiver
gcAlloc: nBytesAllocate nBytes bytes and return an instance of the receiver
gcNew: nBytesAllocate nBytes bytes and return an instance of the receiver
new Answer a new object pointing to NULL.
new: nBytesAllocate nBytes bytes and return an instance of the receiver
1.37.3 CObject class: primitive allocation
alloc: nBytes type: cTypeObjectAllocate nBytes bytes and return a CObject of the given type
gcAlloc: nBytes type: cTypeObjectAllocate nBytes bytes and return a CObject of the given type
1.37.4 CObject class: subclass creation
inheritShapeAnswer whether subclasses will have by default the same shape as this class.The default is true for the CObject hierarchy.
1.37.5 CObject: accessing
address Answer the address the receiver is pointing to. The address can be absolute ifthe storage is nil, or relative to the Smalltalk object in #storage. In this case,an address of 0 corresponds to the first instance variable.
Chapter 1: Base classes 67
address: anIntegerSet the receiver to point to the passed address, anInteger
isAbsolute Answer whether the object points into a garbage-collected Smalltalk storage,or it is an absolute address.
printOn: aStreamPrint a representation of the receiver
storage Answer the storage that the receiver is pointing into, or nil if the address isabsolute.
storage: anObjectChange the receiver to point to the storage of anObject.
type: aCTypeSet the receiver’s type to aCType.
1.37.6 CObject: basic
= anObjectReturn true if the receiver and aCObject are equal.
hash Return a hash value for anObject.
1.37.7 CObject: C data access
at: byteOffset put: aValue type: aTypeStore aValue as data of the given type from byteOffset bytes after the pointerstored in the receiver
at: byteOffset type: aTypeAnswer some data of the given type from byteOffset bytes after the pointerstored in the receiver
free Free the receiver’s pointer and set it to null. Big trouble hits you if the receiverdoesn’t point to the base of a malloc-ed area.
1.37.8 CObject: conversion
castTo: aTypeAnswer another CObject, pointing to the same address as the receiver, butbelonging to the aType CType.
narrow This method is called on CObjects returned by a C call-out whose return typeis specified as a CType; it mostly allows one to change the class of the returnedCObject. By default it does nothing, and that’s why it is not called when#cObject is used to specify the return type.
type Answer a CType for the receiver
1.37.9 CObject: finalization
finalize To make the VM call this, use #addToBeFinalized. It frees automatically anymemory pointed to by the CObject. It is not automatically enabled becausebig trouble hits you if you use #free and the receiver doesn’t point to the baseof a malloc-ed area.
68 GNU Smalltalk Library Reference
1.37.10 CObject: pointer-like behavior
+ anIntegerReturn another instance of the receiver’s class which points at &re-ceiver[anInteger] (or, if you prefer, what ‘receiver + anInteger’ does inC).
- intOrPtr If intOrPtr is an integer, return another instance of the receiver’s class pointingat &receiver[-anInteger] (or, if you prefer, what ‘receiver - anInteger’ does inC). If it is the same class as the receiver, return the difference in chars, i.e.in bytes, between the two pointed addresses (or, if you prefer, what ‘receiver -anotherCharPtr’ does in C)
addressAt: anIndexReturn a new CObject of the element type, corresponding to an object that isanIndex places past the receiver (remember that CObjects represent pointersand that C pointers behave like arrays). anIndex is zero-based, just like withall other C-style accessing.
at: anIndexDereference a pointer that is anIndex places past the receiver (remember thatCObjects represent pointers and that C pointers behave like arrays). anIndexis zero-based, just like with all other C-style accessing.
at: anIndex put: aValueStore anIndex places past the receiver the passed Smalltalk object or CObject‘aValue’; if it is a CObject is dereferenced: that is, this method is equivalenteither to cobj[anIndex]=aValue or cobj[anIndex]=*aValue. anIndex is zero-based, just like with all other C-style accessing.
In both cases, aValue should be of the element type or of the correspondingSmalltalk type (that is, a String is ok for an array of CStrings) to avoid typingproblems which however will not be signaled because C is untyped.
decr Adjust the pointer by sizeof(dereferencedType) bytes down (i.e. –receiver)
decrBy: anIntegerAdjust the pointer by anInteger elements down (i.e. receiver -= anInteger)
incr Adjust the pointer by sizeof(dereferencedType) bytes up (i.e. ++receiver)
incrBy: anIntegerAdjust the pointer by anInteger elements up (i.e. receiver += anInteger)
1.37.11 CObject: testing
isNull Return true if the receiver points to NULL.
1.37.12 CObject: testing functionality
isCObject Answer ‘true’.
Chapter 1: Base classes 69
1.38 Collection
Defined in namespace SmalltalkSuperclass: IterableCategory: Collections
I am an abstract class. My instances are collections of objects. My subclassesmay place some restrictions or add some definitions to how the objects arestored or organized; I say nothing about this. I merely provide some objectcreation and access routines for general collections of objects.
1.38.1 Collection class: instance creation
from: anArrayConvert anArray to an instance of the receiver. anArray is structured suchthat the instance can be conveniently and fully specified using brace-syntax,possibly by imposing some additional structure on anArray.
join: aCollectionAnswer a collection formed by treating each element in aCollection as a‘withAll:’ argument collection to be added to a new instance.
with: anObjectAnswer a collection whose only element is anObject
with: firstObject with: secondObjectAnswer a collection whose only elements are the parameters in the order theywere passed
with: firstObject with: secondObject with: thirdObjectAnswer a collection whose only elements are the parameters in the order theywere passed
with: firstObject with: secondObject with: thirdObject with: fourthObjectAnswer a collection whose only elements are the parameters in the order theywere passed
with: firstObject with: secondObject with: thirdObject with: fourthObject with:fifthObject
Answer a collection whose only elements are the parameters in the order theywere passed
withAll: aCollectionAnswer a collection whose elements are all those in aCollection
1.38.2 Collection class: multibyte encodings
isUnicode Answer true; the receiver is able to store arbitrary Unicode characters.
1.38.3 Collection: adding
add: newObjectAdd newObject to the receiver, answer it
addAll: aCollectionAdds all the elements of ’aCollection’ to the receiver, answer aCollection
70 GNU Smalltalk Library Reference
1.38.4 Collection: compiler
literalEquals: anObjectNot commented.
literalHashNot commented.
1.38.5 Collection: concatenating
join Answer a new collection like my first element, with all the elements (in order)of all my elements, which should be collections.
I use my first element instead of myself as a prototype because my elements aremore likely to share the desired properties than I am, such as in:
#(’hello, ’ ’world’) join => ’hello, world’
1.38.6 Collection: converting
asArray Answer an Array containing all the elements in the receiver
asBag Answer a Bag containing all the elements in the receiver
asByteArrayAnswer a ByteArray containing all the elements in the receiver
asOrderedCollectionAnswer an OrderedCollection containing all the elements in the receiver
asRunArrayAnswer the receiver converted to a RunArray. If the receiver is not ordered theorder of the elements in the RunArray might not be the #do: order.
asSet Answer a Set containing all the elements in the receiver with no duplicates
asSortedCollectionAnswer a SortedCollection containing all the elements in the receiver with thedefault sort block - [ :a :b | a <= b ]
asSortedCollection: aBlockAnswer a SortedCollection whose elements are the elements of the receiver,sorted according to the sort block aBlock
asString Answer a String containing all the elements in the receiver
asUnicodeStringAnswer a UnicodeString containing all the elements in the receiver
1.38.7 Collection: copying Collections
copyReplacing: targetObject withObject: newObjectCopy replacing each object which is = to targetObject with newObject
copyWith: newElementAnswer a copy of the receiver to which newElement is added
copyWithout: oldElementAnswer a copy of the receiver to which all occurrences of oldElement are re-moved
Chapter 1: Base classes 71
1.38.8 Collection: copying SequenceableCollections
, anIterableAppend anIterable at the end of a copy of the receiver (using #add:), andanswer a new collection
1.38.9 Collection: enumeration
anyOne Answer an unspecified element of the collection.
beConsistentThis method is private, but it is quite interesting so it is documented. Itensures that a collection is in a consistent state before attempting to iterate onit; its presence reduces the number of overrides needed by collections who tryto amortize their execution times. The default implementation does nothing,so it is optimized out by the virtual machine and so it loses very little on theperformance side. Note that descendants of Collection have to call it explicitlysince #do: is abstract in Collection.
collect: aBlockAnswer a new instance of a Collection containing all the results of evaluatingaBlock passing each of the receiver’s elements
gather: aBlockAnswer a new instance of a Collection containing all the results of evaluatingaBlock, joined together. aBlock should return collections. The result is thesame kind as the first collection, returned by aBlock (as for #join).
readStreamAnswer a stream that gives elements of the receiver
reject: aBlockAnswer a new instance of a Collection containing all the elements in the receiverwhich, when passed to aBlock, don’t answer true
select: aBlockAnswer a new instance of a Collection containing all the elements in the receiverwhich, when passed to aBlock, answer true
1.38.10 Collection: finalization
mourn: anObjectPrivate - anObject has been found to have a weak key, remove it and possiblyfinalize the key.
1.38.11 Collection: printing
displayLinesPrint each element of the receiver to a line on standard output.
examineOn: aStreamPrint all the instance variables and objects in the receiver on aStream
printOn: aStreamPrint a representation of the receiver on aStream
72 GNU Smalltalk Library Reference
1.38.12 Collection: removing
empty Remove everything from the receiver.
remove: oldObjectRemove oldObject from the receiver. If absent, fail, else answer oldObject.
remove: oldObject ifAbsent: anExceptionBlockRemove oldObject from the receiver. If absent, evaluate anExceptionBlock andanswer the result, else answer oldObject.
removeAll: aCollectionRemove each object in aCollection, answer aCollection, fail if some of them isabsent. Warning: this could leave the collection in a semi-updated state.
removeAll: aCollection ifAbsent: aBlockRemove each object in aCollection, answer aCollection; if some element is ab-sent, pass it to aBlock.
removeAllSuchThat: aBlockRemove from the receiver all objects for which aBlock returns true.
1.38.13 Collection: sorting
sorted Return a sequenceable collection with the contents of the receiver sorted ac-cording to the default sort block, which uses #<= to compare items.
sorted: sortBlockReturn a sequenceable collection with the contents of the receiver sorted ac-cording to the given sort block, which accepts pair of items and returns true ifthe first item is less than the second one.
1.38.14 Collection: storing
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.38.15 Collection: testing collections
capacity Answer how many elements the receiver can hold before having to grow.
identityIncludes: anObjectAnswer whether we include the anObject object
includes: anObjectAnswer whether we include anObject
includesAllOf: aCollectionAnswer whether we include all of the objects in aCollection
includesAnyOf: aCollectionAnswer whether we include any of the objects in aCollection
isEmpty Answer whether we are (still) empty
Chapter 1: Base classes 73
isSequenceableAnswer whether the receiver can be accessed by a numeric index with #at:/-#at:put:.
notEmpty Answer whether we include at least one object
occurrencesOf: anObjectAnswer how many occurrences of anObject we include
size Answer how many objects we include
1.39 CompiledBlock
Defined in namespace SmalltalkSuperclass: CompiledCodeCategory: Language-Implementation
I represent a block that has been compiled.
1.39.1 CompiledBlock class: instance creation
new: numBytecodes header: anInteger method: outerMethodAnswer a new instance of the receiver with room for the given number of byte-codes and the given header.
numArgs: args numTemps: temps bytecodes: bytecodes depth: depth literals:literalArray
Answer an (almost) full fledged CompiledBlock. To make it complete, you musteither set the new object’s ‘method’ variable, or put it into a BlockClosure andput the BlockClosure into a CompiledMethod’s literals. The clean-ness of theblock is automatically computed.
1.39.2 CompiledBlock: accessing
flags Answer the ‘cleanness’ of the block. 0 = clean; 1 = access to receiver variablesand/or self; 2-30 = access to variables that are 1-29 contexts away; 31 = returnfrom method or push thisContext
method Answer the CompiledMethod in which the receiver lies
methodClassAnswer the class in which the receiver is installed.
methodClass: methodClassSet the receiver’s class instance variable
numArgs Answer the number of arguments passed to the receiver
numLiteralsAnswer the number of literals for the receiver
numTempsAnswer the number of temporary variables used by the receiver
selector Answer the selector through which the method is called
74 GNU Smalltalk Library Reference
selector: aSymbolSet the selector through which the method is called
sourceCodeLinesDeltaAnswer the delta from the numbers in LINE NUMBER bytecodes to sourcecode line numbers.
sourceCodeMapAnswer an array which maps bytecode indices to source code line numbers. 0values represent invalid instruction pointer indices.
stackDepthAnswer the number of stack slots needed for the receiver
1.39.3 CompiledBlock: basic
= aMethodAnswer whether the receiver and aMethod are equal
methodCategoryAnswer the method category
methodCategory: aCategorySet the method category to the given string
methodSourceCodeAnswer the method source code (a FileSegment or String or nil)
methodSourceFileAnswer the file where the method source code is stored
methodSourcePosAnswer the location where the method source code is stored in the method-SourceFile
methodSourceStringAnswer the method source code as a string
1.39.4 CompiledBlock: printing
printOn: aStreamPrint the receiver’s class and selector on aStream
1.39.5 CompiledBlock: saving and loading
binaryRepresentationObjectThis method is implemented to allow for a PluggableProxy to be used withCompiledBlocks. Answer a DirectedMessage which sends #blockAt: to theCompiledMethod containing the receiver.
Chapter 1: Base classes 75
1.40 CompiledCode
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Language-Implementation
I represent code that has been compiled. I am an abstract superclass for blocksand methods
1.40.1 CompiledCode class: cache flushing
flushTranslatorCacheAnswer any kind of cache mantained by a just-in-time code translator in thevirtual machine (if any). Do nothing for now.
1.40.2 CompiledCode class: instance creation
new: numBytecodes header: anInteger literals: literalsAnswer a new instance of the receiver with room for the given number of byte-codes and the given header
new: numBytecodes header: anInteger numLiterals: numLiteralsAnswer a new instance of the receiver with room for the given number of byte-codes and the given header
1.40.3 CompiledCode class: tables
bytecodeInfoTableReturn a ByteArray which defines some properties of the bytecodes. For eachbytecode, 4 bytes are reserved. The fourth byte is a flag byte: bit 7 means thatthe argument is a line number to be used in creating the bytecode->line numbermap.
The first three have a meaning only for those bytecodes that represent a com-bination of operations: the combination can be BC1 ARG BC2 OPERAND ifthe fourth byte’s bit 0 = 0 or BC1 OPERAND BC2 ARG if the fourth byte’sbit 0 = 1
where BC1 is the first byte, BC2 is the second, ARG is the third and OPERANDis the bytecode argument as it appears in the bytecode stream.
specialSelectorsAnswer an array of message names that don’t need to be in literals to be sentin a method. Their position here reflects their integer code in bytecode.
specialSelectorsNumArgsAnswer a harmoniously-indexed array of arities for the messages answered by#specialSelectors.
1.40.4 CompiledCode: accessing
at: anIndex put: aBytecodeStore aBytecode as the anIndex-th bytecode
76 GNU Smalltalk Library Reference
blockAt: anIndexAnswer the CompiledBlock attached to the anIndex-th literal, assuming thatthe literal is a CompiledBlock or a BlockClosure.
bytecodeAt: anIndexAnswer the anIndex-th bytecode
bytecodeAt: anIndex put: aBytecodeStore aBytecode as the anIndex-th bytecode
flags Private - Answer the optimization flags for the receiver
isAnnotatedAnswer ‘false’.
literalAt: anIndexAnswer the anIndex-th literal
literalAt: anInteger put: aValueStore aValue as the anIndex-th literal
literals Answer the literals referenced by my code or any CompiledCode instances Iown.
method Answer the parent method for the receiver, or self if it is a method.
methodClassAnswer the class in which the receiver is installed.
methodClass: methodClassSet the receiver’s class instance variable
numArgs Answer the number of arguments for the receiver
numLiteralsAnswer the number of literals for the receiver
numTempsAnswer the number of temporaries for the receiver
primitive Answer the primitive called by the receiver
selector Answer the selector through which the method is called
selector: aSymbolSet the selector through which the method is called
sourceCodeLinesDeltaAnswer the delta from the numbers in LINE NUMBER bytecodes to sourcecode line numbers.
stackDepthAnswer the number of stack slots needed for the receiver
Chapter 1: Base classes 77
1.40.5 CompiledCode: basic
= aMethodAnswer whether the receiver is the same object as arg. Testing for equalitycould break the browser, since it’s possible to put arbitrary objects via ##(...),so this is safer.
hash Answer an hash value for the receiver
methodCategoryAnswer the method category
methodCategory: aCategorySet the method category to the given string
methodSourceCodeAnswer the method source code (a FileSegment or String or nil)
methodSourceFileAnswer the file where the method source code is stored
methodSourcePosAnswer the location where the method source code is stored in the method-SourceFile
methodSourceStringAnswer the method source code as a string
1.40.6 CompiledCode: copying
deepCopy Answer a deep copy of the receiver
1.40.7 CompiledCode: debugging
examineOn: aStreamPrint the contents of the receiver in a verbose way.
1.40.8 CompiledCode: decoding bytecodes
dispatchTo: anObject with: paramDisassemble the bytecodes and tell anObject about them in the form of messagesends. param is given as an argument to every message send.
1.40.9 CompiledCode: literals - iteration
allLiteralSymbolsDo: aBlockAs with #allLiteralsDo:, but only call aBlock with found Symbols.
allLiteralsDo: aBlockWalk my literals, descending into Arrays and Messages, invoking aBlock witheach touched object.
literalsDo: aBlockInvoke aBlock with each object immediately in my list of literals.
78 GNU Smalltalk Library Reference
1.40.10 CompiledCode: security
verify Verify the bytecodes for the receiver, and raise an exception if the verificationprocess failed.
1.40.11 CompiledCode: testing accesses
accesses: instVarIndexAnswer whether the receiver accesses the instance variable with the given index
assigns: instVarIndexAnswer whether the receiver writes to the instance variable with the given index
containsLiteral: anObjectAnswer if the receiver contains a literal which is equal to anObject.
hasBytecode: byte between: firstIndex and: lastIndexAnswer whether the receiver includes the ‘byte’ bytecode in any of the indicesbetween firstIndex and lastIndex.
jumpDestinationAt: anIndex forward: aBooleanAnswer where the jump at bytecode index ‘anIndex’ lands
reads: instVarIndexAnswer whether the receiver reads the instance variable with the given index
refersTo: anObjectAnswer whether the receiver refers to the given object
sendsToSuperAnswer whether the receiver includes a send to super.
sourceCodeMapAnswer an array which maps bytecode indices to source code line numbers. 0values represent invalid instruction pointer indices.
1.40.12 CompiledCode: translation
discardTranslationFlush the just-in-time translated code for the receiver (if any).
1.41 CompiledMethod
Defined in namespace SmalltalkSuperclass: CompiledCodeCategory: Language-Implementation
I represent methods that have been compiled. I can recompile methods fromtheir source code, I can invoke Emacs to edit the source code for one of myinstances, and I know how to access components of my instances.
1.41.1 CompiledMethod class: c call-outs
asyncCCall: descr numArgs: numArgs attributes: attributesArrayReturn a CompiledMethod corresponding to a #asyncCCall:args: pragma withthe given arguments.
Chapter 1: Base classes 79
cCall: descr numArgs: numArgs attributes: attributesArrayReturn a CompiledMethod corresponding to a #cCall:returning:args: pragmawith the given arguments.
1.41.2 CompiledMethod class: instance creation
literals: lits numArgs: numArg numTemps: numTemp attributes: attrArray bytecodes:bytecodes depth: depth
Answer a full fledged CompiledMethod. Construct the method header from theparameters, and set the literals and bytecodes to the provided ones. Also, thebytecodes are optimized and any embedded CompiledBlocks modified to referto these literals and to the newly created CompiledMethod.
numArgs: argsCreate a user-defined method (one that is sent #valueWithReceiver:-withArguments: when it is invoked) with numArgs arguments. This onlymakes sense when called for a subclass of CompiledMethod.
1.41.3 CompiledMethod class: lean images
stripSourceCodeRemove all the references to method source code from the system
1.41.4 CompiledMethod: accessing
allBlocksDo: aBlockEvaluate aBlock, passing to it all the CompiledBlocks it holds
allLiterals Answer the literals referred to by the receiver and all the blocks in it
flags Private - Answer the optimization flags for the receiver
isOldSyntaxAnswer whether the method was written with the old (chunk-format) syntax
method Answer the receiver, since it is already a method.
methodCategoryAnswer the method category
methodCategory: aCategorySet the method category to the given string
methodClassAnswer the class in which the receiver is installed.
methodClass: methodClassSet the receiver’s class instance variable
noteOldSyntaxRemember that the method is written with the old (chunk-format) syntax
numArgs Answer the number of arguments for the receiver
numTempsAnswer the number of temporaries for the receiver
80 GNU Smalltalk Library Reference
primitive Answer the primitive called by the receiver
selector Answer the selector through which the method is called
selector: aSymbolSet the selector through which the method is called
sourceCodeLinesDeltaAnswer the delta from the numbers in LINE NUMBER bytecodes to sourcecode line numbers.
stackDepthAnswer the number of stack slots needed for the receiver
withAllBlocksDo: aBlockEvaluate aBlock, passing the receiver and all the CompiledBlocks it holds
withNewMethodClass: classAnswer either the receiver or a copy of it, with the method class set to class
withNewMethodClass: class selector: selectorAnswer either the receiver or a copy of it, with the method class set to class
1.41.5 CompiledMethod: attributes
attributeAt: aSymbolReturn a Message for the first attribute named aSymbol defined by the receiver,or answer an error if none was found.
attributeAt: aSymbol ifAbsent: aBlockReturn a Message for the first attribute named aSymbol defined by the receiver,or evaluate aBlock is none was found.
attributes Return an Array of Messages, one for each attribute defined by the receiver.
attributesDo: aBlockEvaluate aBlock once for each attribute defined by the receiver, passing a Mes-sage each time.
isAnnotatedIf the receiver has any attributes, answer true.
primitiveAttributeIf the receiver defines a primitive, return a Message resembling the attributethat was used to define it.
1.41.6 CompiledMethod: basic
= aMethodAnswer whether the receiver and aMethod are equal
hash Answer an hash value for the receiver
Chapter 1: Base classes 81
1.41.7 CompiledMethod: c call-outs
isValidCCallAnswer whether I appear to have the valid flags, information, and ops to invokea C function and answer its result.
rewriteAsAsyncCCall: func args: argsArrayNot commented.
rewriteAsCCall: funcOrDescr for: aClassNot commented.
rewriteAsCCall: func returning: returnType args: argsArrayNot commented.
1.41.8 CompiledMethod: compiling
methodFormattedSourceStringAnswer the method source code as a string, formatted using the RBFormatter.Requires package Parser.
methodParseNodeAnswer the parse tree for the receiver, or nil if there is an error. Requirespackage Parser.
parserClassAnswer a parser class, similar to Behavior>>parserClass, that can parse mysource code. Requires package Parser.
recompile Recompile the method in the scope of the class where it leaves.
recompileNotifying: aNotifierRecompile the method in the scope of the class where it leaves, notifying errorsto aNotifier by sending it #error:.
1.41.9 CompiledMethod: invoking
valueWithReceiver: anObject withArguments: argsExecute the method within anObject, passing the elements of the args Array asparameters. The method need not reside on the hierarchy from the receiver’sclass to Object – it need not reside at all in a MethodDictionary, in fact – butdoing bad things will compromise stability of the Smalltalk virtual machine(and don’t blame anybody but yourself).
If the flags field of the method header is 6, this method instead provides a hookfrom which the virtual machine can call back whenever execution of the methodis requested. In this case, invoking the method would cause an infinite loop (theVM asks the method to run, the method asks the VM to invoke it, and so on),so this method fails with a #subclassResponsibility error.
1.41.10 CompiledMethod: printing
printOn: aStreamPrint the receiver’s class and selector on aStream
82 GNU Smalltalk Library Reference
storeOn: aStreamPrint code to create the receiver on aStream
1.41.11 CompiledMethod: saving and loading
binaryRepresentationObjectThis method is implemented to allow for a PluggableProxy to be used withCompiledMethods. Answer a DirectedMessage which sends #>> to the classobject containing the receiver.
1.41.12 CompiledMethod: source code
methodRecompilationSourceStringAnswer the method source code as a string, ensuring that it is in new syntax(it has brackets).
methodSourceCodeAnswer the method source code (a FileSegment or String or nil)
methodSourceFileAnswer the file where the method source code is stored
methodSourcePosAnswer the location where the method source code is stored in the method-SourceFile
methodSourceStringAnswer the method source code as a string
1.41.13 CompiledMethod: testing
accesses: instVarIndexAnswer whether the receiver or the blocks it contains accesses the instancevariable with the given index
assigns: instVarIndexAnswer whether the receiver or the blocks it contains writes to the instancevariable with the given index
isAbstract Answer whether the receiver is abstract.
reads: instVarIndexAnswer whether the receiver or the blocks it contains reads to the instancevariable with the given index
sendsToSuperAnswer whether the receiver or the blocks it contains have sends to super
Chapter 1: Base classes 83
1.42 ContextPart
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
My instances represent executing Smalltalk code, which represent the localenvironment of executable code. They contain a stack and also provide somemethods that can be used in inspection or debugging.
1.42.1 ContextPart class: built ins
thisContextReturn the value of the thisContext variable. Called internally when the vari-able is accessed.
1.42.2 ContextPart class: exception handling
backtrace Print a backtrace from the caller to the bottom of the stack on the Transcript
backtraceOn: aStreamPrint a backtrace from the caller to the bottom of the stack on aStream
1.42.3 ContextPart: accessing
at: index Answer the index-th slot in the receiver. Any read access from (self size + 1) to(self basicSize) will give nil.
at: index put: anObjectAnswer the index-th slot in the receiver. Any write access from (self size + 1)to (self basicSize) will give an error unless nil is being written. This is becausedoing such an access first, and then updating sp, is racy: the garbage collectormay trigger in the middle and move anObject, but the slot in the context won’tbe adjusted.
client Answer the client of this context, that is, the object that sent the message thatcreated this context. Fail if the receiver has no parent
currentFileNameAnswer the name of the file where the method source code is
environmentTo create a valid execution environment for the interpreter even before it starts,GST creates a fake context whose selector is nil and which can be used asa marker for the current execution environment. This method answers thatcontext. For processes, it answers the process block itself
home Answer the MethodContext to which the receiver refers
initialIP Answer the value of the instruction pointer when execution starts in the currentcontext
ip Answer the current instruction pointer into the receiver
ip: newIP Set the instruction pointer for the receiver
84 GNU Smalltalk Library Reference
isBlock Answer whether the receiver is a block context
isDisabled Answers whether the context is skipped when doing a return. Contexts aremarked as disabled whenever a non-local return is done (either by returningfrom the enclosing method of a block, or with the #continue: method of Con-textPart) and there are unwind contexts such as those created by #ensure:. Allnon-unwind contexts are then marked as disabled.
isEnvironmentTo create a valid execution environment for the interpreter even before it starts,GST creates a fake context which invokes a special “termination” method.Such a context can be used as a marker for the current execution environment.Answer whether the receiver is that kind of context.
isProcess Answer whether the receiver represents a process context, i.e. a context createdby BlockClosure>>#newProcess. Such a context can be recognized because ithas no parent but its flags are different from those of the contexts created bythe VM’s prepareExecutionEnvironment function.
isUnwind Answers whether the context must continue execution even after a non-local re-turn (a return from the enclosing method of a block, or a call to the #continue:method of ContextPart). Such contexts are created by #ensure:.
method Return the CompiledMethod being executed
methodClassReturn the class in which the CompiledMethod being executed is defined
numArgs Answer the number of arguments passed to the receiver
numTempsAnswer the number of temporaries used by the receiver
parentContextAnswer the context that called the receiver
parentContext: aContextSet the context to which the receiver will return
push: anObjectPush an object on the receiver’s stack.
receiver Return the receiver (self) for the method being executed
selector Return the selector for the method being executed
size Answer the number of valid fields for the receiver. Any read access from (selfsize + 1) to (self basicSize) will give nil.
sp Answer the current stack pointer into the receiver
sp: newSPSet the stack pointer for the receiver.
validSize Answer how many elements in the receiver should be inspected
Chapter 1: Base classes 85
1.42.4 ContextPart: built ins
continue: anObjectResume execution from the receiver, faking that the context on top of it in theexecution chain has returned anObject. The receiver must belong to the sameprocess as the executing context, otherwise the results are not predictable. All#ensure: (and possibly #ifCurtailed:) blocks between the currently executingcontext and the receiver are evaluated (which is not what would happen if youdirectly bashed at the parent context of thisContext).
1.42.5 ContextPart: copying
copyStack Answer a copy of the entire stack.
deepCopy Answer a copy of the entire stack, but don’t copy any of the other instancevariables of the context.
1.42.6 ContextPart: debugging
currentLineAnswer the 1-based number of the line that is pointed to by the receiver’sinstruction pointer. The DebugTools package caches information, thus makingthe implementation faster.
currentLineInFileAnswer the 1-based number of the line that is pointed to by the receiver’sinstruction pointer, relative to the method’s file. The implementation is slowunless the DebugTools package is loaded.
debugger Answer the debugger that is attached to the given context. It is always nilunless the DebugTools package is loaded.
debuggerClassAnswer which debugger should be used to debug the current context chain. Theclass with the highest debugging priority is picked among those mentioned inthe chain.
isInternalExceptionHandlingContextAnswer whether the receiver is a context that should be hidden to the userwhen presenting a backtrace.
1.42.7 ContextPart: enumerating
scanBacktraceFor: selectors do: aBlockScan the backtrace for contexts whose selector is among those listed in selectors;if one is found, invoke aBlock passing the context.
scanBacktraceForAttribute: selector do: aBlockScan the backtrace for contexts which have the attribute selector listed in se-lectors; if one is found, invoke aBlock passing the context and the attribute.
86 GNU Smalltalk Library Reference
1.42.8 ContextPart: printing
backtrace Print a backtrace from the receiver to the bottom of the stack on the Transcript.
backtraceOn: aStreamPrint a backtrace from the caller to the bottom of the stack on aStream.
1.42.9 ContextPart: security checks
checkSecurityFor: permAnswer the receiver.
doSecurityCheckForName: name actions: actions target: targetNot commented.
securityCheckForName: nameNot commented.
securityCheckForName: name action: actionNot commented.
securityCheckForName: name actions: actions target: targetNot commented.
securityCheckForName: name target: targetNot commented.
1.43 Continuation
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
At my heart, I am something like the goto instruction; my creation sets thelabel, and my methods do the jump. However, this is a really powerful kindof goto instruction. If your hair is turning green at this point, don’t worry asyou will probably only deal with users of continuations, rather than with theconcept itself.
1.43.1 Continuation class: instance creation
current Return a continuation.
currentDo: aBlockPass a continuation to the one-argument block, aBlock and return the result ofevaluating it.
escapeDo: aBlockPass a continuation to the one-argument block, knowing that aBlock does notfall off (either because it includes a method return, or because it yields controlto another continuation). If it does, an exception will be signalled and thecurrent process terminated.
Chapter 1: Base classes 87
1.43.2 Continuation: invocation
callCC Activate the original continuation, passing back in turn a continuation for thecaller. The called continuation becomes unusable, and any attempt to reactivateit will cause an exception. This is not a limitation, in general, because thismethod is used to replace a continuation with another (see the implementationof the Generator class).
oneShotValueReturn nil to the original continuation, which becomes unusable. Attemptingto reactivate it will cause an exception. This is an optimization over #value.
oneShotValue: vReturn anObject to the original continuation, which becomes unusable. At-tempting to reactivate it will cause an exception. This is an optimization over#value:.
value Return nil to the original continuation, copying the stack to allow anotheractivation.
value: anObjectReturn anObject to the original continuation, copying the stack to allow anotheractivation.
valueWithArguments: aCollectionReturn the sole element of aCollection to the original continuation (or nil ifaCollection is empty), copying the stack to allow another activation
1.44 CPtr
Defined in namespace SmalltalkSuperclass: CAggregateCategory: Language-C interface
1.44.1 CPtr: accessing
alignof Answer the receiver’s required aligment
sizeof Answer the receiver’s size
value Answer the address of the location pointed to by the receiver.
value: anObjectSet the address of the location pointed to by the receiver to anObject, whichcan be either an Integer or a CObject. if anObject is an Integer, it is interpretedas a 32-bit or 64-bit address. If it is a CObject, its address is stored.
1.45 CPtrCType
Defined in namespace SmalltalkSuperclass: CTypeCategory: Language-C interface
88 GNU Smalltalk Library Reference
1.45.1 CPtrCType class: instance creation
elementType: aCTypeAnswer a new instance of CPtrCType that maps pointers to the given CType
from: typePrivate - Called by computeAggregateType: for pointers
1.45.2 CPtrCType: accessing
elementTypeAnswer the type of the elements in the receiver’s instances
1.45.3 CPtrCType: basic
= anObjectReturn whether the receiver and anObject are equal.
hash Return a hash code for the receiver.
1.45.4 CPtrCType: storing
storeOn: aStreamNot commented.
1.46 CScalar
Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface
1.46.1 CScalar class: instance creation
gcValue: anObjectAnswer a newly allocated CObject containing the passed value, anObject, ingarbage-collected storage.
type Answer a CType for the receiver—for example, CByteType if the receiver isCByte.
value: anObjectAnswer a newly allocated CObject containing the passed value, anObject. Re-member to call #addToBeFinalized if you want the CObject to be automaticallyfreed
1.46.2 CScalar: accessing
cObjStoredTypePrivate - Provide a conversion from a CObject to a Smalltalk object to bestored by #at:put:
value Answer the value the receiver is pointing to. The exact returned value dependson the receiver’s class
Chapter 1: Base classes 89
value: aValueSet the receiver to point to the value, aValue. The exact meaning of aValuedepends on the receiver’s class
1.47 CScalarCType
Defined in namespace SmalltalkSuperclass: CTypeCategory: Language-C interface
1.47.1 CScalarCType: accessing
valueType valueType is used as a means to communicate to the interpreter the underlyingtype of the data. For scalars, it is supplied by the CObject subclass.
1.47.2 CScalarCType: storing
storeOn: aStreamStore Smalltalk code that compiles to the receiver
1.48 CShort
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.48.1 CShort class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.48.2 CShort: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.49 CSmalltalk
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
90 GNU Smalltalk Library Reference
1.49.1 CSmalltalk class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.49.2 CSmalltalk: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.50 CString
Defined in namespace SmalltalkSuperclass: CPtrCategory: Language-C interface
Technically, CString is really a pointer to CChar. However, it can be veryuseful as a distinct datatype because it is a separate datatype in Smalltalk, sowe allow developers to express their semantics more precisely by using a moredescriptive type.
Note that like CChar is a pointer to char, CString is actually a *pointer* tostring: a char ** in C terms. If you need to take a String out of a char *, useCChar>>#asString.
In general, I behave like a cross between an array of characters and a pointerto a character. I provide the protocol for both data types. My #value methodreturns a Smalltalk String, as you would expect for a scalar datatype.
1.50.1 CString class: accessing
cObjStoredTypePrivate - Provide a conversion from a CObject to a Smalltalk object to bestored by #at:put:
1.50.2 CString class: instance creation
type Answer a CType for the receiver—for example, CByteType if the receiver isCByte.
value: anObjectAnswer a newly allocated CObject containing the passed value, anObject. Re-member to call #addToBeFinalized if you want the CObject to be automaticallyfreed
Chapter 1: Base classes 91
1.50.3 CString: accessing
cObjStoredTypePrivate - Provide a conversion from a CObject to a Smalltalk object to bestored by #at:put:
value Answer the value the receiver is pointing to. The exact returned value dependson the receiver’s class
value: aValueSet the receiver to point to the value, aValue. The exact meaning of aValuedepends on the receiver’s class
1.51 CStringCType
Defined in namespace SmalltalkSuperclass: CScalarCTypeCategory: Language-C interface
1.51.1 CStringCType: accessing
elementTypeAnswer the type of the elements in the receiver’s instances
1.52 CStruct
Defined in namespace SmalltalkSuperclass: CCompoundCategory: Language-C interface
1.52.1 CStruct class: subclass creation
declaration: arrayCompile methods that implement the declaration in array.
1.53 CType
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface
I am not part of the standard Smalltalk kernel class hierarchy. I contain typeinformation used by subclasses of CObject, which represents external C dataitems.
My only instance variable, cObjectType, is used to hold onto the CObjectsubclass that gets created for a given CType. Used primarily in the C part ofthe interpreter because internally it cannot execute methods to get values, so ithas a simple way to access instance variable which holds the desired subclass.
My subclasses have instances which represent the actual data types; for thescalar types, there is only one instance created of each, but for the aggregatetypes, there is at least one instance per base type and/or number of elements.
92 GNU Smalltalk Library Reference
1.53.1 CType class: C instance creation
cObjectBinding: aCObjectSubclassBindingCreate a new CType for the given subclass of CObject
cObjectType: aCObjectSubclassCreate a new CType for the given subclass of CObject
computeAggregateType: typePrivate - Called by from: for pointers/arrays. Format of type: (#array #int3) or (#ptr #{FooStruct})
from: typePrivate - Pass the size, alignment, and description of CType for aBlock, giventhe field description in ‘type’ (the second element of each pair).
1.53.2 CType class: initialization
initialize Initialize the receiver’s TypeMap
1.53.3 CType: accessing
alignof Answer the size of the receiver’s instances
arrayType: sizeAnswer a CArrayCType which represents an array with the given size of COb-jects whose type is in turn represented by the receiver
cObjectTypeAnswer the CObject subclass whose instance is created when new is sent to thereceiver
new: anIntegerAllocate a new CObject with room for anInteger C objects of the type (class)identified by the receiver. It is the caller’s responsibility to free the memoryallocated for it.
ptrType Answer a CPtrCType which represents a pointer to CObjects whose type is inturn represented by the receiver
sizeof Answer the size of the receiver’s instances
valueType valueType is used as a means to communicate to the interpreter the underlyingtype of the data. For anything but scalars, it’s just ’self’
1.53.4 CType: basic
= anObjectReturn whether the receiver and anObject are equal.
hash Return a hash code for the receiver.
Chapter 1: Base classes 93
1.53.5 CType: C instance creation
address: cObjOrIntCreate a new CObject with the type (class) identified by the receiver, pointingto the given address (identified by an Integer or CObject).
gcNew Allocate a new CObject with the type (class) identified by the receiver. Theobject is movable in memory, but on the other hand it is garbage-collectedautomatically.
gcNew: anIntegerAllocate a new CObject with room for anInteger C object of the type (class)identified by the receiver. The object is movable in memory, but on the otherhand it is garbage-collected automatically.
new Allocate a new CObject with the type (class) identified by the receiver. It isthe caller’s responsibility to free the memory allocated for it.
1.53.6 CType: storing
storeOn: aStreamStore Smalltalk code that compiles to the receiver
1.54 CUChar
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.54.1 CUChar class: getting info
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.54.2 CUChar: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.55 CUInt
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
94 GNU Smalltalk Library Reference
1.55.1 CUInt class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.55.2 CUInt: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.56 CULong
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.56.1 CULong class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.56.2 CULong: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.57 CULongLong
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.57.1 CULongLong class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
Chapter 1: Base classes 95
1.57.2 CULongLong: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.58 CUnion
Defined in namespace SmalltalkSuperclass: CCompoundCategory: Language-C interface
1.58.1 CUnion class: subclass creation
declaration: arrayCompile methods that implement the declaration in array.
1.59 CUShort
Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface
1.59.1 CUShort class: accessing
alignof Answer the receiver’s instances required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s instances scalar type
sizeof Answer the receiver’s instances size
1.59.2 CUShort: accessing
alignof Answer the receiver’s required aligment
cObjStoredTypePrivate - Answer an index referring to the receiver’s scalar type
sizeof Answer the receiver’s size
1.60 Date
Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types
My instances represent dates. My base date is defined to be Jan 1, 1901. Iprovide methods for instance creation (including via "symbolic" dates, such as"Date newDay: 14 month: #Feb year: 1990".
96 GNU Smalltalk Library Reference
PLEASE BE WARNED – use this class only for dates after 1582 AD; that’s thebeginning of the epoch. Dates before 1582 will not be correctly printed. In ad-dition, since ten days were lost from October 5 through October 15, operationsbetween a Gregorian date (after 15-Oct-1582) and a Julian date (before 5-Oct-1582) will give incorrect results; or, 4-Oct-1582 + 2 days will yield 6-Oct-1582(a non-existent day!), not 16-Oct-1582.
In fact, if you pass a year < 1582 to a method like #newDay:month:year: it willassume that it is a two-digit year (e.g. 90=1990, 1000=2900). The only way tocreate Julian calendar dates is with the #fromDays: instance creation method.
1.60.1 Date class: basic
abbreviationOfDay: dayIndexAnswer the abbreviated name of the day of week corresponding to the givenindex
dayOfWeek: dayNameAnswer the index of the day of week corresponding to the given name
daysInMonth: monthName forYear: yearIntegerAnswer the number of days in the given (named) month for the given year
daysInYear: iAnswer the number of days in the given year
indexOfMonth: monthNameAnswer the index of the month corresponding to the given name
initDayNameDictInitialize the DayNameDict to the names of the days
initMonthNameDictInitialize the MonthNameDict to the names of the months
initialize Initialize the receiver
nameOfDay: dayIndexAnswer the name of the day of week corresponding to the given index
nameOfMonth: monthIndexAnswer the name of the month corresponding to the given index
shortNameOfMonth: monthIndexAnswer the name of the month corresponding to the given index
1.60.2 Date class: instance creation (ANSI)
year: y day: d hour: h minute: min second: sAnswer a Date denoting the d-th day of the given year
year: y month: m day: d hour: h minute: min second: sAnswer a Date denoting the d-th day of the given (as a number) month andyear
Chapter 1: Base classes 97
1.60.3 Date class: instance creation (Blue Book)
dateAndTimeNowAnswer an array containing the current date and time
fromDays: dayCountAnswer a Date denoting dayCount days past 1/1/1901
fromJulian: jdAnswer a Date denoting the jd-th day in the astronomical Julian calendar.
fromSeconds: timeAnswer a Date denoting the date time seconds past Jan 1st, 1901
newDay: day month: monthName year: yearIntegerAnswer a Date denoting the dayCount day of the given (named) month andyear
newDay: day monthIndex: monthIndex year: yearIntegerAnswer a Date denoting the dayCount day of the given (as a number) monthand year
newDay: dayCount year: yearIntegerAnswer a Date denoting the dayCount day of the yearInteger year
readFrom: aStreamParse an instance of the receiver from aStream
today Answer a Date denoting the current date in local time
utcDateAndTimeNowAnswer an array containing the current date and time in Coordinated UniversalTime (UTC)
utcToday Answer a Date denoting the current date in Coordinated Universal Time (UTC)
1.60.4 Date: basic
- aDate Answer a new Duration counting the number of days between the receiver andaDate.
addDays: dayCountAnswer a new Date pointing dayCount past the receiver
subtractDate: aDateAnswer the number of days between aDate and the receiver (negative if thereceiver is before aDate)
subtractDays: dayCountAnswer a new Date pointing dayCount before the receiver
1.60.5 Date: compatibility (non-ANSI)
day Answer the day represented by the receiver
dayName Answer the day of week of the receiver as a Symbol
shortMonthNameAnswer the abbreviated name of the month represented by the receiver
98 GNU Smalltalk Library Reference
1.60.6 Date: date computations
asSeconds Answer the date as the number of seconds from 1/1/1901.
dayOfMonthAnswer the day represented by the receiver (same as #day)
dayOfWeekAnswer the day of week of the receiver. 1 = Monday, 7 = Sunday
dayOfWeekAbbreviationAnswer the day of week of the receiver as a Symbol
dayOfWeekNameAnswer the day of week of the receiver as a Symbol
dayOfYearAnswer the days passed since 31/12 of last year; e.g. New Year’s Day is 1
daysFromBaseDayAnswer the days passed since 1/1/1901
daysInMonthAnswer the days in the month represented by the receiver
daysInYearAnswer the days in the year represented by the receiver
daysLeftInMonthAnswer the days to the end of the month represented by the receiver
daysLeftInYearAnswer the days to the end of the year represented by the receiver
firstDayOfMonthAnswer a Date representing the first day of the month represented by the re-ceiver
isLeapYearAnswer whether the receiver refers to a date in a leap year.
lastDayOfMonthAnswer a Date representing the last day of the month represented by the receiver
month Answer the index of the month represented by the receiver
monthAbbreviationAnswer the abbreviated name of the month represented by the receiver
monthIndexAnswer the index of the month represented by the receiver
monthNameAnswer the name of the month represented by the receiver
year Answer the year represented by the receiver
Chapter 1: Base classes 99
1.60.7 Date: printing
printOn: aStreamPrint a representation for the receiver on aStream
1.60.8 Date: still unclassified
+ aDurationAnswer a new Date or DateTime pointing aDuration time past the receiver.
1.60.9 Date: storing
storeOn: aStreamStore on aStream Smalltalk code compiling to the receiver
1.60.10 Date: testing
< aDate Answer whether the receiver indicates a date preceding aDate
= aDate Answer whether the receiver indicates the same date as aDate
hash Answer an hash value for the receievr
1.61 DateTime
Defined in namespace SmalltalkSuperclass: DateCategory: Language-Data types
My instances represent timestamps.
1.61.1 DateTime class: information
clockPrecisionAnswer ‘ClockPrecision’.
initialize Initialize the receiver’s class variables
1.61.2 DateTime class: instance creation
now Answer an instance of the receiver referring to the current date and time.
readFrom: aStreamParse an instance of the receiver from aStream
today Answer an instance of the receiver referring to midnight of today in local time.
year: y day: d hour: h minute: min second: sAnswer a DateTime denoting the d-th day of the given year, and setting thetime part to the given hour, minute, and second
year: y day: d hour: h minute: min second: s offset: ofsAnswer a DateTime denoting the d-th day of the given year. Set the offset fieldto ofs (a Duration), and the time part to the given hour, minute, and second
100 GNU Smalltalk Library Reference
year: y month: m day: d hour: h minute: min second: sAnswer a DateTime denoting the d-th day of the given (as a number) monthand year, setting the time part to the given hour, minute, and second
year: y month: m day: d hour: h minute: min second: s offset: ofsAnswer a DateTime denoting the d-th day of the given (as a number) monthand year. Set the offset field to ofs (a Duration), and the the time part to thegiven hour, minute, and second
1.61.3 DateTime class: instance creation (non-ANSI)
date: aDate time: aTimeAnswer a DateTime denoting the given date and time. Set the offset field toofs (a Duration).
date: aDate time: aTime offset: ofsAnswer a DateTime denoting the given date and time. Set the offset field toofs (a Duration).
fromDays: days seconds: secsAnswer a DateTime denoting the given date (as days since January 1, 1901)and time (as seconds since UTC midnight).
fromDays: days seconds: secs offset: ofsAnswer a DateTime denoting the given date (as days since January 1, 1901)and time (as seconds since midnight). Set the offset field to ofs (a Duration).
fromSeconds: secsAnswer a DateTime denoting the given date and time (as seconds since January1, 1901 midnight UTC).
fromSeconds: secs offset: ofsAnswer a DateTime denoting the given date and time (as seconds since January1, 1901 midnight). Set the offset field to ofs (a Duration).
1.61.4 DateTime: basic
+ aDurationAnswer a new Date pointing aDuration time past the receiver
- aDateTimeOrDurationAnswer a new Date pointing dayCount before the receiver
1.61.5 DateTime: computations
asSeconds Answer the date as the number of seconds from 1/1/1901.
dayOfWeekAnswer the day of week of the receiver. Unlike Dates, DateAndTimes have 1= Sunday, 7 = Saturday
hour Answer the hour in a 24-hour clock
hour12 Answer the hour in a 12-hour clock
Chapter 1: Base classes 101
hour24 Answer the hour in a 24-hour clock
meridianAbbreviationAnswer either #AM (for anti-meridian) or #PM (for post-meridian)
minute Answer the minute
second Answer the month represented by the receiver
1.61.6 DateTime: printing
printOn: aStreamPrint a representation for the receiver on aStream
1.61.7 DateTime: splitting in dates & times
asDate Answer a Date referring to the same day as the receiver
asTime Answer a Time referring to the same time (from midnight) as the receiver
at: anIndexSince in the past timestamps were referred to as Arrays containing a Date anda Time (in this order), this method provides access to DateTime objects like ifthey were two-element Arrays.
1.61.8 DateTime: storing
storeOn: aStreamStore on aStream Smalltalk code compiling to the receiver
1.61.9 DateTime: testing
< aDateTimeAnswer whether the receiver indicates a date preceding aDate
= aDateTimeAnswer whether the receiver indicates the same date as aDate
hash Answer an hash value for the receievr
1.61.10 DateTime: time zones
asLocal Answer the receiver, since DateTime objects store themselves in Local time
asUTC Convert the receiver to UTC time, and answer a new DateTime object.
offset Answer the receiver’s offset from UTC to local time (e.g. +3600 seconds forCentral Europe Time, -3600*6 seconds for Eastern Standard Time). The offsetis expressed as a Duration
offset: anOffsetAnswer a copy of the receiver with the offset from UTC to local time changedto anOffset (a Duration).
timeZoneAbbreviationAnswer an abbreviated indication of the receiver’s offset, expressed as ‘shhmm’,where ‘hh’ is the number of hours and ‘mm’ is the number of minutes between
102 GNU Smalltalk Library Reference
UTC and local time, and ‘s’ can be ‘+’ for the Eastern hemisphere and ‘-’ forthe Western hemisphere.
timeZoneNameAnswer the time zone name for the receiver (currently, it is simply ‘GMT +xxxx’,where ‘xxxx’ is the receiver’s #timeZoneAbbreviation).
1.62 DeferredVariableBinding
Defined in namespace SmalltalkSuperclass: LookupKeyCategory: Language-Data types
I represent a binding to a variable that is not tied to a particular dictionaryuntil the first access. Then, lookup rules for global variables in the scope of agiven class are used.
1.62.1 DeferredVariableBinding class: basic
key: aSymbol class: aClass defaultDictionary: aDictionaryAnswer a binding that will look up aSymbol as a variable in aClass’s environ-ment at first access. See #resolveBinding’s comment for aDictionary’s meaning.
path: anArray class: aClass defaultDictionary: aDictionaryAs with #key:class:defaultDictionary:, but accepting an array of symbols, rep-resenting a namespace path, instead.
1.62.2 DeferredVariableBinding: basic
path Answer the path followed after resolving the first key.
value Answer a new instance of the receiver with the given key and value
value: anObjectAnswer a new instance of the receiver with the given key and value
1.62.3 DeferredVariableBinding: storing
printOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
1.63 Delay
Defined in namespace SmalltalkSuperclass: ObjectCategory: Kernel-Processes
I am the ultimate agent for frustration in the world. I cause things to wait(sometimes much more than is appropriate, but it is those losing operatingsystems’ fault). When a process sends one of my instances a wait message, thatprocess goes to sleep for the interval specified when the instance was created.
Chapter 1: Base classes 103
1.63.1 Delay class: instance creation
forMilliseconds: millisecondCountAnswer a Delay waiting for millisecondCount milliseconds
forNanoseconds: nanosecondCountAnswer a Delay waiting for nanosecondCount nanoseconds
forSeconds: secondCountAnswer a Delay waiting for secondCount seconds
untilMilliseconds: millisecondCountAnswer a Delay waiting until millisecondCount milliseconds after startup
untilNanoseconds: nanosecondCountAnswer a Delay waiting until nanosecondCount nanoseconds after startup
1.63.2 Delay class: still unclassified
update: aspectPrime the timer event loop when the image starts running.
1.63.3 Delay class: timer process
activeDelayReturn the delay at the head of the queue.
handleDelayRequestorHandle a timer event; which can be either: - a schedule or unschedule request(DelayRequestor notNil) - a timer signal (not explicitly specified) We check fortimer expiry every time we get a signal.
runDelayProcessRun the timer event loop.
scheduleDelay: aDelayPrivate - Schedule this Delay. Run in the timer process, which is the only onethat manipulates Queue.
startDelayLoopStart the timer event loop.
unscheduleDelay: aDelayPrivate - Unschedule this Delay. Run in the timer process, which is the onlyone that manipulates Queue.
1.63.4 Delay: accessing
asAbsoluteAnswer a delay that waits until the current delay’s resumptionTime, or delay-Duration milliseconds from now if that would be nil. May answer the receiverif it is already waiting until an absolute time.
delayDurationAnswer the time I have left to wait, in milliseconds.
104 GNU Smalltalk Library Reference
isAbsolute Answer whether the receiver waits until an absolute time on the millisecondclock.
resumptionTimeAnswer ‘resumptionTime’.
1.63.5 Delay: comparing
= aDelay Answer whether the receiver and aDelay denote the same delay
hash Answer an hash value for the receiver
1.63.6 Delay: copying
postCopy Adjust the current delay so that it behaves as if it had just been created.
1.63.7 Delay: delaying
timedWaitOn: aSemaphoreSchedule this Delay and wait on it. The current process will be suspended forthe amount of time specified when this Delay was created, or until aSemaphoreis signaled.
wait Schedule this Delay and wait on it. The current process will be suspended forthe amount of time specified when this Delay was created.
1.63.8 Delay: initialization
initForNanoseconds: valueInitialize a Delay waiting for millisecondCount milliseconds
1.63.9 Delay: instance creation
initUntilNanoseconds: valueInitialize a Delay waiting for millisecondCount milliseconds after startup
1.63.10 Delay: testing
isActive Answer whether this Delay is being waited on.
1.63.11 Delay: timeout
value: aBlock onTimeoutDo: aTimeoutBlockExecute aBlock for up to the time of my own delay; in case the code did notfinish abort the execution, unwind the block and then evaluate aTimeoutBlock.
1.64 DelayedAdaptor
Defined in namespace SmalltalkSuperclass: PluggableAdaptorCategory: Language-Data types
I can be used where many expensive updates must be performed. My instancesbuffer the last value that was set, and only actually set the value when the#trigger message is sent. Apart from this, I’m equivalent to PluggableAdaptor.
Chapter 1: Base classes 105
1.64.1 DelayedAdaptor: accessing
trigger Really set the value of the receiver.
value Get the value of the receiver.
value: anObjectSet the value of the receiver - actually, the value is cached and is not set untilthe #trigger method is sent.
1.65 Dictionary
Defined in namespace SmalltalkSuperclass: HashedCollectionCategory: Collections-Keyed
I implement a dictionary, which is an object that is indexed by unique objects(typcially instances of Symbol), and associates another object with that index.I use the equality operator = to determine equality of indices.
In almost all places where you would use a plain Dictionary, a LookupTablewould be more efficient; see LookupTable’s comment before you use it. I dohave a couple of special features that are useful in certain special cases.
1.65.1 Dictionary class: instance creation
from: anArrayAnswer a new dictionary created from the keys and values of Associations inanArray, such as {1 -> 2. 3 -> 4}. anArray should be specified using brace-syntax.
new Create a new dictionary with a default size
1.65.2 Dictionary: accessing
add: newObjectAdd the newObject association to the receiver
addAll: aCollectionAdds all the elements of ’aCollection’ to the receiver, answer aCollection
associationAt: keyAnswer the key/value Association for the given key. Fail if the key is not found
associationAt: key ifAbsent: aBlockAnswer the key/value Association for the given key. Evaluate aBlock (answeringthe result) if the key is not found
associationsReturns the content of a Dictionary as a Set of Associations.
at: key Answer the value associated to the given key. Fail if the key is not found
at: key ifAbsent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
106 GNU Smalltalk Library Reference
at: aKey ifAbsentPut: aBlockAnswer the value associated to the given key. If the key is not found, evaluateaBlock and associate the result to aKey before returning.
at: aKey ifPresent: aBlockIf aKey is absent, answer nil. Else, evaluate aBlock passing the associated valueand answer the result of the invocation
at: key put: valueStore value as associated to the given key
atAll: keyCollectionAnswer a Dictionary that only includes the given keys. Fail if any of them isnot found
keyAtValue: valueAnswer the key associated to the given value, or nil if the value is not found
keyAtValue: value ifAbsent: exceptionBlockAnswer the key associated to the given value. Evaluate exceptionBlock (an-swering the result) if the value is not found. IMPORTANT: == is used tocompare values
keys Answer a kind of Set containing the keys of the receiver
values Answer an Array containing the values of the receiver
1.65.3 Dictionary: awful ST-80 compatibility hacks
findKeyIndex: keyTries to see if key exists as a the key of an indexed variable. As soon as nil oran association with the correct key is found, the index of that slot is answered
1.65.4 Dictionary: compilation
scopeDictionaryAnswer the dictionary that is used when the receiver is before a period inSmalltalk source code.
1.65.5 Dictionary: dictionary enumerating
associationsDo: aBlockPass each association in the dictionary to aBlock
collect: aBlockAnswer a new dictionary where the keys are the same and the values are ob-tained by passing each value to aBlock and collecting the return values
do: aBlockPass each value in the dictionary to aBlock
keysAndValuesDo: aBlockPass each key/value pair in the dictionary as two distinct parameters to aBlock
keysDo: aBlockPass each key in the dictionary to aBlock
Chapter 1: Base classes 107
reject: aBlockAnswer a new dictionary containing the key/value pairs for which aBlock re-turns false. aBlock only receives the value part of the pairs.
select: aBlockAnswer a new dictionary containing the key/value pairs for which aBlock re-turns true. aBlock only receives the value part of the pairs.
1.65.6 Dictionary: dictionary removing
remove: anAssociationRemove anAssociation’s key from the dictionary
remove: anAssociation ifAbsent: aBlockRemove anAssociation’s key from the dictionary
removeAllKeys: keysRemove all the keys in keys, without raising any errors
removeAllKeys: keys ifAbsent: aBlockRemove all the keys in keys, passing the missing keys as parameters to aBlockas they’re encountered
removeKey: keyRemove the passed key from the dictionary, fail if it is not found
removeKey: key ifAbsent: aBlockRemove the passed key from the dictionary, answer the result of evaluatingaBlock if it is not found
1.65.7 Dictionary: dictionary testing
includes: anObjectAnswer whether the receiver contains anObject as one of its values
includesAssociation: anAssociationAnswer whether the receiver contains the key which is anAssociation’s key andits value is anAssociation’s value
includesKey: keyAnswer whether the receiver contains the given key
occurrencesOf: aValueAnswer whether the number of occurrences of aValue as one of the receiver’svalues
1.65.8 Dictionary: namespace protocol
allSuperspacesAnswer all the receiver’s superspaces in a collection
allSuperspacesDo: aBlockEvaluate aBlock once for each of the receiver’s superspaces (which is none forBindingDictionary).
108 GNU Smalltalk Library Reference
definedKeysAnswer a kind of Set containing the keys of the receiver
definesKey: keyAnswer whether the receiver defines the given key. ‘Defines’ means that thereceiver’s superspaces, if any, are not considered.
hereAssociationAt: keyReturn the association for the variable named as specified by ‘key’ *in thisnamespace*. If the key is not found search will *not* be carried on in super-spaces and the method will fail.
hereAssociationAt: key ifAbsent: aBlockReturn the association for the variable named as specified by ‘key’ *in thisnamespace*. If the key is not found search will *not* be carried on in super-spaces and aBlock will be immediately evaluated.
hereAt: keyReturn the value associated to the variable named as specified by ‘key’ *inthis namespace*. If the key is not found search will *not* be carried on insuperspaces and the method will fail.
hereAt: key ifAbsent: aBlockReturn the value associated to the variable named as specified by ‘key’ *inthis namespace*. If the key is not found search will *not* be carried on insuperspaces and aBlock will be immediately evaluated.
inheritsFrom: aNamespaceAnswer whether aNamespace is one of the receiver’s direct and indirect super-spaces
superspaceAnswer the receiver’s superspace, which is nil for BindingDictionary.
withAllSuperspacesAnswer the receiver and all of its superspaces in a collection, which is none forBindingDictionary
withAllSuperspacesDo: aBlockInvokes aBlock for the receiver and all superspaces, both direct and indirect(though a BindingDictionary does not have any).
1.65.9 Dictionary: printing
examineOn: aStreamPrint all the instance variables and objects in the receiver on aStream
printOn: aStreamPrint a representation of the receiver on aStream
1.65.10 Dictionary: rehashing
rehash Rehash the receiver
Chapter 1: Base classes 109
1.65.11 Dictionary: removing
removeAllKeysSuchThat: aBlockRemove from the receiver all keys for which aBlock returns true.
1.65.12 Dictionary: storing
storeOn: aStreamPrint Smalltalk code compiling to the receiver on aStream
1.65.13 Dictionary: testing
= aDictionaryAnswer whether the receiver and aDictionary are equal
hash Answer the hash value for the receiver
1.66 DirectedMessage
Defined in namespace SmalltalkSuperclass: MessageCategory: Language-Implementation
I represent a message send: I contain the receiver, selector and arguments fora message.
1.66.1 DirectedMessage class: creating instances
receiver: anObject selector: aSymbolCreate a new instance of the receiver
receiver: receiverObject selector: aSymbol argument: argumentObjectCreate a new instance of the receiver
receiver: anObject selector: aSymbol arguments: anArrayCreate a new instance of the receiver
selector: aSymbol arguments: anArrayThis method should not be called for instances of this class.
selector: aSymbol arguments: anArray receiver: anObjectCreate a new instance of the receiver
1.66.2 DirectedMessage: accessing
receiver Answer the receiver
receiver: anObjectChange the receiver
1.66.3 DirectedMessage: basic
printOn: aStreamPrint a representation of the receiver on aStream
send Send the message
110 GNU Smalltalk Library Reference
value Send the message (this message provides interoperability between DirectedMes-sages and blocks)
value: anObjectSend the message with the sole argument anObject (this message provides in-teroperability between DirectedMessages and blocks)
value: obj1 value: obj2Send the message with the arguments obj1 and obj2 (this message providesinteroperability between DirectedMessages and blocks)
valueWithArguments: anArraySend the message with the arguments replaced by anArray (this message pro-vides interoperability between DirectedMessages and blocks)
1.66.4 DirectedMessage: multiple process
fork Create a new process executing the receiver and start it
forkAt: priorityCreate a new process executing the receiver with given priority and start it
newProcessCreate a new process executing the receiver in suspended state. The priority isthe same as for the calling process. The receiver must not contain returns
1.66.5 DirectedMessage: saving and loading
reconstructOriginalObjectThis method is used when DirectedMessages are used together with Plug-gableProxies (see ObjectDumper). It sends the receiver to reconstruct theobject that was originally stored.
1.67 Directory
Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams-Files
I am the counterpart of File in a tree-structured file system. I provide thenotion of a current working directory and know several well-known places inthe file system.
However, all navigation methods for directories are under FilePath or File forefficiency reasons. Refer to the manual of FilePath for information on how touse the instances returned by my class methods.
1.67.1 Directory class: file name management
append: fileName to: directoryAnswer the name of a file named ‘fileName’ which resides in a directory named‘directory’.
pathSeparatorAnswer (as a Character) the character used to separate directory names
Chapter 1: Base classes 111
pathSeparatorStringAnswer (in a String) the character used to separate directory names
1.67.2 Directory class: file operations
allFilesMatching: aPattern do: aBlockInvoke #allFilesMatching:do: on the current working directory.
create: dirNameCreate a directory named dirName and answer it.
createTemporary: prefixCreate an empty directory whose name starts with prefix and answer it.
working Answer the current working directory, not following symlinks.
working: dirNameChange the current working directory to dirName.
1.67.3 Directory class: reading system defaults
execPrefix Answer the path to GNU Smalltalk’s executable installation prefix
home Answer the path to the user’s home directory
image Answer the path to GNU Smalltalk’s image file
kernel Answer the path in which a local version of the GNU Smalltalk kernel’sSmalltalk source files were searched when the image was created.
libexec Answer the path to GNU Smalltalk’s auxiliary executables
localKernelAnswer the path to the GNU Smalltalk kernel’s Smalltalk source files. Same as‘Directory kernel’ since GNU Smalltalk 3.0.
module Answer the path to GNU Smalltalk’s dynamically loaded modules
prefix Answer the path to GNU Smalltalk’s installation prefix
systemKernelAnswer the path to the installed Smalltalk kernel source files.
temporaryAnswer the path in which temporary files can be created. This is read from theenvironment, and guessed if that fails.
userBase Answer the base path under which file for user customization of GNU Smalltalkare stored.
1.68 DLD
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface
...and Gandalf said: “Many folk like to know beforehand what is to be set onthe table; but those who have laboured to prepare the feast like to keep theirsecret; for wonder makes the words of praise louder.”
112 GNU Smalltalk Library Reference
I am just an ancillary class used to reference some C functions. Most of myactual functionality is used by redefinitions of methods in CFunctionDescriptor.
1.68.1 DLD class: C call-outs
defineCFunc: aName as: aFuncAddrRegister aFuncAddr as the target for cCalls to aName.
1.68.2 DLD class: dynamic linking
addLibrary: libraryAdd library to the search path of libraries to be used by DLD.
addLibraryHandle: libraryHandleThis is called internally by gst dlopen. The library will be open and put in thesearch path.
addModule: libraryAdd library to the list of modules to be loaded when the image is started. Thegst initModule function in the library is called, but the library will not be putin the search path used whenever a C function is requested but not registered.
defineExternFunc: aFuncNameThis method calls #primDefineExternFunc: to try to link to a function with thegiven name, and answers whether the linkage was successful. You can redefinethis method to restrict the ability to do dynamic linking.
initialize Private - Initialize the receiver’s class variables
libraryListAnswer a copy of the search path of libraries to be used by DLD
moduleListAnswer a copy of the modules reloaded when the image is started
primDefineExternFunc: aFuncNameThis method tries to link to a function with the given name, and answerswhether the linkage was successful. It should not be overridden.
update: aspectCalled on startup - Make DLD re-link and reset the addresses of all the exter-nally defined functions
1.69 DumperProxy
Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams-Files
I am an helper class for ObjectDumper. When an object cannot be saved inthe standard way, you can register a subclass of me to provide special meansto save that object.
Chapter 1: Base classes 113
1.69.1 DumperProxy class: accessing
acceptUsageForClass: aClassThe receiver was asked to be used as a proxy for the class aClass. Answerwhether the registration is fine. By default, answer true
loadFrom: anObjectDumperReload a proxy stored in anObjectDumper and reconstruct the object
1.69.2 DumperProxy class: instance creation
on: anObjectAnswer a proxy to be used to save anObject. This method MUST be overriddenand anObject must NOT be stored in the object’s instance variables unless youoverride #dumpTo:, because that would result in an infinite loop!
1.69.3 DumperProxy: saving and restoring
dumpTo: anObjectDumperDump the proxy to anObjectDumper – the #loadFrom: class method willreconstruct the original object.
object Reconstruct the object stored in the proxy and answer it
1.70 Duration
Defined in namespace SmalltalkSuperclass: TimeCategory: Language-Data types
My instances represent differences between timestamps.
1.70.1 Duration class: instance creation
days: d Answer a duration of ‘d’ days
days: d hours: h minutes: m seconds: sAnswer a duration of ‘d’ days and the given number of hours, minutes, andseconds.
initialize Initialize the receiver’s instance variables
milliseconds: msecAnswer a duration of ‘msec’ milliseconds
readFrom: aStreamParse an instance of the receiver (hours/minutes/seconds) from aStream
weeks: w Answer a duration of ‘w’ weeks
zero Answer a duration of zero seconds.
1.70.2 Duration class: instance creation (non ANSI)
fromDays: days seconds: secs offset: unusedAnswer a duration of ‘d’ days and ‘secs’ seconds. The last parameter is unused;this message is available for interoperability with the DateTime class.
114 GNU Smalltalk Library Reference
1.70.3 Duration: arithmetics
* factor Answer a Duration that is ‘factor’ times longer than the receiver
+ aDurationAnswer a Duration that is the sum of the receiver and aDuration’s lengths.
- aDurationAnswer a Duration that is the difference of the receiver and aDuration’s lengths.
/ factorOrDurationIf the parameter is a Duration, answer the ratio between the receiver and fac-torOrDuration. Else divide the receiver by factorOrDuration (a Number) andanswer a new Duration that is correspondingly shorter.
abs Answer a Duration that is as long as the receiver, but always in the future.
days Answer the number of days in the receiver
isZero Answer whether the receiver correspond to a duration of zero seconds.
negated Answer a Duration that is as long as the receiver, but with past and futureexchanged.
negative Answer whether the receiver is in the past.
positive Answer whether the receiver is a zero-second duration or is in the future.
printOn: aStreamPrint a represention of the receiver on aStream.
1.70.4 Duration: processes
wait Answer a Delay waiting for the amount of time represented by the receiver andstart waiting on it.
1.70.5 Duration: storing
storeOn: aStreamStore on aStream Smalltalk code compiling to the receiver
1.71 DynamicVariable
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Utilities
I am a variable that is visible only in the stackframes outgoing from this one.Do not use DynamicVariable directly, instead create a subclass for each variableyou want to use.
You can override the #value class method, and call #valueIfAbsent: from thereif you want the default value to be something else than nil.
Chapter 1: Base classes 115
1.71.1 DynamicVariable class: evaluating
use: anObject during: aBlockNot commented.
value Not commented.
valueIfAbsent: aBlockNot commented.
1.72 Error
Defined in namespace SmalltalkSuperclass: ExceptionCategory: Language-Exceptions
Error represents a fatal error. Instances of it are not resumable.
1.72.1 Error: exception description
descriptionAnswer a textual description of the exception.
isResumableAnswer false. Error exceptions are by default unresumable; subclasses canoverride this method if desired.
1.73 Exception
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Exceptions
My instances describe an exception that has happened, and are passed to ex-ception handlers. Classes describe the kind of exception.
Apart from containing information on the generated exception, my instancescontain methods that allow you to resume execution, leave the #on:do:... block,and pass the exception to an handler with a lower priority.
1.73.1 Exception class: comparison
goodness: anExceptionClassAnswer how good the receiver is at handling the given exception. A negativevalue indicates that the receiver is not able to handle the exception.
handles: anExceptionAnswer whether the receiver handles ‘anException’.
1.73.2 Exception class: creating ExceptionCollections
, aTrappableEventAnswer an ExceptionCollection containing all the exceptions in the receiver andall the exceptions in aTrappableEvent
116 GNU Smalltalk Library Reference
1.73.3 Exception class: instance creation
new Create an instance of the receiver, which you will be able to signal later.
signal Create an instance of the receiver, give it default attributes, and signal it im-mediately.
signal: messageTextCreate an instance of the receiver, set its message text, and signal it immedi-ately.
1.73.4 Exception class: interoperability with TrappableEvents
allExceptionsDo: aBlockPrivate - Pass ourselves to aBlock
1.73.5 Exception: accessing
basicMessageTextAnswer an exception’s message text. Do not override this method.
messageTextAnswer an exception’s message text.
messageText: aStringSet an exception’s message text.
tag Answer an exception’s tag value. If not specified, it is the same as the messagetext.
tag: anObjectSet an exception’s tag value. If nil, the tag value will be the same as the messagetext.
1.73.6 Exception: built ins
resignalAsUnhandled: messageThis might start the debugger... Note that we use #basicPrint ’cause#printOn: might invoke an error.
1.73.7 Exception: comparison
= anObjectAnswer whether the receiver is equal to anObject. This is true if either thereceiver or its class are the same object as anObject.
1.73.8 Exception: copying
postCopy Modify the receiver so that it does not refer to any instantiated exceptionhandler.
1.73.9 Exception: exception description
defaultActionExecute the default action that is attached to the receiver.
Chapter 1: Base classes 117
descriptionAnswer a textual description of the exception.
isResumableAnswer true. Exceptions are by default resumable.
1.73.10 Exception: exception handling
context Return the execution context for the #on:do: snippet
isNested Answer whether the current exception handler is within the scope of anotherhandler for the same exception.
outer Raise the exception that instantiated the receiver, passing the same parameters.If the receiver is resumable and the evaluated exception action resumes thenthe result returned from #outer will be the resumption value of the evaluatedexception action. If the receiver is not resumable or if the exception action doesnot resume then this message will not return, and #outer will be equivalent to#pass.
pass Yield control to the enclosing exception action for the receiver. Similar to#outer, but control does not return to the currently active exception handler.
resignalAs: replacementExceptionReinstate all handlers and execute the handler for ‘replacementException’; con-trol does not return to the currently active exception handler. The new Signalobject that is created has the same contents as the receiver (this might or notbe correct – if it isn’t you can use an idiom such as ‘sig retryUsing: [ replace-mentException signal ])
resume If the exception is resumable, resume the execution of the block that raisedthe exception; the method that was used to signal the exception will answerthe receiver. Use this method IF AND ONLY IF you know who caused theexception and if it is possible to resume it in that particular case
resume: anObjectIf the exception is resumable, resume the execution of the block that raised theexception; the method that was used to signal the exception will answer anOb-ject. Use this method IF AND ONLY IF you know who caused the exceptionand if it is possible to resume it in that particular case
retry Re-execute the receiver of the #on:do: message. All handlers are reinstated:watch out, this can easily cause an infinite loop.
retryUsing: aBlockExecute aBlock reinstating all handlers, and return its result from the #signalmethod.
return Exit the #on:do: snippet, answering nil to its caller.
return: anObjectExit the #on:do: snippet, answering anObject to its caller.
118 GNU Smalltalk Library Reference
1.73.11 Exception: exception signaling
signal Raise the exceptional event represented by the receiver
signal: messageTextRaise the exceptional event represented by the receiver, setting its message textto messageText.
1.73.12 Exception: still unclassified
signalingContextReturn the execution context for the place that signaled the exception, or nil ifit is not available anymore (for example if the exception handler has returned.
1.74 ExceptionSet
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Exceptions
My instances are not real exceptions: they can only be used as arguments to#on:do:... methods in BlockClosure. They act as shortcuts that allows you touse the same handler for many exceptions without having to write duplicatecode
1.74.1 ExceptionSet class: instance creation
new Private - Answer a new, empty ExceptionSet
1.74.2 ExceptionSet: enumerating
allExceptionsDo: aBlockPrivate - Evaluate aBlock for every exception in the receiver. Answer thereceiver
goodness: exceptionAnswer how good the receiver is at handling the given exception. A negativevalue indicates that the receiver is not able to handle the exception.
handles: exceptionAnswer whether the receiver handles ‘exception’.
1.74.3 ExceptionSet: instance creation
, aTrappableEventAnswer an ExceptionSet containing all the exceptions in the receiver and allthe exceptions in aTrappableEvent
Chapter 1: Base classes 119
1.75 False
Defined in namespace SmalltalkSuperclass: BooleanCategory: Language-Data types
I always tell lies. I have a single instance in the system, which represents thevalue false.
1.75.1 False: basic
& aBooleanWe are false – anded with anything, we always answer false
and: aBlockWe are false – anded with anything, we always answer false
eqv: aBooleanAnswer whether the receiver and aBoolean represent the same boolean value
ifFalse: falseBlockWe are false – evaluate the falseBlock
ifFalse: falseBlock ifTrue: trueBlockWe are false – evaluate the falseBlock
ifTrue: trueBlockWe are false – answer nil
ifTrue: trueBlock ifFalse: falseBlockWe are false – evaluate the falseBlock
not We are false – answer true
or: aBlock We are false – ored with anything, we always answer the other operand, soevaluate aBlock
xor: aBooleanAnswer whether the receiver and aBoolean represent different boolean values
| aBooleanWe are false – ored with anything, we always answer the other operand
1.75.2 False: C hacks
asCBooleanValueAnswer ‘0’.
1.75.3 False: printing
printOn: aStreamPrint a representation of the receiver on aStream
120 GNU Smalltalk Library Reference
1.76 File
Defined in namespace SmalltalkSuperclass: FilePathCategory: Streams-Files
I enable access to the properties of files that are on disk.
1.76.1 File class: C functions
errno Answer the current value of C errno.
stringError: errnoAnswer C strerror’s result for errno.
1.76.2 File class: file operations
checkErrorReturn whether an error had been reported or not. If there had been one, raisean exception too
checkError: errnoThe error with the C code ‘errno’ has been reported. If errno >= 1, raise anexception
remove: fileNameRemove the file with the given path name
rename: oldFileName to: newFileNameRename the file with the given path name oldFileName to newFileName
symlink: srcName as: destNameCreate a symlink for the srcName file with the given path name
symlink: destName from: srcNameCreate a symlink named destName file from the given path (relative to dest-Name)
touch: fileNameUpdate the timestamp of the file with the given path name.
1.76.3 File class: initialization
initialize Initialize the receiver’s class variables
1.76.4 File class: instance creation
name: aNameAnswer a new file with the given path. The path is turned into an absolutepath.
path: aStringAnswer a new file with the given path. The path is not validated until some ofthe fields of the newly created objects are accessed
Chapter 1: Base classes 121
1.76.5 File class: reading system defaults
executableAnswer the full path to the executable being run.
image Answer the full path to the image being used.
1.76.6 File class: testing
exists: fileNameAnswer whether a file with the given name exists
isAccessible: fileNameAnswer whether a directory with the given name exists and can be accessed
isExecutable: fileNameAnswer whether a file with the given name exists and can be executed
isReadable: fileNameAnswer whether a file with the given name exists and is readable
isWriteable: fileNameAnswer whether a file with the given name exists and is writeable
1.76.7 File: accessing
asString Answer the name of the file identified by the receiver
at: aStringAnswer a File or Directory object as appropriate for a file named ’aName’ inthe directory represented by the receiver.
creationTimeAnswer the creation time of the file identified by the receiver. On some operat-ing systems, this could actually be the last change time (the ‘last change time’has to do with permissions, ownership and the like).
isDirectoryAnswer whether the file is a directory.
isSocket Answer whether the file is an AF UNIX socket.
isSymbolicLinkAnswer whether the file is a symbolic link.
lastAccessTimeAnswer the last access time of the file identified by the receiver
lastChangeTimeAnswer the last change time of the file identified by the receiver (the ‘last changetime’ has to do with permissions, ownership and the like). On some operatingsystems, this could actually be the file creation time.
lastModifyTimeAnswer the last modify time of the file identified by the receiver (the ‘lastmodify time’ has to do with the actual file contents).
122 GNU Smalltalk Library Reference
mode Answer the permission bits for the file identified by the receiver
mode: anIntegerSet the permission bits for the file identified by the receiver to be anInteger.
name Answer the name of the file identified by the receiver
pathTo: destNameCompute the relative path from the receiver to destName.
refresh Refresh the statistics for the receiver
size Answer the size of the file identified by the receiver
1.76.8 File: basic
= aFile Answer whether the receiver represents the same file as the receiver.
hash Answer a hash value for the receiver.
1.76.9 File: directory operations
createDirectoryCreate the receiver as a directory.
namesDo: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing its name. aBlock should not return.
1.76.10 File: file name management
full Answer the full name of the receiver, resolving the ‘.’ and ‘..’ directoryentries, and answer the result. Answer nil if the name is invalid (such as’/usr/../../badname’)
1.76.11 File: file operations
lastAccessTime: accessDateTime lastModifyTime: modifyDateTimeSet the receiver’s timestamps to be accessDateTime and modifyDateTime.
open: class mode: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
owner: ownerString group: groupStringSet the receiver’s owner and group to be ownerString and groupString.
pathFrom: dirCompute the relative path from the directory dirName to the receiver
remove Remove the file with the given path name
renameTo: newFileNameRename the file with the given path name to newFileName
symlinkAs: destNameCreate destName as a symbolic link of the receiver. The appropriate relativepath is computed automatically.
Chapter 1: Base classes 123
symlinkFrom: srcNameCreate the receiver as a symlink from path destName
1.76.12 File: still unclassified
, aName Answer an object of the same kind as the receiver, whose name is suffixed withaName.
1.76.13 File: testing
exists Answer whether a file with the name contained in the receiver does exist.
isAbsolute Answer whether the receiver identifies an absolute path.
isAccessibleAnswer whether a directory with the name contained in the receiver does existand is accessible
isExecutableAnswer whether a file with the name contained in the receiver does exist andis executable
isFileSystemPathAnswer whether the receiver corresponds to a real filesystem path.
isReadableAnswer whether a file with the name contained in the receiver does exist andis readable
isWriteableAnswer whether a file with the name contained in the receiver does exist andis writeable
1.77 FileDescriptor
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Files
My instances are what conventional programmers think of as files. My instancecreation methods accept the name of a disk file (or any named file object, suchas /dev/rmt0 on UNIX or MTA0: on VMS). In addition, they accept a vir-tual filesystem path like ‘configure.gz#ugz’ which can be used to transparentlyextract or decompress files from archives, or do arbitrary processing on the files.
1.77.1 FileDescriptor class: initialization
initialize Initialize the receiver’s class variables
update: aspectClose open files before quitting
124 GNU Smalltalk Library Reference
1.77.2 FileDescriptor class: instance creation
append Open for writing. The file is created if it does not exist. The stream is positionedat the end of the file.
create Open for reading and writing. The file is created if it does not exist, otherwiseit is truncated. The stream is positioned at the beginning of the file.
fopen: fileName mode: fileModeOpen fileName in the required mode - answered by #append, #create, #read-Write, #read or #write - and fail if the file cannot be opened. Else answera new FileStream. For mode anyway you can use any standard C non-binaryfopen mode. The file will be automatically closed upon GC if the object isnot referenced anymore, but it is better to close it as soon as you’re finishedwith it anyway, using #close. To keep a file open even when no references existanymore, send it #removeToBeFinalized
fopen: fileName mode: fileMode ifFail: aBlockOpen fileName in the required mode - answered by #append, #create, #read-Write, #read or #write - and evaluate aBlock if the file cannot be opened. Elseanswer a new FileStream. For mode anyway you can use any The file will beautomatically closed upon GC if the object is not referenced anymore, but itis better to close it as soon as you’re finished with it anyway, using #close. Tokeep a file open even when no references exist anymore, send it #removeToBe-Finalized
on: fd Open a FileDescriptor on the given file descriptor. Read-write access is assumed.
open: fileNameOpen fileName in read-write mode - fail if the file cannot be opened. Elseanswer a new FileStream. The file will be automatically closed upon GC if theobject is not referenced anymore, but you should close it with #close anyway.To keep a file open, send it #removeToBeFinalized
open: fileName mode: fileMode ifFail: aBlockOpen fileName in the required mode - answered by #append, #create, #read-Write, #read or #write - and evaluate aBlock if the file cannot be opened. Elseanswer a new instance of the receiver. For mode anyway you can use any stan-dard C non-binary fopen mode. fileName can be a ‘virtual filesystem’ path,including URLs and ’#’ suffixes that are inspected by the virtual filesystemlayers and replaced with tasks such as un-gzipping a file or extracting a filefrom an archive.
The file will be automatically closed upon GC if the object is not referencedanymore, but it is better to close it as soon as you’re finished with it anyway,using #close. To keep a file open even when no references exist anymore, sendit #removeToBeFinalized
openTemporaryFile: baseNameOpen for writing a file whose name starts with baseName, followed by sixrandom alphanumeric characters. The file is created with mode read/write andpermissions 0666 or 0600 on most recent operating systems (beware, the former
Chapter 1: Base classes 125
behavior might constitute a security problem). The file is opened with theO EXCL flag, guaranteeing that when the method returns successfully we arethe only user.
popen: commandName dir: directionOpen a pipe on the given command and fail if the file cannot be opened. Elseanswer a new FileStream. The pipe will not be automatically closed uponGC, even if the object is not referenced anymore, because when you close apipe you have to wait for the associated process to terminate. direction isreturned by #read or #write (’r’ or ’w’) and is interpreted from the point ofview of Smalltalk: reading means Smalltalk reads the standard output of thecommand, writing means Smalltalk writes the standard input of the command.The other channel (stdin when reading, stdout when writing) is the same asGST’s, unless commandName alters it.
popen: commandName dir: direction ifFail: aBlockOpen a pipe on the given command and evaluate aBlock file cannot be opened.Else answer a new FileStream. The pipe will not be automatically closed uponGC, even if the object is not referenced anymore, because when you close apipe you have to wait for the associated process to terminate. direction isinterpreted from the point of view of Smalltalk: reading means that Smalltalkreads the standard output of the command, writing means that Smalltalk writesthe standard input of the command
read Open text file for reading. The stream is positioned at the beginning of the file.
readWrite Open for reading and writing. The stream is positioned at the beginning of thefile.
write Truncate file to zero length or create text file for writing. The stream is posi-tioned at the beginning of the file.
1.77.3 FileDescriptor class: still unclassified
open: fileName mode: fileModeOpen fileName in the required mode - answered by #append, #create, #read-Write, #read or #write - and fail if the file cannot be opened. Else answera new FileStream. For mode anyway you can use any standard C non-binaryfopen mode. fileName can be a ‘virtual filesystem’ path, including URLs and’#’ suffixes that are inspected by the virtual filesystem layers and replaced withtasks such as un-gzipping a file or extracting a file from an archive.
The file will be automatically closed upon GC if the object is not referencedanymore, but it is better to close it as soon as you’re finished with it anyway,using #close. To keep a file open even when no references exist anymore, sendit #removeToBeFinalized
1.77.4 FileDescriptor: accessing
canRead Answer whether the file is open and we can read from it
canWrite Answer whether the file is open and we can write from it
126 GNU Smalltalk Library Reference
ensureReadableIf the file is open, wait until data can be read from it. The wait allows otherProcesses to run.
ensureWriteableIf the file is open, wait until we can write to it. The wait allows other Processesto run.
exceptionalConditionAnswer whether the file is open and an exceptional condition (such as presenceof out of band data) has occurred on it
fd Return the OS file descriptor of the file
file Return the name of the file
isOpen Answer whether the file is still open
isPeerAlivePresent for compatibility with sockets. For files, it answers whether the file isstill open
isPipe Answer whether the file is a pipe or an actual disk file
name Return the name of the file
waitForExceptionIf the file is open, wait until an exceptional condition (such as presence of outof band data) has occurred on it. The wait allows other Processes to run.
1.77.5 FileDescriptor: basic
checkErrorPerform error checking. By default, we call File class>>#checkError.
close Close the file
contents Answer the whole contents of the file
copyFrom: from to: toAnswer the contents of the file between the two given positions
finalize Close the file if it is still open by the time the object becomes garbage.
invalidate Invalidate a file descriptor
next Return the next character in the file, or nil at eof
nextByte Return the next byte in the file, or nil at eof
nextPut: aCharacterStore aCharacter on the file
nextPutByte: anIntegerStore the byte, anInteger, on the file
nextPutByteArray: aByteArrayStore aByteArray on the file
Chapter 1: Base classes 127
peek Returns the next element of the stream without moving the pointer. Returnsnil when at end of stream.
peekFor: anObjectReturns whether the next element of the stream is equal to anObject, withoutmoving the pointer if it is not.
position Answer the zero-based position from the start of the file
position: nSet the file pointer to the zero-based position n
reset Reset the stream to its beginning
shutdown Close the transmission side of a full-duplex connection. This is useful on read-write pipes.
size Return the current size of the file, in bytes
truncate Truncate the file at the current position
1.77.6 FileDescriptor: binary I/O
nextByteArray: numBytesReturn the next numBytes bytes in the byte array
nextDoubleReturn the next 64-bit float in the byte array
nextFloat Return the next 32-bit float in the byte array
nextLong Return the next 4 bytes in the byte array, interpreted as a 32 bit signed int
nextLongLongReturn the next 8 bytes in the byte array, interpreted as a 64 bit signed int
nextPutDouble: aDoubleStore aDouble as a 64-bit float in the byte array
nextPutFloat: aFloatReturn the next 32-bit float in the byte array
nextPutInt64: anIntegerStore anInteger (range: -2^63..2^64-1) on the byte array as 8 bytes
nextPutLong: anIntegerStore anInteger (range: -2^31..2^32-1) on the byte array as 4 bytes
nextPutShort: anIntegerStore anInteger (range: -32768..65535) on the byte array as 2 bytes
nextShort Return the next 2 bytes in the byte array, interpreted as a 16 bit signed int
nextSignedByteReturn the next byte in the byte array, interpreted as a 8 bit signed number
nextUint64Return the next 8 bytes in the byte array, interpreted as a 64 bit unsigned int
128 GNU Smalltalk Library Reference
nextUlong Return the next 4 bytes in the byte array, interpreted as a 32 bit unsigned int
nextUshortReturn the next 2 bytes in the byte array, interpreted as a 16 bit unsigned int
1.77.7 FileDescriptor: built ins
fileIn File in the contents of the receiver. During a file in operation, global vari-ables (starting with an uppercase letter) that are not declared don’t yield an‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’dictionary (a global variable residing in Smalltalk). As soon as you add thevariable to a namespace (for example by creating a class) the Association willbe removed from Undeclared and reused in the namespace, so that the oldreferences will automagically point to the new value.
fileOp: ioFuncIndexPrivate - Used to limit the number of primitives used by FileStreams
fileOp: ioFuncIndex ifFail: aBlockPrivate - Used to limit the number of primitives used by FileStreams.
fileOp: ioFuncIndex with: arg1Private - Used to limit the number of primitives used by FileStreams
fileOp: ioFuncIndex with: arg1 ifFail: aBlockPrivate - Used to limit the number of primitives used by FileStreams.
fileOp: ioFuncIndex with: arg1 with: arg2Private - Used to limit the number of primitives used by FileStreams
fileOp: ioFuncIndex with: arg1 with: arg2 ifFail: aBlockPrivate - Used to limit the number of primitives used by FileStreams.
fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3Private - Used to limit the number of primitives used by FileStreams
fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 ifFail: aBlockPrivate - Used to limit the number of primitives used by FileStreams.
fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 with: arg4Private - Used to limit the number of primitives used by FileStreams
fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 with: arg4 ifFail: aBlockPrivate - Used to limit the number of primitives used by FileStreams.
1.77.8 FileDescriptor: class type methods
isBinary We answer characters, so answer false
isExternalStreamWe stream on an external entity (a file), so answer true
isText We answer characters, so answer true
Chapter 1: Base classes 129
1.77.9 FileDescriptor: initialize-release
addToBeFinalizedAdd me to the list of open files.
initialize Initialize the receiver’s instance variables
readStreamAnswer myself, or an alternate stream coerced for reading.
removeToBeFinalizedRemove me from the list of open files.
1.77.10 FileDescriptor: low-level access
next: n putAll: aCollection startingAt: positionPut the characters in the supplied range of aCollection in the file
nextAvailable: n into: aCollection startingAt: positionIgnoring any buffering, try to fill the given range of aCollection with the contentsof the file
1.77.11 FileDescriptor: overriding inherited methods
isEmpty Answer whether the receiver is empty
nextPutAllOn: aStreamPut all the characters of the receiver in aStream.
reverseContentsReturn the contents of the file from the last byte to the first
setToEnd Reset the file pointer to the end of the file
skip: anIntegerSkip anInteger bytes in the file
1.77.12 FileDescriptor: polymorphism
pastEnd The end of the stream has been reached. Signal a Notification.
1.77.13 FileDescriptor: positioning
isPositionableAnswer true if the stream supports moving backwards with #skip:.
1.77.14 FileDescriptor: printing
printOn: aStreamPrint a representation of the receiver on aStream
1.77.15 FileDescriptor: testing
atEnd Answer whether data has come to an end
130 GNU Smalltalk Library Reference
1.78 FilePath
Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams-Files
I expose the syntax of file names, including paths. I know how to manipulatesuch a path by splitting it into its components. In addition, I expose informationabout files (both real and virtual) such as their size and timestamps.
1.78.1 FilePath class: file name management
append: fileName to: directoryAnswer the name of a file named ‘fileName’ which resides in a directory named‘directory’.
extensionFor: aStringAnswer the extension of a file named ‘aString’. Note: the extension includes aninitial dot.
fullNameFor: aStringAnswer the full path to a file called ‘aString’, resolving the ‘.’ and ‘..’ directoryentries, and answer the result. ‘/..’ is the same as ’/’.
pathFor: aStringDetermine the path of the name of a file called ‘aString’, and answer the result.With the exception of the root directory, the final slash is stripped.
pathFor: aString ifNone: aBlockDetermine the path of the name of a file called ‘aString’, and answer the result.With the exception of the root directory, the final slash is stripped. If there isno path, evaluate aBlock and return the result.
pathFrom: srcName to: destNameAnswer the relative path to destName when the current directory is srcName’sdirectory.
stripExtensionFrom: aStringRemove the extension from the name of a file called ‘aString’, and answer theresult.
stripFileNameFor: aStringDetermine the path of the name of a file called ‘aString’, and answer the resultas a directory name including the final slash.
stripPathFrom: aStringRemove the path from the name of a file called ‘aString’, and answer the filename plus extension.
1.78.2 FilePath class: still unclassified
isAbsolute: aStringAnswer whether aString is an absolute ptah.
Chapter 1: Base classes 131
1.78.3 FilePath: accessing
at: aNameAnswer a File or Directory object as appropriate for a file named ’aName’ inthe directory represented by the receiver.
creationTimeAnswer the creation time of the file identified by the receiver. On some operat-ing systems, this could actually be the last change time (the ‘last change time’has to do with permissions, ownership and the like).
group: aStringSet the group of the file identified by the receiver to be aString.
includes: aNameAnswer whether a file named ‘aName’ exists in the directory represented by thereceiver.
lastAccessTimeAnswer the last access time of the file identified by the receiver
lastAccessTime: aDateTimeUpdate the last access time of the file corresponding to the receiver, to beaDateTime.
lastAccessTime: accessDateTime lastModifyTime: modifyDateTimeUpdate the timestamps of the file corresponding to the receiver, to be access-DateTime and modifyDateTime.
lastChangeTimeAnswer the last change time of the file identified by the receiver (the ‘last changetime’ has to do with permissions, ownership and the like). On some operatingsystems, this could actually be the file creation time.
lastModifyTimeAnswer the last modify time of the file identified by the receiver (the ‘lastmodify time’ has to do with the actual file contents).
lastModifyTime: aDateTimeUpdate the last modification timestamp of the file corresponding to the receiver,to be aDateTime.
mode Answer the permission bits for the file identified by the receiver
mode: anIntegerSet the permission bits for the file identified by the receiver to be anInteger.
owner: aStringSet the owner of the file identified by the receiver to be aString.
owner: ownerString group: groupStringSet the owner and group of the file identified by the receiver to be aString.
pathTo: destNameCompute the relative path from the receiver to destName.
132 GNU Smalltalk Library Reference
refresh Refresh the statistics for the receiver
size Answer the size of the file identified by the receiver
1.78.4 FilePath: converting
asFile Answer the receiver.
1.78.5 FilePath: decoration
all Return a decorator of the receiver that will provide recursive descent into direc-tories for iteration methods. Furthermore, iteration on the returned wrapperwill not include ’.’ or ’..’ directory entries, and will include the receiver (directly,not via ’.’).
1.78.6 FilePath: directory operations
createDirectoriesCreate the receiver as a directory, together with all its parents.
createDirectoryCreate the receiver as a directory, together with all its parents.
nameAt: aNameAnswer a FilePath for a file named ‘aName’ residing in the directory representedby the receiver.
1.78.7 FilePath: enumerating
allFilesMatching: aPattern do: aBlockEvaluate aBlock on the File objects that match aPattern (according to String>>-#match:) in the directory named by the receiver. Recursively descend intodirectories.
directoriesAnswer an Array with Directory objects for the subdirectories of the directoryrepresented by the receiver.
do: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing a FilePath object (or a subclass) to it. It depends on the subclasswhether iteration will include the ’.’ and ’..’ directory entries.
entries Answer an Array with File or Directory objects for the contents of the directoryrepresented by the receiver.
entryNamesAnswer an Array with the names of the files in the directory represented by thereceiver.
files Answer an Array with File objects for the contents of the directory representedby the receiver.
Chapter 1: Base classes 133
filesMatching: aPatternEvaluate aBlock once for each file in the directory represented by the receiver,passing a File or Directory object to aBlock. Returns the *names* of the filesfor which aBlock returns true.
filesMatching: aPattern do: blockEvaluate block on the File objects that match aPattern (according to String>>-#match:) in the directory named by the receiver.
namesDo: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing its name. It depends on the subclass whether iteration will include the’.’ and ’..’ directory entries.
namesMatching: aPattern do: blockEvaluate block on the file names that match aPattern (according to String>>-#match:) in the directory named by the receiver.
reject: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing a File or Directory object to aBlock. Returns the *names* of the filesfor which aBlock returns true.
select: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing a File or Directory object to aBlock. Returns the *names* of the filesfor which aBlock returns true.
1.78.8 FilePath: file name management
directory Answer the Directory object for the receiver’s path
extension Answer the extension of the receiver
full Answer the full name of the receiver, resolving the ‘.’ and ‘..’ directoryentries, and answer the result. Answer nil if the name is invalid (such as’/usr/../../badname’)
fullName Answer a String with the full path to the receiver (same as #name; it is uselessto override this method).
name Answer String with the full path to the receiver (same as #fullName).
parent Answer the Directory object for the receiver’s path
path Answer the path (if any) of the receiver
stripExtensionAnswer the path (if any) and file name of the receiver
stripFileNameAnswer the path of the receiver, always including a directory name (possibly‘.’) and the final directory separator
stripPath Answer the file name and extension (if any) of the receiver
134 GNU Smalltalk Library Reference
1.78.9 FilePath: file operations
contents Open a read-only FileStream on the receiver, read its contents, close the streamand answer the contents
fileIn File in the receiver
open: modeOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
open: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods). Upon failure, evaluate aBlock.
open: class mode: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
openDescriptor: modeOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
openDescriptor: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods). Upon failure, evaluate aBlock.
pathFrom: dirNameCompute the relative path from the directory dirName to the receiver
readStreamOpen a read-only FileStream on the receiver
remove Remove the file identified by the receiver
renameTo: newNameRename the file identified by the receiver to newName
symlinkAs: destNameCreate destName as a symbolic link of the receiver. The appropriate relativepath is computed automatically.
symlinkFrom: srcNameCreate the receiver as a symbolic link from srcName (relative to the path of thereceiver).
touch Update the timestamp of the file corresponding to the receiver.
withReadStreamDo: aBlockAnswer the result of invoking aBlock with a reading stream open on me, closingit when the dynamic extent of aBlock ends.
withWriteStreamDo: aBlockAnswer the result of invoking aBlock with a writing stream open on me, closingit when the dynamic extent of aBlock ends.
writeStreamOpen a write-only FileStream on the receiver
Chapter 1: Base classes 135
1.78.10 FilePath: printing
asString Print a representation of the receiver on aStream.
displayOn: aStreamPrint a representation of the receiver on aStream.
printOn: aStreamPrint a representation of the receiver on aStream.
withShellEscapesReturn the representation of the receiver with shell characters escaped.
1.78.11 FilePath: still unclassified
/ aName Answer a File or Directory object as appropriate for a file named ’aName’ inthe directory represented by the receiver.
1.78.12 FilePath: testing
exists Answer whether a file with the name contained in the receiver does exist.
isAbsolute Answer whether the receiver identifies an absolute path.
isAccessibleAnswer whether a directory with the name contained in the receiver does existand can be accessed
isDirectoryAnswer whether a file with the name contained in the receiver does exist andidentifies a directory.
isExecutableAnswer whether a file with the name contained in the receiver does exist andis executable
isFile Answer whether a file with the name contained in the receiver does exist anddoes not identify a directory.
isFileSystemPathAnswer whether the receiver corresponds to a real filesystem path.
isReadableAnswer whether a file with the name contained in the receiver does exist andis readable
isRelative Answer whether the receiver identifies a relative path.
isSymbolicLinkAnswer whether a file with the name contained in the receiver does exist andidentifies a symbolic link.
isWriteableAnswer whether a file with the name contained in the receiver does exist andis writeable
136 GNU Smalltalk Library Reference
1.78.13 FilePath: virtual filesystems
zip Not commented.
1.79 FileSegment
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
My instances represent sections of files. I am primarily used by the compilerto record source code locations. I am not a part of the normal Smalltalk-80kernel; I am specific to the GNU Smalltalk implementation.
1.79.1 FileSegment class: basic
on: aFile startingAt: startPos for: sizeIntegerCreate a new FileSegment referring to the contents of the given file, from thestartPos-th byte and for sizeInteger bytes. Note that FileSegments should al-ways be created with full paths because relative paths are interpreted to berelative to the kernel directory.
1.79.2 FileSegment class: installing
relocate Remove the kernel path from all paths that start with it. Needed to support$(DESTDIR) and relocatable installation.
1.79.3 FileSegment: basic
asString Answer a String containing the required segment of the file
copyFrom: from to: toAnswer a String containing the given subsegment of the file. As for streams,from and to are 0-based.
file Answer the File object for the file containing the segment
fileName Answer the name of the file containing the segment
filePos Answer the position in the file where the segment starts
relocateFrom: startPath map: mapIf the path starts with startPath, remove that part of the path. map is aDictionary that is used so that equal filenames stay equal, without increasingthe amount of memory that the image uses.
size Answer the length of the segment
withFileDo: aBlockEvaluate aBlock passing it the FileStream in which the segment identified bythe receiver is stored
Chapter 1: Base classes 137
1.79.4 FileSegment: equality
= aFileSegmentAnswer whether the receiver and aFileSegment are equal.
hash Answer an hash value for the receiver.
1.79.5 FileSegment: printing
printedFileNameAnswer a printed representation of the file containing the segment. While in-troducing some ambiguity, this representation is compact eliminates the pathfor kernel files, and produces a relative path from the current working directoryfor other files.
1.80 FileStream
Defined in namespace SmalltalkSuperclass: FileDescriptorCategory: Streams-Files
My instances are what conventional programmers think of as files. My instancecreation methods accept the name of a disk file (or any named file object, suchas /dev/rmt0 on UNIX or MTA0: on VMS).
1.80.1 FileStream class: file-in
fileIn: aFileNameFile in the aFileName file. During a file in operation, global variables (startingwith an uppercase letter) that are not declared yet don’t yield an ‘unknownvariable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary(a global variable residing in Smalltalk). As soon as you add the variable to anamespace (for example by creating a class) the Association will be removedfrom Undeclared and reused in the namespace, so that the old references willautomagically point to the new value.
fileIn: aFileName ifMissing: aSymbolConditionally do a file in, only if the key (often a class) specified by ’aSymbol’is not present in the Smalltalk system dictionary already. During a file inoperation, global variables (starting with an uppercase letter) that are notdeclared don’t yield an ‘unknown variable’ error. Instead, they are defined asnil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). Assoon as you add the variable to a namespace (for example by creating a class)the Association will be removed from Undeclared and reused in the namespace,so that the old references will automagically point to the new value.
fileIn: aFileName ifTrue: aBooleanConditionally do a file in, only if the supplied boolean is true. During a filein operation, global variables (starting with an uppercase letter) that are notdeclared don’t yield an ‘unknown variable’ error. Instead, they are defined asnil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As
138 GNU Smalltalk Library Reference
soon as you add the variable to a namespace (for example by creating a class)the Association will be removed from Undeclared and reused in the namespace,so that the old references will automagically point to the new value.
fileIn: aFileName line: lineInteger from: realFileName at: aCharPosFile in the aFileName file giving errors such as if it was loaded from the givenline, file name and starting position (instead of 1).
generateMakefileOnto: aStreamGenerate a make file for the file-ins since record was last set to true. Store iton aStream
initialize Private - Initialize the receiver’s class variables
record: recordFlagSet whether Smalltalk should record information about nested file-ins. Whenrecording is enabled, use #generateMakefileOnto: to automatically generate avalid makefile for the intervening file-ins.
require: assocConditionally do a file in from the value of assoc, only if the key of associs not present in the Smalltalk system dictionary already. During a file inoperation, global variables (starting with an uppercase letter) that are notdeclared don’t yield an ‘unknown variable’ error. Instead, they are defined asnil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). Assoon as you add the variable to a namespace (for example by creating a class)the Association will be removed from Undeclared and reused in the namespace,so that the old references will automagically point to the new value.
verbose: verboseFlagSet whether Smalltalk should output debugging messages when filing in
1.80.2 FileStream class: standard streams
stderr Answer a FileStream that is attached the Smalltalk program’s standard errorfile handle, which can be used for error messages and diagnostics issued by theprogram.
stdin Answer a FileStream that is attached the Smalltalk program’s standard inputfile handle, which is the normal source of input for the program.
stdout Answer a FileStream that is attached the Smalltalk program’s standard outputfile handle; this is used for normal output from the program.
1.80.3 FileStream: basic
bufferStartPrivate - Answer the offset from the start of the file corresponding to the be-ginning of the read buffer.
copyFrom: from to: toAnswer the contents of the file between the two given positions
next Return the next character in the file, or nil at eof
Chapter 1: Base classes 139
nextPut: aCharacterStore aCharacter on the file
peek Return the next character in the file, or nil at eof. Don’t advance the filepointer.
position Answer the zero-based position from the start of the file
position: nSet the file pointer to the zero-based position n
size Return the current size of the file, in bytes
truncate Truncate the file at the current position
1.80.4 FileStream: buffering
bufferSize Answer the file’s current buffer
bufferSize: bufSizeFlush the file and set the buffer’s size to bufSize
clean Synchronize the file descriptor’s state with the object’s state.
fill Private - Fill the input buffer
flush Flush the output buffer.
newBuffer Private - Answer a String to be used as the receiver’s buffer
next: n bufferAll: aCollection startingAt: posPrivate - Assuming that the buffer has space for n characters, store n charactersof aCollection in the buffer, starting from the pos-th.
nextAvailable: anInteger into: aCollection startingAt: posRead up to anInteger bytes from the stream and store them into aCollection.Return the number of bytes read.
nextAvailable: anInteger putAllOn: aStreamCopy up to anInteger bytes from the stream into aStream. Return the numberof bytes read.
pendingWriteAnswer whether the output buffer is full.
1.80.5 FileStream: compiling
segmentFrom: startPos to: endPosAnswer an object that, when sent #asString, will yield the result of sending‘copyFrom: startPos to: endPos’ to the receiver
1.80.6 FileStream: initialize-release
initialize Initialize the receiver’s instance variables
140 GNU Smalltalk Library Reference
1.80.7 FileStream: overriding inherited methods
next: n putAll: aCollection startingAt: posWrite n values from aCollection, the first being at pos.
nextLine Returns a collection of the same type that the stream accesses, containing thenext line up to the next new-line character. Returns the entire rest of thestream’s contents if no new-line character is found.
nextPutAllOn: aStreamPut all the characters of the receiver in aStream.
upTo: aCharacterReturns a collection of the same type that the stream accesses, containing dataup to aCharacter. Returns the entire rest of the stream’s contents if no suchcharacter is found.
1.80.8 FileStream: testing
atEnd Answer whether data has come to an end
1.81 Float
Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types
My instances represent floating point numbers that have arbitrary precision.Besides the standard numerical operations, they provide transcendental opera-tions too. They implement IEEE-754 correctly if the hardware supports it.
1.81.1 Float class: byte-order dependancies
signByte Answer the byte of the receiver that contains the sign bit
1.81.2 Float class: characterization
denormalizedAnswer whether instances of the receiver can be in denormalized form.
e Returns the value of e. Hope is that it is precise enough
epsilon Return the smallest Float x for which is 1 + x ~= 1
fmin Return the smallest Float that is > 0.
fminDenormalizedReturn the smallest Float that is > 0 if denormalized values are supported, elsereturn 0.
ln10 Returns the value of ln 10. Hope is that it is precise enough
log10Base2Returns the value of log2 10. Hope is that it is precise enough
pi Returns the value of pi. Hope is that it is precise enough
Chapter 1: Base classes 141
radix Answer the base in which computations between instances of the receiver aremade. This should be 2 on about every known computer, so GNU Smalltalkalways answers 2.
1.81.3 Float: arithmetic
integerPartReturn the receiver’s integer part
negated Return the negation of the receiver. Unlike 0-self, this converts correctly signedzeros.
raisedToInteger: anIntegerReturn self raised to the anInteger-th power
1.81.4 Float: basic
hash Answer an hash value for the receiver. Not-a-number values do not have a hashcode and cannot be put in a hashed collection.
1.81.5 Float: built ins
arcCos Answer the arc-cosine of the receiver
arcSin Answer the arc-sine of the receiver
arcTan Answer the arc-tangent of the receiver
ceiling Answer the integer part of the receiver, truncated towards +infinity
cos Answer the cosine of the receiver
exp Answer ’e’ (2.718281828459...) raised to the receiver
floor Answer the integer part of the receiver, truncated towards -infinity
ln Answer the logarithm of the receiver in base ’e’ (2.718281828459...)
primHash Private - Answer an hash value for the receiver
raisedTo: aNumberAnswer the receiver raised to its aNumber power
sin Answer the sine of the receiver
sqrt Answer the square root of the receiver
tan Answer the tangent of the receiver
1.81.6 Float: coercing
asExactFractionConvert the receiver into a fraction with optimal approximation, but with usu-ally huge terms.
asFraction Convert the receiver into a fraction with a good (but undefined) approximation
truncated Convert the receiver to an Integer. Only used for LargeIntegers, there areprimitives for the other cases.
142 GNU Smalltalk Library Reference
1.81.7 Float: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
1.81.8 Float: comparing
max: aNumberAnswer the maximum between the receiver and aNumber. Redefine in sub-classes if necessary to ensure that if either self or aNumber is a NaN, it isalways answered.
min: aNumberAnswer the minimum between the receiver and aNumber. Redefine in subclassesif necessary to ensure that if either self or aNumber is a NaN, it is alwaysanswered.
withSignOf: aNumberAnswer the receiver, with its sign possibly changed to match that of aNumber.
1.81.9 Float: compiler
literalEquals: anObjectNot commented.
literalHashNot commented.
1.81.10 Float: converting
half Answer 0.5 in the representation of the receiver
1.81.11 Float: floating point
predecessorNot commented.
successor Not commented.
1.81.12 Float: misc math
log: aNumberAnswer log base aNumber of the receiver
1.81.13 Float: printing
printOn: aStreamPrint a representation of the receiver on aStream
1.81.14 Float: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
Chapter 1: Base classes 143
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStreamPrint a representation of the receiver on aStream
1.81.15 Float: testing
isExact Answer whether the receiver performs exact arithmetic. Floats do not.
isFinite Answer whether the receiver does not represent infinity, nor a NaN
isInfinite Answer whether the receiver represents positive or negative infinity
isNaN Answer whether the receiver represents a NaN
negative Answer whether the receiver is negative
positive Answer whether the receiver is positive. Negative zero is not positive, so thedefinition is not simply >= 0.
sign Answer 1 if the receiver is greater than 0, -1 if less than 0, else 0. Negative zerois the same as positive zero.
strictlyPositiveAnswer whether the receiver is > 0
1.81.16 Float: testing functionality
isFloat Answer ‘true’.
1.81.17 Float: transcendental operations
asFloat Just defined for completeness. Return the receiver.
ceilingLog: radixAnswer (self log: radix) ceiling. Use exact arithmetic if radix is not a floatingpoint value.
estimatedLogAnswer an estimate of (self abs floorLog: 10)
floorLog: radixAnswer (self log: radix) floor. Use exact arithmetic if radix is not a floatingpoint value.
log Answer log base 10 of the receiver.
1.81.18 Float: truncation and round off
rounded Answer the receiver, rounded to the nearest integer
144 GNU Smalltalk Library Reference
1.82 FloatD
Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types
My instances represent floating point numbers that have the same accuracy asC’s "double" numbers.
1.82.1 FloatD class: byte-order dependencies
fromBytes: aByteArrayAnswer a float with the bytes in aByteArray, which are in big-endian format.
signByte Answer the byte of the receiver that contains the sign bit
1.82.2 FloatD class: characterization
decimalDigitsReturn the number of decimal digits of precision for a FloatD. Technically, ifP is the precision for the representation, then the decimal precision Q is themaximum number of decimal digits such that any floating point number withQ base 10 digits can be rounded to a floating point number with P base 2 digitsand back again, without change to the Q decimal digits.
emax Return the maximum allowable exponent for a FloatD that is finite.
emin Return the maximum allowable exponent for a FloatD that is finite.
fmax Return the largest normalized FloatD that is not infinite.
fminNormalizedReturn the smallest normalized FloatD that is > 0
infinity Return a FloatD that represents positive infinity.
nan Return a FloatD that represents a mathematically indeterminate value (e.g. Inf- Inf, Inf / Inf).
negativeInfinityReturn a FloatD that represents negative infinity.
precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
1.82.3 FloatD class: converting
coerce: aNumberAnswer aNumber converted to a FloatD
1.82.4 FloatD: built ins
* arg Multiply the receiver and arg and answer another Number
+ arg Sum the receiver and arg and answer another Number
- arg Subtract arg from the receiver and answer another Number
/ arg Divide the receiver by arg and answer another FloatD
Chapter 1: Base classes 145
< arg Answer whether the receiver is less than arg
<= arg Answer whether the receiver is less than or equal to arg
= arg Answer whether the receiver is equal to arg
> arg Answer whether the receiver is greater than arg
>= arg Answer whether the receiver is greater than or equal to arg
asFloatE Answer the receiver converted to a FloatE
asFloatQ Answer the receiver converted to a FloatQ
exponent Answer the exponent of the receiver in mantissa*2^exponent representation (|mantissa|<=1 )
fractionPartAnswer the fractional part of the receiver
timesTwoPower: argAnswer the receiver multiplied by 2^arg
truncated Truncate the receiver towards zero and answer the result
~= arg Answer whether the receiver is not equal to arg
1.82.5 FloatD: coercing
asFloatD Just defined for completeness. Return the receiver.
coerce: aNumberCoerce aNumber to the receiver’s class
generality Answer the receiver’s generality
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.82.6 FloatD: converting
half Coerce 0.5 to the receiver’s class
1.83 FloatE
Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types
My instances represent floating point numbers that have the same accuracy asC’s "float" numbers.
1.83.1 FloatE class: byte-order dependancies
signByte Answer the byte of the receiver that contains the sign bit
146 GNU Smalltalk Library Reference
1.83.2 FloatE class: byte-order dependencies
fromBytes: aByteArrayAnswer a float with the bytes in aByteArray, which are in big-endian format.
1.83.3 FloatE class: characterization
decimalDigitsReturn the number of decimal digits of precision for a FloatE. Technically, ifP is the precision for the representation, then the decimal precision Q is themaximum number of decimal digits such that any floating point number withQ base 10 digits can be rounded to a floating point number with P base 2 digitsand back again, without change to the Q decimal digits.
e Returns the value of e. Hope is that it is precise enough
emax Return the maximum allowable exponent for a FloatE that is finite.
emin Return the maximum allowable exponent for a FloatE that is finite.
fmax Return the largest normalized FloatE that is not infinite.
fminNormalizedReturn the smallest normalized FloatE that is > 0
infinity Return a FloatE that represents positive infinity.
ln10 Returns the value of ln 10. Hope is that it is precise enough
log10Base2Returns the value of log2 10. Hope is that it is precise enough
nan Return a FloatE that represents a mathematically indeterminate value (e.g. Inf- Inf, Inf / Inf).
negativeInfinityReturn a FloatE that represents negative infinity.
pi Returns the value of pi. Hope is that it is precise enough
precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
1.83.4 FloatE class: converting
coerce: aNumberAnswer aNumber converted to a FloatE
1.83.5 FloatE: built ins
* arg Multiply the receiver and arg and answer another Number
+ arg Sum the receiver and arg and answer another Number
- arg Subtract arg from the receiver and answer another Number
/ arg Divide the receiver by arg and answer another FloatE
< arg Answer whether the receiver is less than arg
Chapter 1: Base classes 147
<= arg Answer whether the receiver is less than or equal to arg
= arg Answer whether the receiver is equal to arg
> arg Answer whether the receiver is greater than arg
>= arg Answer whether the receiver is greater than or equal to arg
asFloatD Answer the receiver converted to a FloatD
asFloatQ Answer the receiver converted to a FloatQ
exponent Answer the exponent of the receiver in mantissa*2^exponent representation (|mantissa|<=1 )
fractionPartAnswer the fractional part of the receiver
timesTwoPower: argAnswer the receiver multiplied by 2^arg
truncated Truncate the receiver towards zero and answer the result
~= arg Answer whether the receiver is not equal to arg
1.83.6 FloatE: coercing
asFloatE Just defined for completeness. Return the receiver.
coerce: aNumberCoerce aNumber to the receiver’s class
generality Answer the receiver’s generality
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.83.7 FloatE: converting
half Coerce 0.5 to the receiver’s class
1.84 FloatQ
Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types
My instances represent floating point numbers that have the same accuracy asC’s "long double" numbers.
1.84.1 FloatQ class: byte-order dependancies
signByte Answer the byte of the receiver that contains the sign bit
148 GNU Smalltalk Library Reference
1.84.2 FloatQ class: characterization
decimalDigitsReturn the number of decimal digits of precision for a FloatQ. Technically, ifP is the precision for the representation, then the decimal precision Q is themaximum number of decimal digits such that any floating point number withQ base 10 digits can be rounded to a floating point number with P base 2 digitsand back again, without change to the Q decimal digits.
e Returns the value of e. Hope is that it is precise enough
emax Return the maximum allowable exponent for a FloatQ that is finite.
emin Return the maximum allowable exponent for a FloatQ that is finite.
fmax Return the largest normalized FloatQ that is not infinite.
fminNormalizedReturn the smallest normalized FloatQ that is > 0
infinity Return a FloatQ that represents positive infinity.
ln10 Returns the value of ln 10. Hope is that it is precise enough
log10Base2Returns the value of log2 10. Hope is that it is precise enough
nan Return a FloatQ that represents a mathematically indeterminate value (e.g. Inf- Inf, Inf / Inf).
negativeInfinityReturn a FloatQ that represents negative infinity.
pi Returns the value of pi. Hope is that it is precise enough
precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
1.84.3 FloatQ class: converting
coerce: aNumberAnswer aNumber converted to a FloatQ
1.84.4 FloatQ: built ins
* arg Multiply the receiver and arg and answer another Number
+ arg Sum the receiver and arg and answer another Number
- arg Subtract arg from the receiver and answer another Number
/ arg Divide the receiver by arg and answer another FloatQ
< arg Answer whether the receiver is less than arg
<= arg Answer whether the receiver is less than or equal to arg
= arg Answer whether the receiver is equal to arg
> arg Answer whether the receiver is greater than arg
Chapter 1: Base classes 149
>= arg Answer whether the receiver is greater than or equal to arg
asFloatD Answer the receiver converted to a FloatD
asFloatE Answer the receiver converted to a FloatE
exponent Answer the exponent of the receiver in mantissa*2^exponent representation (|mantissa|<=1 )
fractionPartAnswer the fractional part of the receiver
timesTwoPower: argAnswer the receiver multiplied by 2^arg
truncated Truncate the receiver towards zero and answer the result
~= arg Answer whether the receiver is not equal to arg
1.84.5 FloatQ: coercing
asFloatQ Just defined for completeness. Return the receiver.
coerce: aNumberCoerce aNumber to the receiver’s class
generality Answer the receiver’s generality
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.84.6 FloatQ: converting
half Coerce 0.5 to the receiver’s class
1.85 Fraction
Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types
I represent rational numbers in the form (p/q) where p and q are integers. Thearithmetic operations *, +, -, /, on fractions, all return a reduced fraction.
1.85.1 Fraction class: converting
coerce: aNumberAnswer aNumber converted to a Fraction
1.85.2 Fraction class: instance creation
initialize Initialize the receiver’s class variables
numerator: nInteger denominator: dIntegerAnswer a new instance of fraction (nInteger/dInteger)
150 GNU Smalltalk Library Reference
1.85.3 Fraction: accessing
denominatorAnswer the receiver’s denominator
numerator Answer the receiver’s numerator
1.85.4 Fraction: arithmetic
* aNumberMultiply two numbers and answer the result.
+ aNumberSum two numbers and answer the result.
- aNumberSubtract aNumber from the receiver and answer the result.
/ aNumberDivide the receiver by aNumber and answer the result.
// aNumberReturn the integer quotient of dividing the receiver by aNumber with truncationtowards negative infinity.
\\ aNumberReturn the remainder from dividing the receiver by aNumber, (using //).
estimatedLogAnswer an estimate of (self abs floorLog: 10)
1.85.5 Fraction: coercing
ceiling Truncate the receiver towards positive infinity and return the truncated result
coerce: aNumberCoerce aNumber to the receiver’s class
floor Truncate the receiver towards negative infinity and return the truncated result
generality Return the receiver’s generality
truncated Truncate the receiver and return the truncated result
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.85.6 Fraction: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
Chapter 1: Base classes 151
1.85.7 Fraction: comparing
< arg Test if the receiver is less than arg.
<= arg Test if the receiver is less than or equal to arg.
= arg Test if the receiver equals arg.
> arg Test if the receiver is more than arg.
>= arg Test if the receiver is greater than or equal to arg.
hash Answer an hash value for the receiver
1.85.8 Fraction: converting
asExactFractionAnswer the receiver, it is already a Fraction
asFloatD Answer the receiver converted to a FloatD
asFloatE Answer the receiver converted to a FloatD
asFloatQ Answer the receiver converted to a FloatD
asFraction Answer the receiver, it is already a Fraction
integerPartAnswer the integer part of the receiver, expressed as a Fraction
1.85.9 Fraction: optimized cases
negated Return the receiver, with its sign changed.
raisedToInteger: anIntegerReturn self raised to the anInteger-th power.
reciprocal Return the reciprocal of the receiver
sqrt Return the square root of the receiver.
squared Return the square of the receiver.
1.85.10 Fraction: printing
printOn: aStreamPrint a representation of the receiver on aStream
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.85.11 Fraction: testing
isRational Answer whether the receiver is rational - true
152 GNU Smalltalk Library Reference
1.86 Generator
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Generators
A Generator object provides a way to use blocks to define a Stream of manyreturn values. The return values are computed one at a time, as needed, andhence need not even be finite.
A generator block is converted to a Generator with "Generator on: [...]". TheGenerator itself is passed to the block, and as soon as a message like #next,#peek, #atEnd or #peekFor: is sent to the generator, execution of the blockstarts/resumes and goes on until the generator’s #yield: method is called: thenthe argument of #yield: will be the Generator’s next element. If the block goeson to the end without calling #yield:, the Generator will produce no moreelements and #atEnd will return true.
You could achieve the effect of generators manually by writing your own classand storing all the local variables of the generator as instance variables. Forexample, returning a list of integers could be done by setting a variable to0, and having the #next method increment it and return it. However, fora moderately complicated generator, writing a corresponding class would bemuch messier (and might lead to code duplication or inefficiency if you want tosupport #peek, #peekFor: and/or #atEnd): in general, providing a #do:-likeinterface is easy, but not providing a Stream-like one (think binary trees).
The idea of generators comes from other programming languages, in particularthis interface looks much like Scheme streams and Python generators. ButPython in turn mutuated the idea for example from Icon, where the idea ofgenerators is central. In Icon, every expression and function call behaves like agenerator, and if a statement manages scalars, it automatically uses up all theresults that the corresponding generator provides; on the other hand, Icon doesnot represent generators as first-class objects like Python and Smalltalk do.
1.86.1 Generator class: instance creation
inject: aValue into: aBlockReturn an infinite generator; the first item is aValue, the following items areobtained by passing the previous value to aBlock.
on: aBlockReturn a generator and pass it to aBlock. When #next is sent to the generator,the block will start execution, and will be suspended again as soon as #yield:is sent from the block to the generator.
on: aCollection do: aBlockReturn a generator; for each item of aCollection, evaluate aBlock passing thegenerator and the item.
1.86.2 Generator: stream protocol
atEnd Answer whether more data can be generated.
Chapter 1: Base classes 153
next Evaluate the generator until it generates the next value or decides that nothingelse can be generated.
peek Evaluate the generator until it generates the next value or decides that nothingelse can be generated, and save the value so that #peek or #next will returnit again.
peekFor: anObjectEvaluate the generator until it generates the next value or decides that nothingelse can be generated, and if it is not equal to anObject, save the value so that#peek or #next will return it again.
yield: anObjectWhen entering from the generator the code in the block is executed and controlflow goes back to the consumer. When entering from the consumer, the codeafter the continuation is executed, which resumes execution of the generatorblock.
1.87 Getopt
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
This class is usually not instantiated. Class methods provide a way to parsecommand lines from Smalltalk.
1.87.1 Getopt class: instance creation
parse: args with: pattern do: actionBlockParse the command-line arguments in args according to the syntax specifiedin pattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. For filenames (or in general, other command-line arguments than options) the block’sfirst argument will be nil. For options without arguments, or with unspecifiedoptional arguments, the block’s second argument will be nil. The option namewill be passed as a character object for short options, and as a string for longoptions.
If an error is found, nil is returned. For more information on the syntax ofpattern, see #parse:with:do:ifError:.
parse: args with: pattern do: actionBlock ifError: errorBlockParse the command-line arguments in args according to the syntax specifiedin pattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. For filenames (or in general, other command-line arguments than options) the block’sfirst argument will be nil. For options without arguments, or with unspecifiedoptional arguments, the block’s second argument will be nil. The option namewill be passed as a character object for short options, and as a string for longoptions.
154 GNU Smalltalk Library Reference
If an error is found, the parsing is interrupted, errorBlock is evaluated, and thereturned value is answered.
Every whitespace-separated part (‘word’) of pattern specifies a command-lineoption. If a word ends with a colon, the option will have a mandatory argument.If a word ends with two colons, the option will have an optional argument.Before the colons, multiple option names (either short names like ‘-l’ or longnames like ‘–long’) can be specified. Before passing the option to actionBlock,the name will be canonicalized to the last one.
Prefixes of long options are accepted as long as they’re unique, and they arecanonicalized to the full name before passing it to actionBlock. Additionally,the full name of an option is accepted even if it is the prefix of a longer option.
Mandatory arguments can appear in the next argument, or in the same argu-ment (separated by an = for arguments to long options). Optional argumentsmust appear in the same argument.
1.88 Halt
Defined in namespace SmalltalkSuperclass: ExceptionCategory: Language-Exceptions
Halt represents a resumable error, usually a bug.
1.88.1 Halt: description
descriptionAnswer a textual description of the exception.
isResumableAnswer true. #halt exceptions are by default resumable.
1.89 HashedCollection
Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Unordered
I am an hashed collection that can store objects uniquely and give fast responseson their presence in the collection.
1.89.1 HashedCollection class: instance creation
new Answer a new instance of the receiver with a default size
new: anIntegerAnswer a new instance of the receiver with the given capacity
withAll: aCollectionAnswer a collection whose elements are all those in aCollection
Chapter 1: Base classes 155
1.89.2 HashedCollection: accessing
add: newObjectAdd newObject to the set, if and only if the set doesn’t already contain anoccurrence of it. Don’t fail if a duplicate is found. Answer anObject
at: index This method should not be called for instances of this class.
at: index put: valueThis method should not be called for instances of this class.
1.89.3 HashedCollection: builtins
primAt: anIndexPrivate - Answer the anIndex-th item of the hash table for the receiver. Usingthis instead of basicAt: allows for easier changes in the representation
primAt: anIndex put: valuePrivate - Store value in the anIndex-th item of the hash table for the receiver.Using this instead of basicAt:put: allows for easier changes in the representation
primSize Private - Answer the size of the hash table for the receiver. Using this insteadof basicSize allows for easier changes in the representation
1.89.4 HashedCollection: copying
deepCopy Returns a deep copy of the receiver (the instance variables are copies of thereceiver’s instance variables)
shallowCopyReturns a shallow copy of the receiver (the instance variables are not copied)
1.89.5 HashedCollection: enumerating the elements of a collection
do: aBlockEnumerate all the non-nil members of the set
1.89.6 HashedCollection: rehashing
rehash Rehash the receiver
1.89.7 HashedCollection: removing
remove: oldObject ifAbsent: anExceptionBlockRemove oldObject from the set. If it is found, answer oldObject. Otherwise,evaluate anExceptionBlock and answer its value.
1.89.8 HashedCollection: saving and loading
postLoad Called after loading an object; rehash the collection because identity objectswill most likely mutate their hashes.
postStore Called after an object is dumped. Do nothing – necessary because by defaultthis calls #postLoad by default
156 GNU Smalltalk Library Reference
1.89.9 HashedCollection: storing
storeOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
1.89.10 HashedCollection: testing collections
= aHashedCollectionReturns true if the two sets have the same membership, false if not
capacity Answer how many elements the receiver can hold before having to grow.
hash Return the hash code for the members of the set. Since order is unimportant,we use a commutative operator to compute the hash value.
includes: anObjectAnswer whether the receiver contains an instance of anObject.
isEmpty Answer whether the receiver is empty.
occurrencesOf: anObjectReturn the number of occurrences of anObject. Since we’re a set, this is either0 or 1. Nil is never directly in the set, so we special case it (the result is always1).
size Answer the receiver’s size
1.90 HomedAssociation
Defined in namespace SmalltalkSuperclass: AssociationCategory: Language-Data types
My instances represent know about their parent namespace, which is of usewhen implementing weak collections and finalizations.
1.90.1 HomedAssociation class: basic
key: aKey value: aValue environment: aNamespaceAnswer a new association with the given key and value
1.90.2 HomedAssociation: accessing
environmentAnswer the namespace in which I live.
environment: aNamespaceSet the namespace in which I live to be aNamespace.
1.90.3 HomedAssociation: finalization
mourn This message is sent to the receiver when the object is made ephemeron (whichis common when HomedAssociations are used by a WeakKeyDictionary or aWeakSet). The mourning of the object’s key is first of all demanded to the en-vironment (which will likely remove the object from itself), and then performedas usual by clearing the key and value fields.
Chapter 1: Base classes 157
1.90.4 HomedAssociation: storing
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
1.91 IdentityDictionary
Defined in namespace SmalltalkSuperclass: LookupTableCategory: Collections-Keyed
I am similar to LookupTable, except that I use the object identity comparisionmessage == to determine equivalence of indices.
1.92 IdentitySet
Defined in namespace SmalltalkSuperclass: SetCategory: Collections-Unordered
I am the typical set object; I can store any objects uniquely. I use the ==operator to determine duplication of objects.
1.92.1 IdentitySet: testing
identityIncludes: anObjectAnswer whether we include the anObject object; for IdentitySets this is identicalto #includes:
1.93 Integer
Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types
I am the abstract integer class of the GNU Smalltalk system. My subclasses’instances can represent signed integers of various sizes (a subclass is pickedaccording to the size), with varying efficiency.
1.93.1 Integer class: converting
coerce: aNumberAnswer aNumber converted to a kind of Integer
1.93.2 Integer: accessing
denominatorAnswer ‘1’.
numerator Answer the receiver.
1.93.3 Integer: basic
hash Answer an hash value for the receiver
158 GNU Smalltalk Library Reference
1.93.4 Integer: bit operators
allMask: anIntegerTrue if all 1 bits in anInteger are 1 in the receiver
anyMask: anIntegerTrue if any 1 bits in anInteger are 1 in the receiver
bitAt: indexAnswer the index-th bit of the receiver (the LSB has an index of 1)
bitAt: index put: valueAnswer an integer which is identical to the receiver, possibly with the exceptionof the index-th bit of the receiver (the LSB having an index of 1), which assumesa value equal to the low-order bit of the second parameter.
bitClear: aMaskAnswer an Integer equal to the receiver, except that all the bits that are set inaMask are cleared.
bitInvert Return the 1’s complement of the bits of the receiver
clearBit: indexClear the index-th bit of the receiver and answer a new Integer
digitAt: indexAnswer the index-th base-256 digit of the receiver (byte), expressed in two’scomplement
highBit Return the index of the highest order 1 bit of the receiver.
isBitSet: indexAnswer whether the index-th bit of the receiver is set
lowBit Return the index of the lowest order 1 bit of the receiver.
noMask: anIntegerAnswer true if no 1 bits in anInteger are 1 in the receiver.
setBit: indexSet the index-th bit of the receiver and answer a new Integer
1.93.5 Integer: converting
asCharacterReturn self as a Character or UnicodeCharacter object.
asFraction Return the receiver converted to a fraction
asScaledDecimal: nAnswer the receiver, converted to a ScaledDecimal object. The scale is forcedto be 0.
ceiling Return the receiver - it’s already truncated
coerce: aNumberCoerce aNumber to the receiver’s class.
Chapter 1: Base classes 159
floor Return the receiver - it’s already truncated
rounded Return the receiver - it’s already truncated
truncated Return the receiver - it’s already truncated
1.93.6 Integer: extension
alignTo: anIntegerAnswer the receiver, truncated to the first higher or equal multiple of anInteger(which must be a power of two)
1.93.7 Integer: iterators
timesRepeat: aBlockEvaluate aBlock a number of times equal to the receiver’s value. Compiledin-line for no argument aBlocks without temporaries, and therefore not over-ridable.
1.93.8 Integer: math methods
binomial: anIntegerCompute the number of combinations of anInteger objects among a number ofobjects given by the receiver.
ceilingLog: radixAnswer (self log: radix) ceiling. Optimized to answer an integer.
estimatedLogAnswer an estimate of (self abs floorLog: 10)
even Return whether the receiver is even
factorial Return the receiver’s factorial.
floorLog: radixAnswer (self log: radix) floor. Optimized to answer an integer.
gcd: anIntegerReturn the greatest common divisor (Euclid’s algorithm) between the receiverand anInteger
lcm: anIntegerReturn the least common multiple between the receiver and anInteger
odd Return whether the receiver is odd
1.93.9 Integer: printing
displayOn: aStreamPrint on aStream the base 10 representation of the receiver
displayStringReturn the base 10 representation of the receiver
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
160 GNU Smalltalk Library Reference
printOn: aStreamPrint on aStream the base 10 representation of the receiver
printOn: aStream base: bPrint on aStream the base b representation of the receiver
printOn: aStream paddedWith: padding to: sizePrint on aStream the base 10 representation of the receiver, padded if necessaryto size characters with copies of padding.
printOn: aStream paddedWith: padding to: size base: baseIntegerPrint on aStream the base b representation of the receiver, padded if necessaryto size characters with copies of padding.
printPaddedWith: padding to: sizeReturn the base baseInteger representation of the receiver, padded if necessaryto size characters with copies of padding.
printPaddedWith: padding to: size base: baseIntegerReturn the base baseInteger representation of the receiver, padded if necessaryto size characters with copies of padding.
printStringReturn the base 10 representation of the receiver
printString: baseIntegerReturn the base baseInteger representation of the receiver
printStringRadix: baseIntegerReturn the base baseInteger representation of the receiver, with BBr in frontof it
radix: baseIntegerReturn the base baseInteger representation of the receiver, with BBr in frontof it. This method is deprecated, use #printStringRadix: instead.
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStream base: bPrint on aStream Smalltalk code compiling to the receiver, represented in baseb
1.93.10 Integer: storing
storeOn: aStreamPrint on aStream the base 10 representation of the receiver
storeStringReturn the base 10 representation of the receiver
1.93.11 Integer: testing functionality
isInteger Answer ‘true’.
isRational Answer whether the receiver is rational - true
Chapter 1: Base classes 161
1.94 Interval
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable
My instances represent ranges of objects, typically Number type objects. Iprovide iteration/enumeration messages for producing all the members thatmy instance represents.
1.94.1 Interval class: instance creation
from: startInteger to: stopIntegerAnswer an Interval going from startInteger to the stopInteger, with a step of 1
from: startInteger to: stopInteger by: stepIntegerAnswer an Interval going from startInteger to the stopInteger, with a step ofstepInteger
withAll: aCollectionAnswer an Interval containing the same elements as aCollection. Fail if it isnot possible to create one.
1.94.2 Interval: basic
at: index Answer the index-th element of the receiver.
at: index put: anObjectThis method should not be called for instances of this class.
collect: aBlockEvaluate the receiver for each element in aBlock, collect in an array the resultof the evaluations.
copyFrom: startIndex to: stopIndexNot commented.
do: aBlockEvaluate the receiver for each element in aBlock
isEmpty Answer whether the receiver is empty.
reverse Answer a copy of the receiver with all of its items reversed
size Answer the number of elements in the receiver.
species Answer ‘Array’.
1.94.3 Interval: printing
first Not commented.
increment Answer ‘step’.
last Answer the last value.
printOn: aStreamPrint a representation for the receiver on aStream
162 GNU Smalltalk Library Reference
1.94.4 Interval: storing
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.94.5 Interval: testing
= anIntervalAnswer whether anInterval is the same interval as the receiver
hash Answer an hash value for the receiver
isExact Answer whether elements of the receiver are computed using exact arithmetic.This is true as long as the start and step value are exact (i.e. not floating-point).
1.95 Iterable
Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections
I am an abstract class. My instances are collections of objects that can beiterated. The details on how they can be mutated (if at all possible) are left tothe subclasses.
1.95.1 Iterable class: multibyte encodings
isUnicode Answer true; the receiver is able to store arbitrary Unicode characters.
1.95.2 Iterable: enumeration
, anIterableAnswer an iterable that enumerates first the elements of the receiver and thenthe elements of anIterable.
allSatisfy: aBlockSearch the receiver for an element for which aBlock returns false. Answer trueif none does, false otherwise.
anySatisfy: aBlockSearch the receiver for an element for which aBlock returns true. Answer trueif some does, false otherwise.
collect: aBlockAnswer a new instance of a Collection containing all the results of evaluatingaBlock passing each of the receiver’s elements
conform: aBlockSearch the receiver for an element for which aBlock returns false. Answer trueif none does, false otherwise.
contains: aBlockSearch the receiver for an element for which aBlock returns true. Answer trueif some does, false otherwise.
Chapter 1: Base classes 163
count: aBlockCount the elements of the receiver for which aBlock returns true, and returntheir number.
detect: aBlockSearch the receiver for an element for which aBlock returns true. If some does,answer it. If none does, fail
detect: aBlock ifNone: exceptionBlockSearch the receiver for an element for which aBlock returns true. If some does,answer it. If none does, answer the result of evaluating aBlock
do: aBlockEnumerate each object of the receiver, passing them to aBlock
do: aBlock separatedBy: separatorBlockEnumerate each object of the receiver, passing them to aBlock. Between everytwo invocations of aBlock, invoke separatorBlock
fold: binaryBlockFirst, pass to binaryBlock the first and second elements of the receiver; for eachsubsequent element, pass the result of the previous evaluation and an element.Answer the result of the last invocation, or the first element if the collectionhas size 1. Fail if the collection is empty.
inject: thisValue into: binaryBlockFirst, pass to binaryBlock thisValue and the first element of the receiver; foreach subsequent element, pass the result of the previous evaluation and anelement. Answer the result of the last invocation.
noneSatisfy: aBlockSearch the receiver for an element for which aBlock returns true. Answer trueif none does, false otherwise.
reject: aBlockAnswer a new instance of a Collection containing all the elements in the receiverwhich, when passed to aBlock, don’t answer true
select: aBlockAnswer a new instance of a Collection containing all the elements in the receiverwhich, when passed to aBlock, answer true
1.95.3 Iterable: iteration
ifNil: nilBlock ifNotNilDo: iterableBlockEvaluate nilBlock if the receiver is nil, else evaluate iterableBlock with eachelement of the receiver (which should be an Iterable).
ifNotNilDo: iterableBlockEvaluate iterableBlock with each element of the receiver (which should be anIterable) if not nil. Else answer nil
ifNotNilDo: iterableBlock ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else evaluate iterableBlock, passing eachelement of the receiver (which should be an Iterable).
164 GNU Smalltalk Library Reference
1.95.4 Iterable: streaming
nextPutAllOn: aStreamWrite all the objects in the receiver to aStream
readStreamReturn a stream with the same contents as the receiver.
1.96 LargeArray
Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable
I am similar to a plain array, but I’m specially designed to save memory whenlots of items are nil.
1.96.1 LargeArray: overridden
newCollection: sizeCreate an Array of the given size
1.97 LargeArrayedCollection
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable
I am an abstract class specially designed to save memory when lots of itemshave the same value.
1.97.1 LargeArrayedCollection class: instance creation
new: anIntegerAnswer a new instance of the receiver, with room for anInteger elements.
1.97.2 LargeArrayedCollection: accessing
at: anIndexAnswer the anIndex-th item of the receiver.
at: anIndex put: anObjectReplace the anIndex-th item of the receiver with anObject.
compress Arrange the representation of the array for maximum memory saving.
1.97.3 LargeArrayedCollection: basic
= aLargeArrayAnswer whether the receiver and aLargeArray have the same contents
hash Answer an hash value for the receiver
size Answer the maximum valid index for the receiver
Chapter 1: Base classes 165
1.98 LargeByteArray
Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable
I am similar to a plain ByteArray, but I’m specially designed to save memorywhen lots of items are zero.
1.98.1 LargeByteArray: overridden
costOfNewIndexAnswer the maximum number of consecutive items set to the defaultElementthat can be present in a compressed array.
defaultElementAnswer the value which is hoped to be the most common in the array
newCollection: sizeCreate a ByteArray of the given size
1.99 LargeInteger
Defined in namespace SmalltalkSuperclass: IntegerCategory: Language-Data types
I represent a large integer, which has to be stored as a long sequence of bytes.I have methods to do arithmetics and comparisons, but I need some help frommy children, LargePositiveInteger and LargeNegativeInteger, to speed them upa bit.
1.99.1 LargeInteger: accessing
raisedToInteger: nReturn self raised to the anInteger-th power
1.99.2 LargeInteger: arithmetic
* aNumberMultiply aNumber and the receiver, answer the result
+ aNumberSum the receiver and aNumber, answer the result
- aNumberSubtract aNumber from the receiver, answer the result
/ aNumberDivide aNumber and the receiver, answer the result (an Integer or Fraction)
// aNumberDivide aNumber and the receiver, answer the result truncated towards -infinity
166 GNU Smalltalk Library Reference
\\ aNumberDivide aNumber and the receiver, answer the remainder truncated towards -infinity
divExact: aNumberDividing receiver by arg assuming that the remainder is zero, and answer theresult
estimatedLogAnswer an estimate of (self abs floorLog: 10)
negated Answer the receiver’s negated
quo: aNumberDivide aNumber and the receiver, answer the result truncated towards 0
rem: aNumberDivide aNumber and the receiver, answer the remainder truncated towards 0
1.99.3 LargeInteger: bit operations
bitAnd: aNumberAnswer the receiver ANDed with aNumber
bitAt: aNumberAnswer the aNumber-th bit in the receiver, where the LSB is 1
bitInvert Answer the receiver’s 1’s complement
bitOr: aNumberAnswer the receiver ORed with aNumber
bitShift: aNumberAnswer the receiver shifted by aNumber places
bitXor: aNumberAnswer the receiver XORed with aNumber
lowBit Return the index of the lowest order 1 bit of the receiver.
1.99.4 LargeInteger: built-ins
at: anIndexAnswer the anIndex-th byte in the receiver’s representation
at: anIndex put: aNumberSet the anIndex-th byte in the receiver’s representation
digitAt: anIndexAnswer the index-th base-256 digit of the receiver (byte), expressed in two’scomplement
digitAt: anIndex put: aNumberSet the anIndex-th base-256 digit in the receiver’s representation
digitLengthAnswer the number of base-256 digits in the receiver
Chapter 1: Base classes 167
hash Answer an hash value for the receiver
primReplaceFrom: start to: stop with: replacementString startingAt: replaceStartPrivate - Replace the characters from start to stop with new characters con-tained in replacementString (which, actually, can be any variable byte class),starting at the replaceStart location of replacementString
size Answer the number of indexed instance variable in the receiver
1.99.5 LargeInteger: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
coerce: aNumberTruncate the number; if needed, convert it to LargeInteger representation.
generality Answer the receiver’s generality
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.99.6 LargeInteger: disabled
asObject This method always fails. The number of OOPs is far less than the minimumnumber represented with a LargeInteger.
asObjectNoFailAnswer ‘nil’.
1.99.7 LargeInteger: primitive operations
basicLeftShift: totalShiftPrivate - Left shift the receiver by aNumber places
basicRightShift: totalShiftPrivate - Right shift the receiver by ’shift’ places
largeNegatedPrivate - Same as negated, but always answer a LargeInteger
1.99.8 LargeInteger: testing
< aNumberAnswer whether the receiver is smaller than aNumber
<= aNumberAnswer whether the receiver is smaller than aNumber or equal to it
= aNumberAnswer whether the receiver and aNumber identify the same number.
> aNumberAnswer whether the receiver is greater than aNumber
168 GNU Smalltalk Library Reference
>= aNumberAnswer whether the receiver is greater than aNumber or equal to it
~= aNumberAnswer whether the receiver and aNumber identify different numbers.
1.100 LargeNegativeInteger
Defined in namespace SmalltalkSuperclass: LargeIntegerCategory: Language-Data types
Just like my brother LargePositiveInteger, I provide a few methods that allowLargeInteger to determine the sign of a large integer in a fast way during itscalculations. For example, I know that I am smaller than any LargePositiveIn-teger
1.100.1 LargeNegativeInteger: converting
asFloatD Answer the receiver converted to a FloatD
asFloatE Answer the receiver converted to a FloatE
asFloatQ Answer the receiver converted to a FloatQ
1.100.2 LargeNegativeInteger: numeric testing
abs Answer the receiver’s absolute value.
negative Answer whether the receiver is < 0
positive Answer whether the receiver is >= 0
sign Answer the receiver’s sign
strictlyPositiveAnswer whether the receiver is > 0
1.100.3 LargeNegativeInteger: reverting to LargePositiveInteger
+ aNumberSum the receiver and aNumber, answer the result
- aNumberSubtract aNumber from the receiver, answer the result
gcd: anIntegerReturn the greatest common divisor between the receiver and anInteger
highBit Answer the receiver’s highest bit’s index
Chapter 1: Base classes 169
1.101 LargePositiveInteger
Defined in namespace SmalltalkSuperclass: LargeIntegerCategory: Language-Data types
Just like my brother LargeNegativeInteger, I provide a few methods that allowLargeInteger to determine the sign of a large integer in a fast way during its cal-culations. For example, I know that I am larger than any LargeNegativeInteger.In addition I implement the guts of arbitrary precision arithmetic.
1.101.1 LargePositiveInteger: arithmetic
+ aNumberSum the receiver and aNumber, answer the result
- aNumberSubtract aNumber from the receiver, answer the result
gcd: anIntegerCalculate the GCD between the receiver and anInteger
highBit Answer the receiver’s highest bit’s index
1.101.2 LargePositiveInteger: converting
asFloatD Answer the receiver converted to a FloatD
asFloatE Answer the receiver converted to a FloatE
asFloatQ Answer the receiver converted to a FloatQ
replace: str withStringBase: radixReturn in a String str the base radix representation of the receiver.
1.101.3 LargePositiveInteger: helper byte-level methods
bytes: byteArray1 from: j compare: byteArray2Private - Answer the sign of byteArray2 - byteArray1; the j-th byte of byteAr-ray1 is compared with the first of byteArray2, the j+1-th with the second, andso on.
bytes: byteArray1 from: j subtract: byteArray2Private - Sutract the bytes in byteArray2 from those in byteArray1
bytes: bytes multiply: anIntegerPrivate - Multiply the bytes in bytes by anInteger, which must be < 255. Putthe result back in bytes.
bytesLeftShift: aByteArrayPrivate - Left shift by 1 place the bytes in aByteArray
bytesLeftShift: aByteArray big: totalShiftPrivate - Left shift the bytes in aByteArray by totalShift places
bytesLeftShift: aByteArray n: shiftPrivate - Left shift by shift places the bytes in aByteArray (shift <= 7)
170 GNU Smalltalk Library Reference
bytesRightShift: aByteArray big: totalShiftPrivate - Right shift the bytes in aByteArray by totalShift places
bytesRightShift: bytes n: aNumberPrivate - Right shift the bytes in ‘bytes’ by ’aNumber’ places (shift <= 7)
bytesTrailingZeros: bytesPrivate - Answer the number of trailing zero bits in the receiver
primDivide: rhsPrivate - Implements Knuth’s divide and correct algorithm from ‘SeminumericalAlgorithms’ 3rd Edition, section 4.3.1 (which is basically an enhanced version ofthe divide ‘algorithm’ for two-digit divisors which is taught in primary school!!!)
1.101.4 LargePositiveInteger: numeric testing
abs Answer the receiver’s absolute value
negative Answer whether the receiver is < 0
positive Answer whether the receiver is >= 0
sign Answer the receiver’s sign
strictlyPositiveAnswer whether the receiver is > 0
1.101.5 LargePositiveInteger: primitive operations
divide: aNumber using: aBlockPrivate - Divide the receiver by aNumber (unsigned division). Evaluate aBlockpassing the result ByteArray, the remainder ByteArray, and whether the divi-sion had a remainder
isSmall Private - Answer whether the receiver is small enough to employ simple scalaralgorithms for division and multiplication
multiply: aNumberPrivate - Multiply the receiver by aNumber (unsigned multiply)
1.102 LargeWordArray
Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable
I am similar to a plain WordArray, but I’m specially designed to save memorywhen lots of items are zero.
1.102.1 LargeWordArray: overridden
defaultElementAnswer the value which is hoped to be the most common in the array
newCollection: sizeCreate a WordArray of the given size
Chapter 1: Base classes 171
1.103 LargeZeroInteger
Defined in namespace SmalltalkSuperclass: LargePositiveIntegerCategory: Language-Data types
I am quite a strange class. Indeed, the concept of a "large integer" that iszero is a weird one. Actually my only instance is zero but is represented likeLargeIntegers, has the same generality as LargeIntegers, and so on. That onlyinstance is stored in the class variable Zero, and is used in arithmetical methods,when we have to coerce a parameter that is zero.
1.103.1 LargeZeroInteger: accessing
at: anIndexAnswer ‘0’.
hash Answer ‘0’.
size Answer ‘0’.
1.103.2 LargeZeroInteger: arithmetic
* aNumberMultiply aNumber and the receiver, answer the result
+ aNumberSum the receiver and aNumber, answer the result
- aNumberSubtract aNumber from the receiver, answer the result
/ aNumberDivide aNumber and the receiver, answer the result (an Integer or Fraction)
// aNumberDivide aNumber and the receiver, answer the result truncated towards -infinity
\\ aNumberDivide aNumber and the receiver, answer the remainder truncated towards -infinity
quo: aNumberDivide aNumber and the receiver, answer the result truncated towards 0
rem: aNumberDivide aNumber and the receiver, answer the remainder truncated towards 0
1.103.3 LargeZeroInteger: numeric testing
sign Answer the receiver’s sign
strictlyPositiveAnswer whether the receiver is > 0
172 GNU Smalltalk Library Reference
1.103.4 LargeZeroInteger: printing
replace: str withStringBase: radixReturn in a string the base radix representation of the receiver.
1.104 Link
Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections-Sequenceable
I represent simple linked lists. Generally, I am not used by myself, but rather asubclass adds other instance variables that hold the information for each node,and I hold the glue that keeps them together.
1.104.1 Link class: instance creation
nextLink: aLinkCreate an instance with the given next link
1.104.2 Link: basic
nextLink Answer the next item in the list
nextLink: aLinkSet the next item in the list
1.104.3 Link: iteration
at: index Retrieve a node (instance of Link) that is at a distance of ‘index’ after thereceiver.
at: index put: objectThis method should not be called for instances of this class.
do: aBlockEvaluate aBlock for each element in the list
size Answer the number of elements in the list. Warning: this is O(n)
1.105 LinkedList
Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable
I provide methods that access and manipulate linked lists. I assume that theelements of the linked list are subclasses of Link, because I use the methodsthat class Link supplies to implement my methods.
1.105.1 LinkedList: accessing
at: index Return the element that is index into the linked list.
at: index put: objectThis method should not be called for instances of this class.
Chapter 1: Base classes 173
1.105.2 LinkedList: adding
add: aLinkAdd aLink at the end of the list; return aLink.
addFirst: aLinkAdd aLink at the head of the list; return aLink.
addLast: aLinkAdd aLink at then end of the list; return aLink.
remove: aLink ifAbsent: aBlockRemove aLink from the list and return it, or invoke aBlock if it’s not found inthe list.
removeFirstRemove the first element from the list and return it, or error if the list is empty.
removeLastRemove the final element from the list and return it, or error if the list is empty.
1.105.3 LinkedList: enumerating
do: aBlockEnumerate each object in the list, passing it to aBlock (actual behavior mightdepend on the subclass of Link that is being used).
identityIncludes: anObjectAnswer whether we include the anObject object
includes: anObjectAnswer whether we include anObject
1.105.4 LinkedList: iteration
first Retrieve the first element of the list and return it, or error if the list is empty.
last Retrieve the last element of the list and return it, or error if the list is empty.
1.105.5 LinkedList: testing
isEmpty Returns true if the list contains no members
notEmpty Returns true if the list contains at least a member
size Answer the number of elements in the list. Warning: this is O(n)
1.106 LookupKey
Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types
I represent a key for looking up entries in a data structure. Subclasses of me,such as Association, typically represent dictionary entries.
174 GNU Smalltalk Library Reference
1.106.1 LookupKey class: basic
key: aKey Answer a new instance of the receiver with the given key and value
1.106.2 LookupKey: accessing
key Answer the receiver’s key
key: aKey Set the receiver’s key to aKey
1.106.3 LookupKey: printing
printOn: aStreamPut on aStream a representation of the receiver
1.106.4 LookupKey: storing
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
1.106.5 LookupKey: testing
< aLookupKeyAnswer whether the receiver’s key is less than aLookupKey’s
= aLookupKeyAnswer whether the receiver’s key and value are the same as aLookupKey’s, orfalse if aLookupKey is not an instance of the receiver
hash Answer an hash value for the receiver
1.107 LookupTable
Defined in namespace SmalltalkSuperclass: DictionaryCategory: Collections-Keyed
I am a more efficient variant of Dictionary that cannot be used as a pool dic-tionary of variables, as I don’t use Associations to store key-value pairs. I alsocannot have nil as a key; if you need to be able to store nil as a key, use Dictio-nary instead. I use the object equality comparison message #= to determineequivalence of indices.
1.107.1 LookupTable class: instance creation
new Create a new LookupTable with a default size
1.107.2 LookupTable: accessing
add: anAssociationAdd the anAssociation key to the receiver
associationAt: key ifAbsent: aBlockAnswer the key/value Association for the given key. Evaluate aBlock (answeringthe result) if the key is not found
Chapter 1: Base classes 175
at: key ifAbsent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
at: aKey ifPresent: aBlockIf aKey is absent, answer nil. Else, evaluate aBlock passing the associated valueand answer the result of the invocation
at: key put: valueStore value as associated to the given key
1.107.3 LookupTable: enumerating
associationsDo: aBlockPass each association in the LookupTable to aBlock.
do: aBlockPass each value in the LookupTable to aBlock.
keysAndValuesDo: aBlockPass each key/value pair in the LookupTable as two distinct parameters toaBlock.
keysDo: aBlockPass each key in the LookupTable to aBlock.
1.107.4 LookupTable: hashing
hash Answer the hash value for the receiver
1.107.5 LookupTable: rehashing
rehash Rehash the receiver
1.107.6 LookupTable: removing
remove: anAssociationRemove anAssociation’s key from the dictionary
remove: anAssociation ifAbsent: aBlockRemove anAssociation’s key from the dictionary
removeKey: key ifAbsent: aBlockRemove the passed key from the LookupTable, answer the result of evaluatingaBlock if it is not found
1.107.7 LookupTable: storing
storeOn: aStreamPrint Smalltalk code compiling to the receiver on aStream
176 GNU Smalltalk Library Reference
1.108 Magnitude
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
I am an abstract class. My objects represent things that are discrete and mapto a number line. My instances can be compared with < and >.
1.108.1 Magnitude: basic
< aMagnitudeAnswer whether the receiver is less than aMagnitude
<= aMagnitudeAnswer whether the receiver is less than or equal to aMagnitude
= aMagnitudeAnswer whether the receiver is equal to aMagnitude
> aMagnitudeAnswer whether the receiver is greater than aMagnitude
>= aMagnitudeAnswer whether the receiver is greater than or equal to aMagnitude
1.108.2 Magnitude: misc methods
between: min and: maxReturns true if object is inclusively between min and max.
max: aMagnitudeReturns the greatest object between the receiver and aMagnitude
min: aMagnitudeReturns the least object between the receiver and aMagnitude
1.109 MappedCollection
Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Keyed
I represent collections of objects that are indirectly indexed by names. Thereare really two collections involved: domain and a map. The map maps betweenexternal names and indices into domain, which contains the real association.In order to work properly, the domain must be an instance of a subclass ofSequenceableCollection, and the map must be an instance of Dictionary, or ofa subclass of SequenceableCollection.
As an example of using me, consider implenting a Dictionary whose elementsare indexed. The domain would be a SequenceableCollection with n elements,the map a Dictionary associating each key to an index in the domain. To accessby key, to perform enumeration, etc. you would ask an instance of me; to accessby index, you would access the domain directly.
Chapter 1: Base classes 177
Another idea could be to implement row access or column access to a matriximplemented as a single n*m Array: the Array would be the domain, while themap would be an Interval.
1.109.1 MappedCollection class: instance creation
collection: aCollection map: aMapAnswer a new MappedCollection using the given domain (aCollection) and map
new This method should not be used; instead, use #collection:map: to createMappedCollection.
1.109.2 MappedCollection: basic
add: anObjectThis method should not be called for instances of this class.
at: key Answer the object at the given key
at: key put: valueStore value at the given key
atAll: keyCollectionAnswer a new MappedCollection that only includes the given keys. The newMappedCollection might use keyCollection or consecutive integers for the keys,depending on the map’s type. Fail if any of them is not found in the map.
collect: aBlockAnswer a Collection with the same keys as the map, where accessing a keyyields the value obtained by passing through aBlock the value accessible fromthe key in the receiver. The result need not be another MappedCollection
contents Answer a bag with the receiver’s values
copyFrom: a to: bAnswer a new collection containing all the items in the receiver from the a-thto the b-th.
do: aBlockEvaluate aBlock for each object
domain Answer the receiver’s domain
keys Answer the keys that can be used to access this collection.
keysAndValuesDo: aBlockEvaluate aBlock passing two arguments, one being a key that can be used toaccess this collection, and the other one being the value.
keysDo: aBlockEvaluate aBlock on the keys that can be used to access this collection.
map Answer the receiver’s map
reject: aBlockAnswer the objects in the domain for which aBlock returns false
178 GNU Smalltalk Library Reference
select: aBlockAnswer the objects in the domain for which aBlock returns true
size Answer the receiver’s size
1.110 Memory
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I provide access to actual machine addresses of OOPs and objects. I have noinstances; you send messages to my class to map between an object and theaddress of its OOP or object. In addition I provide direct memory access withdifferent C types (ints, chars, OOPs, floats,...).
1.110.1 Memory class: accessing
at: anAddressAccess the Smalltalk object (OOP) at the given address.
at: anAddress put: aValueStore a pointer (OOP) to the Smalltalk object identified by ‘value’ at the givenaddress.
bigEndian Answer whether we’re running on a big- or little-endian system.
charAt: anAddressAccess the C char at the given address. The value is returned as a SmalltalkCharacter.
charAt: anAddress put: aValueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given address, using sizeof(char) bytes - i.e. 1 byte.
deref: anAddressAccess the C int pointed by the given address
doubleAt: anAddressAccess the C double at the given address.
doubleAt: anAddress put: aValueStore the Smalltalk Float object identified by ‘value’, at the given address,writing it like a C double.
floatAt: anAddressAccess the C float at the given address.
floatAt: anAddress put: aValueStore the Smalltalk Float object identified by ‘value’, at the given address,writing it like a C float.
intAt: anAddressAccess the C int at the given address.
Chapter 1: Base classes 179
intAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(int) bytes.
longAt: anAddressAccess the C long int at the given address.
longAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(long) bytes.
longDoubleAt: anAddressAccess the C long double at the given address.
longDoubleAt: anAddress put: aValueStore the Smalltalk Float object identified by ‘value’, at the given address,writing it like a C long double.
shortAt: anAddressAccess the C short int at the given address.
shortAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(short) bytes.
stringAt: anAddressAccess the string pointed by the C ‘char *’ at the given given address.
stringAt: anAddress put: aValueStore the Smalltalk String object identified by ‘value’, at the given address inmemory, writing it like a *FRESHLY ALLOCATED* C string. It is the caller’sresponsibility to free it if necessary.
ucharAt: anAddress put: aValueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given address, using sizeof(char) bytes - i.e. 1 byte.
uintAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(int) bytes.
ulongAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(long) bytes.
unsignedCharAt: anAddressAccess the C unsigned char at the given address. The value is returned as aSmalltalk Character.
unsignedCharAt: anAddress put: aValueStore as a C char the Smalltalk Character or Integer object identified by ‘value’,at the given address, using sizeof(char) bytes - i.e. 1 byte.
unsignedIntAt: anAddressAccess the C unsigned int at the given address.
180 GNU Smalltalk Library Reference
unsignedIntAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(int) bytes.
unsignedLongAt: anAddressAccess the C unsigned long int at the given address.
unsignedLongAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(long) bytes.
unsignedShortAt: anAddressAccess the C unsigned short int at the given address.
unsignedShortAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(short) bytes.
ushortAt: anAddress put: aValueStore the Smalltalk Integer object identified by ‘value’, at the given address,using sizeof(short) bytes.
1.111 Message
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I represent a message send. My instances are created to hold a message that hasfailed, so that error reporting methods can examine the sender and arguments,but also to represent method attributes (like <primitive: 111> since their syntaxis isomorphic to that of a message send.
1.111.1 Message class: creating instances
selector: aSymbol argument: anObjectCreate a new Message with the given selector and argument
selector: aSymbol arguments: anArrayCreate a new Message with the given selector and arguments
1.111.2 Message: accessing
argument Answer the first of the receiver’s arguments
arguments Answer the receiver’s arguments
arguments: anArraySet the receiver’s arguments
selector Answer the receiver’s selector
selector: aSymbolSet the receiver’s selector
Chapter 1: Base classes 181
1.111.3 Message: basic
printAsAttributeOn: aStreamPrint a representation of the receiver on aStream, modeling it after the sourcecode for a attribute.
1.111.4 Message: printing
printOn: aStreamPrint a representation of the receiver on aStream
reinvokeFor: aReceiverResend to aReceiver - present for compatibility
sendTo: aReceiverResend to aReceiver
1.112 MessageNotUnderstood
Defined in namespace SmalltalkSuperclass: ErrorCategory: Language-Exceptions
MessageNotUnderstood represents an error during message lookup. Signalingit is the default action of the #doesNotUnderstand: handler
1.112.1 MessageNotUnderstood: accessing
message Answer the message that wasn’t understood
receiver Answer the object to whom the message send was directed
1.112.2 MessageNotUnderstood: description
descriptionAnswer a textual description of the exception.
isResumableAnswer true. #doesNotUnderstand: exceptions are by default resumable.
1.113 Metaclass
Defined in namespace SmalltalkSuperclass: ClassDescriptionCategory: Language-Implementation
I am the root of the class hierarchy. My instances are metaclasses, one for eachreal class. My instances have a single instance, which they hold onto, whichis the class that they are the metaclass of. I provide methods for creationof actual class objects from metaclass object, and the creation of metaclassobjects, which are my instances. If this is confusing to you, it should be...theSmalltalk metaclass system is strange and complex.
182 GNU Smalltalk Library Reference
1.113.1 Metaclass class: instance creation
subclassOf: superMetaAnswer a new metaclass representing a subclass of superMeta
1.113.2 Metaclass: accessing
instanceClassAnswer the only instance of the metaclass
primaryInstanceAnswer the only instance of the metaclass - present for compatibility
soleInstanceAnswer the only instance of the metaclass - present for compatibility
1.113.3 Metaclass: basic
name: className environment: aNamespace subclassOf: theSuperclassPrivate - create a full featured class and install it, or change the superclass orshape of an existing one; instance variable names, class variable names and pooldictionaries are left untouched.
name: className environment: aNamespace subclassOf: newSuperclassinstanceVariableArray: variableArray shape: shape classPool: classVarDictpoolDictionaries: sharedPoolNames category: categoryName
Private - create a full featured class and install it, or change an existing one
name: newName environment: aNamespace subclassOf: theSuperclassinstanceVariableNames: stringOfInstVarNames shape: shape classVariableNames:stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryName
Private - parse the instance and class variables, and the pool dictionaries, thencreate the class.
newMeta: className environment: aNamespace subclassOf: theSuperclassinstanceVariableArray: arrayOfInstVarNames shape: shape classPool: classVarDictpoolDictionaries: sharedPoolNames category: categoryName
Private - create a full featured class and install it
1.113.4 Metaclass: compiling methods
poolResolutionUse my instance’s poolResolution.
1.113.5 Metaclass: delegation
addClassVarName: aStringAdd a class variable with the given name to the class pool dictionary
addSharedPool: aDictionaryAdd the given shared pool to the list of the class’ pool dictionaries
allClassVarNamesAnswer the names of the variables in the receiver’s class pool dictionary and ineach of the superclasses’ class pool dictionaries
Chapter 1: Base classes 183
allSharedPoolDictionariesDo: aBlockAnswer the shared pools visible from methods in the metaclass, in the correctsearch order.
allSharedPoolsReturn the names of the shared pools defined by the class and any of its super-classes
category Answer the class category
classPool Answer the class pool dictionary
classVarNamesAnswer the names of the variables in the class pool dictionary
comment Answer the class comment
debuggerClassAnswer the debugger class that was set in the instance class
environmentAnswer the namespace in which the receiver is implemented
name Answer the class name - it has none, actually
pragmaHandlerFor: aSymbolAnswer the (possibly inherited) registered handler for pragma aSymbol, or nilif not found.
removeClassVarName: aStringRemoves the class variable from the class, error if not present, or still in use.
removeSharedPool: aDictionaryRemove the given dictionary to the list of the class’ pool dictionaries
sharedPoolsReturn the names of the shared pools defined by the class
1.113.6 Metaclass: filing
fileOutOn: aFileStreamFile out complete class description: class definition, class and instance methods
1.113.7 Metaclass: printing
nameIn: aNamespaceAnswer the class name when the class is referenced from aNamespace.
printOn: aStreamPrint a represention of the receiver on aStream
printOn: aStream in: aNamespacePrint on aStream the class name when the class is referenced from aNamespace.
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
184 GNU Smalltalk Library Reference
1.113.8 Metaclass: testing functionality
asClass Answer ‘instanceClass’.
isMetaclassAnswer ‘true’.
1.114 MethodContext
Defined in namespace SmalltalkSuperclass: ContextPartCategory: Language-Implementation
My instances represent an actively executing method. They record various bitsof information about the execution environment, and contain the executionstack.
1.114.1 MethodContext: accessing
home Answer the MethodContext to which the receiver refers (i.e. the receiver itself)
isBlock Answer whether the receiver is a block context
isDisabled Answers whether the receiver has actually ended execution and will be skippedwhen doing a return. BlockContexts are removed from the chain whenever anon-local return is done, but MethodContexts need to stay there in case thereis a non-local return from the #ensure: block.
isEnvironmentTo create a valid execution environment for the interpreter even before it starts,GST creates a fake context which invokes a special “termination” method.Such a context can be used as a marker for the current execution environment.Answer whether the receiver is that kind of context.
isUnwind Answers whether the context must continue execution even after a non-local re-turn (a return from the enclosing method of a block, or a call to the #continue:method of ContextPart). Such contexts are created only by #ensure:.
mark To create a valid execution environment for the interpreter even before it starts,GST creates a fake context which invokes a special “termination” method. Asimilar context is created by #valueWithUnwind, by using this method.
sender Return the context from which the receiver was sent
1.114.2 MethodContext: debugging
isInternalExceptionHandlingContextAnswer whether the receiver is a context that should be hidden to theuser when presenting a backtrace. Such contexts are identified through the#exceptionHandlingInternal: attribute: if there is such a context in thebacktrace, all those above it are marked as internal.
That is, the attribute being set to true means that the context and all thoseabove it are to be hidden, while the attribute being set to false means that thecontexts above it must be hidden, but not the context itself.
Chapter 1: Base classes 185
1.114.3 MethodContext: printing
printOn: aStreamPrint a representation for the receiver on aStream
1.115 MethodDictionary
Defined in namespace SmalltalkSuperclass: IdentityDictionaryCategory: Language-Implementation
I am similar to an IdentityDictionary, except that removal and rehashing oper-ations inside my instances look atomic to the interpreter.
1.115.1 MethodDictionary: adding
at: key put: valueStore value as associated to the given key
1.115.2 MethodDictionary: rehashing
rehash Rehash the receiver
1.115.3 MethodDictionary: removing
remove: anAssociationRemove anAssociation’s key from the dictionary
removeKey: anElement ifAbsent: aBlockRemove the passed key from the dictionary, answer the result of evaluatingaBlock if it is not found
1.116 MethodInfo
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I provide information about particular methods. I can produce the categorythat a method was filed under, and can be used to access the source code ofthe method.
1.116.1 MethodInfo: accessing
category Answer the method category
category: aCategorySet the method category
methodClassAnswer the class in which the method is defined
methodClass: aClassSet the class in which the method is defined
186 GNU Smalltalk Library Reference
selector Answer the selector through which the method is called
selector: aSymbolSet the selector through which the method is called
sourceCodeAnswer a FileSegment or String or nil containing the method source code
sourceFile Answer the name of the file where the method source code is
sourcePos Answer the starting position of the method source code in the sourceFile
sourceStringAnswer a String containing the method source code
stripSourceCodeRemove the reference to the source code for the method
1.116.2 MethodInfo: equality
= aMethodInfoCompare the receiver and aMethodInfo, answer whether they’re equal
hash Answer an hash value for the receiver
1.117 Namespace
Defined in namespace SmalltalkSuperclass: AbstractNamespaceCategory: Language-Implementation
I am a Namespace that has a super-namespace.
1.117.1 Namespace class: accessing
current Answer the current namespace
current: aNamespaceOrClassSet the current namespace to be aNamespace or, if it is a class, its class pool(the Dictionary that holds class variables).
1.117.2 Namespace class: disabling instance creation
new Disabled - use #addSubspace: to create instances
new: size Disabled - use #addSubspace: to create instances
1.117.3 Namespace class: initialization
initialize This actually is not needed, the job could be done in dict.c (function names-pace new). But I’m lazy and I prefer to rely on the Smalltalk implementationof IdentitySet.
1.117.4 Namespace: accessing
inheritedKeysAnswer a Set of all the keys in the receiver and its superspaces
Chapter 1: Base classes 187
1.117.5 Namespace: namespace hierarchy
siblings Answer all the other namespaces that inherit from the receiver’s superspace.
siblingsDo: aBlockEvaluate aBlock once for each of the other namespaces that inherit from thereceiver’s superspace, passing the namespace as a parameter.
1.117.6 Namespace: overrides for superspaces
associationAt: key ifAbsent: aBlockReturn the key/value pair associated to the variable named as specified by‘key’. If the key is not found search will be brought on in superspaces, finallyevaluating aBlock if the variable cannot be found in any of the superspaces.
associationsDo: aBlockPass each association in the namespace to aBlock
at: key ifAbsent: aBlockReturn the value associated to the variable named as specified by ‘key’. If thekey is not found search will be brought on in superspaces, finally evaluatingaBlock if the variable cannot be found in any of the superspaces.
at: key ifPresent: aBlockIf aKey is absent from the receiver and all its superspaces, answer nil. Else,evaluate aBlock passing the associated value and answer the result of the invo-cation
do: aBlockPass each value in the namespace to aBlock
includesKey: keyAnswer whether the receiver or any of its superspaces contain the given key
keysAndValuesDo: aBlockPass to aBlock each of the receiver’s keys and values, in two separate parameters
keysDo: aBlockPass to aBlock each of the receiver’s keys
set: key to: newValue ifAbsent: aBlockAssign newValue to the variable named as specified by ‘key’. This methodwon’t define a new variable; instead if the key is not found it will search insuperspaces and evaluate aBlock if it is not found. Answer newValue.
size Answer the number of keys in the receiver and each of its superspaces
1.117.7 Namespace: printing
nameIn: aNamespaceAnswer Smalltalk code compiling to the receiver when the current namespaceis aNamespace
printOn: aStream in: aNamespacePrint on aStream some Smalltalk code compiling to the receiver when the cur-rent namespace is aNamespace
188 GNU Smalltalk Library Reference
storeOn: aStreamStore Smalltalk code compiling to the receiver
1.118 NetClients.URIResolver
Defined in namespace Smalltalk.NetClientsSuperclass: ObjectCategory: NetClients-URIResolver
This class publishes methods to download files from the Internet.
1.118.1 NetClients.URIResolver class: api
openOn: aURIAlways raise an error, as this method is not supported without loading theadditional NetClients package.
openOn: aURI ifFail: aBlockAlways evaluate aBlock and answer the result if the additional NetClients pack-age is not loaded. If it is, instead, return a WebEntity with the contents of theresource specified by anURI, and only evaluate the block if loading the resourcefails.
openStreamOn: aURICheck if aURI can be fetched from the Internet or from the local system, and ifso return a Stream with its contents. If this is not possible, raise an exception.
openStreamOn: aURI ifFail: aBlockCheck if aURI can be fetched from the Internet or from the local system, andif so return a Stream with its contents. If this is not possible, instead, evaluatethe zero-argument block aBlock and answer the result of the evaluation.
1.118.2 NetClients.URIResolver class: instance creation
on: anURLAnswer a new URIResolver that will do its best to fetch the data for anURLfrom the Internet.
1.119 NetClients.URL
Defined in namespace Smalltalk.NetClientsSuperclass: ObjectCategory: NetClients-URIResolver
Copyright (c) Kazuki Yasumatsu, 1995. All rights reserved.
1.119.1 NetClients.URL class: encoding URLs
decode: aStringDecode a text/x-www-form-urlencoded String into a text/plain String.
encode: anURLEncode a text/plain into a text/x-www-form-urlencoded String (those thingswith lots of % in them).
Chapter 1: Base classes 189
initialize Initialize the receiver’s class variables.
1.119.2 NetClients.URL class: instance creation
fromString: aStringParse the given URL and answer an URL object based on it.
new Answer a ’blank’ URL.
scheme: schemeString host: hostString path: pathStringAnswer an URL object made from all the parts passed as arguments.
scheme: schemeString host: hostString port: portNumber path: pathStringAnswer an URL object made from all the parts passed as arguments.
scheme: schemeString path: pathStringAnswer an URL object made from all the parts passed as arguments.
scheme: schemeString username: userString password: passwordString host: hostStringport: portNumber path: pathString
Answer an URL object made from all the parts passed as arguments.
1.119.3 NetClients.URL: accessing
asString Answer the full request string corresponding to the URL. This is how the URLwould be printed in the address bar of a web browser, except that the querydata is printed even if it is to be sent through a POST request.
decodedFieldsConvert the form fields to a Dictionary, answer nil if no question mark is foundin the URL.
decodedFileAnswer the file part of the URL, decoding it from x-www-form-urlencodedformat.
decodedFragmentAnswer the fragment part of the URL, decoding it from x-www-form-urlencodedformat.
fragment Answer the fragment part of the URL, leaving it in x-www-form-urlencodedformat.
fragment: aStringSet the fragment part of the URL, which should be in x-www-form-urlencodedformat.
fullRequestStringAnswer the full request string corresponding to the URL. This is how the URLwould be printed in the address bar of a web browser, except that the querydata is printed even if it is to be sent through a POST request.
hasPostDataAnswer whether the URL has a query part but is actually for an HTTP POSTrequest and not really part of the URL (as it would be for the HTTP GETrequest).
190 GNU Smalltalk Library Reference
hasPostData: aBooleanSet whether the query part of the URL is actually the data for an HTTPPOST request and not really part of the URL (as it would be for the HTTPGET request).
host Answer the host part of the URL.
host: aStringSet the host part of the URL to aString.
newsGroupIf the receiver is an nntp url, return the news group.
password Answer the password part of the URL.
password: aStringSet the password part of the URL to aString.
path Answer the path part of the URL.
path: aStringSet the path part of the URL to aString.
port Answer the port number part of the URL.
port: anIntegerSet the port number part of the URL to anInteger.
postData Answer whether the URL has a query part and it is meant for an HTTP POSTrequest, answer it. Else answer nil.
postData: aStringAssociate to the URL some data that is meant to be sent through an HTTPPOST request, answer it.
query Answer the query data associated to the URL.
query: aStringSet the query data associated to the URL to aString.
requestStringAnswer the URL as it would be sent in an HTTP stream (that is, the path andthe query data, the latter only if it is to be sent with an HTTP POST request).
scheme Answer the URL’s scheme.
scheme: aStringSet the URL’s scheme to be aString.
username Answer the username part of the URL.
username: aStringSet the username part of the URL to aString.
1.119.4 NetClients.URL: comparing
= anURL Answer whether the two URLs are equal. The file and anchor are converted tofull 8-bit ASCII (contrast with urlencoded) and the comparison is case-sensitive;on the other hand, the protocol and host are compared without regard to case.
hash Answer an hash value for the receiver
Chapter 1: Base classes 191
1.119.5 NetClients.URL: copying
copyWithoutAuxiliaryPartsAnswer a copy of the receiver where the fragment and query parts of the URLhave been cleared.
copyWithoutFragmentAnswer a copy of the receiver where the fragment parts of the URL has beencleared.
postCopy All the variables are copied when an URL object is copied.
1.119.6 NetClients.URL: initialize-release
initialize Initialize the object to a consistent state.
1.119.7 NetClients.URL: printing
printOn: streamPrint a representation of the URL on the given stream.
1.119.8 NetClients.URL: still unclassified
contents Not commented.
entity Not commented.
readStreamNot commented.
1.119.9 NetClients.URL: testing
canCache Answer whether the URL is cacheable. The current implementation considersfile URLs not to be cacheable, and everything else to be.
hasFragmentAnswer whether the URL points to a particular fragment (anchor) of the re-source.
hasQuery Answer whether the URL includes query arguments to be submitted when re-trieving the resource.
isFileSchemeAnswer whether the URL is a file URL.
isFragmentOnlyAnswer whether the URL only includes the name of a particular fragment (an-chor) of the resource to which it refers.
1.119.10 NetClients.URL: utilities
construct: anURLConstruct an absolute URL based on the relative URL anURL and the basepath represented by the receiver
192 GNU Smalltalk Library Reference
1.120 Notification
Defined in namespace SmalltalkSuperclass: ExceptionCategory: Language-Exceptions
Notification represents a resumable, exceptional yet non-erroneous, situation.Signaling a notification in absence of an handler simply returns nil.
1.120.1 Notification: exception description
defaultActionDo the default action for notifications, which is to resume execution of thecontext which signaled the exception.
descriptionAnswer a textual description of the exception.
isResumableAnswer true. Notification exceptions are by default resumable.
1.121 NullProxy
Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files
I am a proxy that does no special processing on the object to be saved. I canbe used to disable proxies for particular subclasses. My subclasses add to thestored information, but share the fact that the format is about the same as thatof #dump: without a proxy.
1.121.1 NullProxy class: instance creation
loadFrom: anObjectDumperReload the object stored in anObjectDumper
1.121.2 NullProxy: accessing
dumpTo: anObjectDumperDump the object stored in the proxy to anObjectDumper
1.122 NullValueHolder
Defined in namespace SmalltalkSuperclass: ValueAdaptorCategory: Language-Data types
I pretend to store my value in a variable, but I don’t actually. You can usethe only instance of my class (returned by ‘ValueHolder null’) if you’re notinterested in a value that is returned as described in ValueHolder’s comment.
Chapter 1: Base classes 193
1.122.1 NullValueHolder class: creating instances
new Not used – use ‘ValueHolder null’ instead
uniqueInstanceAnswer the sole instance of NullValueHolder
1.122.2 NullValueHolder: accessing
value Retrive the value of the receiver. Always answer nil
value: anObjectSet the value of the receiver. Do nothing, discard the value
1.123 Number
Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types
I am an abstract class that provides operations on numbers, both floating pointand integer. I provide some generic predicates, and supply the implicit typecoercing code for binary operations.
1.123.1 Number class: converting
coerce: aNumberAnswer aNumber - whatever class it belongs to, it is good
readFrom: aStreamAnswer the number read from the rest of aStream, converted to an instance ofthe receiver. If the receiver is number, the class of the result is undefined – butthe result is good.
readFrom: aStream radix: anIntegerAnswer the number read from the rest of aStream, converted to an instance ofthe receiver. If the receiver is number, the class of the result is undefined – butthe result is good.
The exponent (for example 1.2e-1) is only parsed if anInteger is 10.
1.123.2 Number class: testing
isImmediateAnswer whether, if x is an instance of the receiver, x copy == x
1.123.3 Number: arithmetic
* aNumberSubtract the receiver and aNumber, answer the result
+ aNumberSum the receiver and aNumber, answer the result
- aNumberSubtract aNumber from the receiver, answer the result
194 GNU Smalltalk Library Reference
/ aNumberDivide the receiver by aNumber, answer the result (no loss of precision). Raisea ZeroDivide exception or return a valid (possibly infinite) continuation valueif aNumber is zero.
// aNumberReturn the integer quotient of dividing the receiver by aNumber with truncationtowards negative infinity. Raise a ZeroDivide exception if aNumber is zero
\\ aNumberReturn the remainder of dividing the receiver by aNumber with truncationtowards negative infinity. Raise a ZeroDivide exception if aNumber is zero
quo: aNumberReturn the integer quotient of dividing the receiver by aNumber with truncationtowards zero. Raise a ZeroDivide exception if aNumber is zero
reciprocal Return the reciprocal of the receiver
rem: aNumberReturn the remainder of dividing the receiver by aNumber with truncationtowards zero. Raise a ZeroDivide exception if aNumber is zero
1.123.4 Number: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
1.123.5 Number: comparing
max: aNumberAnswer the maximum between the receiver and aNumber. Redefine in sub-classes if necessary to ensure that if either self or aNumber is a NaN, it isalways answered.
min: aNumberAnswer the minimum between the receiver and aNumber. Redefine in subclassesif necessary to ensure that if either self or aNumber is a NaN, it is alwaysanswered.
1.123.6 Number: converting
asExactFractionReturn the receiver, converted to a Fraction retaining the exact value of thereceiver.
asFloat Convert the receiver to an arbitrary subclass of Float
asFloatD This method’s functionality should be implemented by subclasses of Number
asFloatE This method’s functionality should be implemented by subclasses of Number
asFloatQ This method’s functionality should be implemented by subclasses of Number
Chapter 1: Base classes 195
asFraction This method’s functionality should be implemented by subclasses of Number
asNumber Answer the receiver, since it is already a number
asRectangleAnswer an empty rectangle whose origin is (self asPoint)
asScaledDecimal: nAnswer the receiver, converted to a ScaledDecimal object.
asScaledDecimal: denDigits radix: base scale: nAnswer the receiver, divided by base^denDigits and converted to a ScaledDec-imal object.
asString Answer the receiver’s #displayString, which should be a good enough conver-sion to String for a number.
coerce: aNumberAnswer aNumber, converted to an integer or floating-point number.
degreesToRadiansConvert the receiver to radians
generality Answer the receiver’s generality
radiansToDegreesConvert the receiver from radians to degrees
unity Coerce 1 to the receiver’s class. The default implementation works, but isinefficient
zero Coerce 0 to the receiver’s class. The default implementation works, but isinefficient
1.123.7 Number: copying
deepCopy Return the receiver - it’s an immediate (immutable) object
shallowCopyReturn the receiver - it’s an immediate (immutable) object
1.123.8 Number: error raising
arithmeticError: msgRaise an ArithmeticError exception having msg as its message text.
zeroDivideRaise a division-by-zero (ZeroDivide) exception whose dividend is the receiver.
1.123.9 Number: misc math
abs Answer the absolute value of the receiver
arcCos Answer the arc cosine of the receiver
arcCosh Answer the hyperbolic arc-cosine of the receiver.
arcSin Answer the arc sine of the receiver
196 GNU Smalltalk Library Reference
arcSinh Answer the hyperbolic arc-sine of the receiver.
arcTan Answer the arc tangent of the receiver
arcTan: x Answer the angle (measured counterclockwise) between (x, self) and a raystarting in (0, 0) and moving towards (1, 0) - i.e. 3 o’clock
arcTanh Answer the hyperbolic arc-tangent of the receiver.
ceilingLog: radixAnswer (self log: radix) ceiling. Optimized to answer an integer.
cos Answer the cosine of the receiver
cosh Answer the hyperbolic cosine of the receiver.
estimatedLogAnswer an estimate of (self abs floorLog: 10). This method should be overriddenby subclasses, but Number’s implementation does not raise errors - simply, itgives a correct result, so it is slow.
exp Answer e raised to the receiver
floorLog: radixAnswer (self log: radix) floor. Optimized to answer an integer.
ln Answer log base e of the receiver
log Answer log base 10 of the receiver
log: aNumberAnswer log base aNumber of the receiver
negated Answer the negated of the receiver
positiveDifference: aNumberAnswer the positive difference of the receiver and aNumber, that is self - aNum-ber if it is positive, 0 otherwise.
raisedTo: aNumberReturn self raised to aNumber power
raisedToInteger: anIntegerReturn self raised to the anInteger-th power
sin Answer the sine of the receiver
sinh Answer the hyperbolic sine of the receiver.
sqrt Answer the square root of the receiver
squared Answer the square of the receiver
tan Answer the tangent of the receiver
tanh Answer the hyperbolic tangent of the receiver.
withSignOf: aNumberAnswer the receiver, with its sign possibly changed to match that of aNumber.
Chapter 1: Base classes 197
1.123.10 Number: point creation
@ y Answer a new point whose x is the receiver and whose y is y
asPoint Answer a new point, self @ self
1.123.11 Number: retrying
retry: aSymbol coercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling aSymbol. aSymbol is supposednot to be #= or #~= (since those don’t fail if aNumber is not a Number).
retryDifferenceCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #-.
retryDivisionCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #/.
retryEqualityCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #=.
retryErrorRaise an error—a retrying method was called with two arguments having thesame generality.
retryInequalityCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #~=.
retryMultiplicationCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #*.
retryRelationalOp: aSymbol coercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling aSymbol (<, <=, >, >=).
retrySumCoercing: aNumberCoerce to the other number’s class the one number between the receiver andaNumber which has the lowest, and retry calling #+.
1.123.12 Number: shortcuts and iterators
to: stop Return an interval going from the receiver to stop by 1
to: stop by: stepReturn an interval going from the receiver to stop with the given step
to: stop by: step collect: aBlockEvaluate aBlock for each value in the interval going from the receiver to stopwith the given step. The results are collected in an Array and returned.
198 GNU Smalltalk Library Reference
to: stop by: step do: aBlockEvaluate aBlock for each value in the interval going from the receiver to stopwith the given step. Compiled in-line for integer literal steps, and for one-argument aBlocks without temporaries, and therefore not overridable.
to: stop collect: aBlockEvaluate aBlock for each value in the interval going from the receiver to stopby 1. The results are collected in an Array and returned.
to: stop do: aBlockEvaluate aBlock for each value in the interval going from the receiver to stopby 1. Compiled in-line for one-argument aBlocks without temporaries, andtherefore not overridable.
1.123.13 Number: testing
closeTo: numAnswer whether the receiver can be considered sufficiently close to num (this isdone by checking equality if num is not a number, and by checking with 0.01%tolerance if num is a number).
even Returns true if self is divisible by 2
isExact Answer whether the receiver performs exact arithmetic. Most numeric classesdo (in fact the only exceptions is Float and its descendants), so the default isto answer true rather than calling #subclassResponsibility.
isFinite Answer whether the receiver represents a finite quantity. Most numeric classesare for finite quantities, so the default is to answer true rather than calling#subclassResponsibility.
isInfinite Answer whether the receiver represents an infinite quantity. Most numericclasses are for finite quantities, so the default is to answer false rather thancalling #subclassResponsibility.
isNaN Answer whether the receiver is a Not-A-Number. Most numeric classes don’thandle nans, so the default is to answer false rather than calling #subclassRe-sponsibility.
isNumber Answer ‘true’.
isRational Answer whether the receiver is rational - false by default
negative Answer whether the receiver is < 0
odd Returns true if self is not divisible by 2
positive Answer whether the receiver is >= 0
sign Returns the sign of the receiver.
strictlyPositiveAnswer whether the receiver is > 0
Chapter 1: Base classes 199
1.123.14 Number: truncation and round off
asInteger Answer the receiver, rounded to the nearest integer
floor Return the integer nearest the receiver toward negative infinity.
fractionPartAnswer a number which, summed to the #integerPart of the receiver, gives thereceiver itself.
integerPartAnswer the receiver, truncated towards zero
roundTo: aNumberAnswer the receiver, truncated to the nearest multiple of aNumber
rounded Returns the integer nearest the receiver
truncateTo: aNumberAnswer the receiver, truncated towards zero to a multiple of aNumber
truncated Answer the receiver, truncated towards zero
1.124 Object
Defined in namespace SmalltalkSuperclass: noneCategory: Language-Implementation
I am the root of the Smalltalk class system. All classes in the system aresubclasses of me.
1.124.1 Object class: initialization
dependenciesAnswer a dictionary that associates an object with its dependents.
dependencies: anObjectUse anObject as the dictionary that associates an object with its dependents.
finalizableObjectsAnswer a set of finalizable objects.
initialize Initialize the Dependencies dictionary to be a WeakKeyIdentityDictionary.
update: aspectDo any global tasks for the ObjectMemory events.
1.124.2 Object: built ins
= arg Answer whether the receiver is equal to arg. The equality test is by default thesame as that for identical objects. = must not fail; answer false if the receivercannot be compared to arg
== arg Answer whether the receiver is the same object as arg. This is a very fast testand is called ’object identity’.
200 GNU Smalltalk Library Reference
allOwners Return an Array of Objects that point to the receiver.
asOop Answer the object index associated to the receiver. The object index doesn’tchange when garbage collection is performed.
at: anIndexAnswer the index-th indexed instance variable of the receiver
at: anIndex put: valueStore value in the index-th indexed instance variable of the receiver
basicAt: anIndexAnswer the index-th indexed instance variable of the receiver. This methodmust not be overridden, override at: instead
basicAt: anIndex put: valueStore value in the index-th indexed instance variable of the receiver This methodmust not be overridden, override at:put: instead
basicPrint Print a basic representation of the receiver
basicSize Answer the number of indexed instance variable in the receiver
become: otherObjectChange all references to the receiver into references to otherObject. Dependingon the implementation, references to otherObject might or might not be trans-formed into the receiver (respectively, ’two-way become’ and ’one-way become’).Implementations doing one-way become answer the receiver (so that it is notlost). Most implementations doing two-way become answer otherObject, butthis is not assured - so do answer the receiver for consistency. GNU Smalltalkdoes two-way become and answers otherObject, but this might change in futureversions: programs should not rely on the behavior and results of #become: .
becomeForward: otherObjectChange all references to the receiver into references to otherObject. Referencesto otherObject are not transformed into the receiver. Answer the receiver sothat it is not lost.
changeClassTo: aBehaviorMutate the class of the receiver to be aBehavior. Note: Tacitly assumes thatthe structure is the same for the original and new class!!
checkIndexableBounds: indexPrivate - Check the reason why an access to the given indexed instance variablefailed
checkIndexableBounds: index ifAbsent: aBlockPrivate - Check the reason why an access to the given indexed instance variablefailed. Evaluate aBlock for an invalid index.
checkIndexableBounds: index put: objectPrivate - Check the reason why a store to the given indexed instance variablefailed
class Answer the class to which the receiver belongs
Chapter 1: Base classes 201
halt Called to enter the debugger
hash Answer an hash value for the receiver. This hash value is ok for objects thatdo not redefine ==.
identityHashAnswer an hash value for the receiver. This method must not be overridden
instVarAt: indexAnswer the index-th instance variable of the receiver. This method must notbe overridden.
instVarAt: index put: valueStore value in the index-th instance variable of the receiver. This method mustnot be overridden.
isReadOnlyAnswer whether the object’s indexed instance variables can be written
isUntrustedAnswer whether the object is to be considered untrusted.
makeEphemeronMake the object an ’ephemeron’. An ephemeron is marked after all other ob-jects, and if no references are found to the key except from the object itself, itis sent the #mourn message.
makeFixedAvoid that the receiver moves in memory across garbage collections.
makeReadOnly: aBooleanSet whether the object’s indexed instance variables can be written
makeUntrusted: aBooleanSet whether the object is to be considered untrusted.
makeWeakMake the object a ’weak’ one. When an object is only referenced by weakobjects, it is collected and the slots in the weak objects are changed to nils bythe VM; the weak object is then sent the #mourn message.
mark: aSymbolPrivate - use this method to mark code which needs to be reworked, removed,etc. You can then find all senders of #mark: to find all marked methods oryou can look for all senders of the symbol that you sent to #mark: to find acategory of marked methods.
nextInstancePrivate - answer another instance of the receiver’s class, or nil if the entireobject table has been walked
notYetImplementedCalled when a method defined by a class is not yet implemented, but is goingto be
202 GNU Smalltalk Library Reference
perform: selectorOrMessageOrMethodSend the unary message named selectorOrMessageOrMethod (if a Symbol) tothe receiver, or the message and arguments it identifies (if a Message or Direct-edMessage), or finally execute the method within the receiver (if a Compiled-Method). In the last case, the method need not reside on the hierarchy fromthe receiver’s class to Object – it need not reside at all in a MethodDictionary,in fact – but doing bad things will compromise stability of the Smalltalk virtualmachine (and don’t blame anybody but yourself).
This method should not be overridden
perform: selectorOrMethod with: arg1Send the message named selectorOrMethod (if a Symbol) to the receiver, pass-ing arg1 to it, or execute the method within the receiver (if a CompiledMethod).In the latter case, the method need not reside on the hierarchy from the re-ceiver’s class to Object – it need not reside at all in a MethodDictionary, infact – but doing bad things will compromise stability of the Smalltalk virtualmachine (and don’t blame anybody but yourself).
This method should not be overridden
perform: selectorOrMethod with: arg1 with: arg2Send the message named selectorOrMethod (if a Symbol) to the receiver, pass-ing arg1 and arg2 to it, or execute the method within the receiver (if a Com-piledMethod). In the latter case, the method need not reside on the hierarchyfrom the receiver’s class to Object – it need not reside at all in a MethodDic-tionary, in fact – but doing bad things will compromise stability of the Smalltalkvirtual machine (and don’t blame anybody but yourself).
This method should not be overridden
perform: selectorOrMethod with: arg1 with: arg2 with: arg3Send the message named selectorOrMethod (if a Symbol) to the receiver, pass-ing the other arguments to it, or execute the method within the receiver (ifa CompiledMethod). In the latter case, the method need not reside on thehierarchy from the receiver’s class to Object – it need not reside at all in aMethodDictionary, in fact – but doing bad things will compromise stability ofthe Smalltalk virtual machine (and don’t blame anybody but yourself).
This method should not be overridden
perform: selectorOrMethod with: arg1 with: arg2 with: arg3 with: arg4Send the message named selectorOrMethod (if a Symbol) to the receiver, pass-ing the other arguments to it, or execute the method within the receiver (ifa CompiledMethod). In the latter case, the method need not reside on thehierarchy from the receiver’s class to Object – it need not reside at all in aMethodDictionary, in fact – but doing bad things will compromise stability ofthe Smalltalk virtual machine (and don’t blame anybody but yourself).
This method should not be overridden
perform: selectorOrMethod withArguments: argumentsArraySend the message named selectorOrMethod (if a Symbol) to the receiver, pass-ing the elements of argumentsArray as parameters, or execute the method
Chapter 1: Base classes 203
within the receiver (if a CompiledMethod). In the latter case, the methodneed not reside on the hierarchy from the receiver’s class to Object – it neednot reside at all in a MethodDictionary, in fact – but doing bad things will com-promise stability of the Smalltalk virtual machine (and don’t blame anybodybut yourself).
This method should not be overridden
primitiveFailedCalled when a VM primitive fails
shallowCopyReturns a shallow copy of the receiver (the instance variables are not copied)
shouldNotImplementCalled when objects belonging to a class should not answer a selector definedby a superclass
size Answer the number of indexed instance variable in the receiver
subclassResponsibilityCalled when a method defined by a class should be overridden in a subclass
tenure Move the object to oldspace.
1.124.3 Object: change and update
broadcast: aSymbolSend the unary message aSymbol to each of the receiver’s dependents
broadcast: aSymbol with: anObjectSend the message aSymbol to each of the receiver’s dependents, passing anOb-ject
broadcast: aSymbol with: arg1 with: arg2Send the message aSymbol to each of the receiver’s dependents, passing arg1and arg2 as parameters
broadcast: aSymbol withArguments: anArraySend the message aSymbol to each of the receiver’s dependents, passing theparameters in anArray
broadcast: aSymbol withBlock: aBlockSend the message aSymbol to each of the receiver’s dependents, passing theresult of evaluating aBlock with each dependent as the parameter
changed Send update: for each of the receiver’s dependents, passing them the receiver
changed: aParameterSend update: for each of the receiver’s dependents, passing them aParameter
update: aParameterDefault behavior is to do nothing. Called by #changed and #changed:
204 GNU Smalltalk Library Reference
1.124.4 Object: class type methods
species This method has no unique definition. Generally speaking, methods which al-ways return the same type usually don’t use #class, but #species. For example,a PositionableStream’s species is the class of the collection on which it is stream-ing (used by upTo:, upToAll:, upToEnd). Stream uses species for obtaining theclass of next:’s return value, Collection uses it in its #copyEmpty: message,which in turn is used by all collection-returning methods. An Interval’s speciesis Array (used by collect:, select:, reject:, etc.).
yourself Answer the receiver
1.124.5 Object: compiler
literalEquals: anObjectNot commented.
literalHashNot commented.
1.124.6 Object: conversion
asValue Answer a ValueHolder whose initial value is the receiver.
1.124.7 Object: copying
copy Returns a shallow copy of the receiver (the instance variables are not copied).The shallow copy receives the message postCopy and the result of postCopy ispassed back.
deepCopy Returns a deep copy of the receiver (the instance variables are copies of thereceiver’s instance variables)
postCopy Performs any changes required to do on a copied object. This is the place whereone could, for example, put code to replace objects with copies of the objects
1.124.8 Object: debugging
examine Print all the instance variables of the receiver on the Transcript
examineOn: aStreamPrint all the instance variables of the receiver on aStream
inspect In a GUI environment, this opens a tool to examine and modify the receiver.In the default image, it just calls #examine.
validSize Answer how many elements in the receiver should be inspected
1.124.9 Object: dependents access
addDependent: anObjectAdd anObject to the set of the receiver’s dependents. Important: if an objecthas dependents, it won’t be garbage collected.
dependentsAnswer a collection of the receiver’s dependents.
Chapter 1: Base classes 205
release Remove all of the receiver’s dependents from the set and allow the receiver tobe garbage collected.
removeDependent: anObjectRemove anObject to the set of the receiver’s dependents. No problem if anOb-ject is not in the set of the receiver’s dependents.
1.124.10 Object: error raising
doesNotUnderstand: aMessageCalled by the system when a selector was not found. message is a Messagecontaining information on the receiver
error: messageDisplay a walkback for the receiver, with the given error message. Signal an‘Error’ exception.
halt: messageDisplay a walkback for the receiver, with the given error message. Signal an‘Halt’ exception.
1.124.11 Object: finalization
addToBeFinalizedArrange things so that #finalize is sent to the object when the garbage collectorfinds out there are only weak references to it.
finalize Do nothing by default
mourn This method is sent by the VM to weak and ephemeron objects when one of theirfields is found out to be garbage collectable (this means, for weak objects, thatthere are no references to it from non-weak objects, and for ephemeron objects,that the only paths to the first instance variable pass through other instancevariables of the same ephemeron). The default behavior is to do nothing.
removeToBeFinalizedUnregister the object, so that #finalize is no longer sent to the object when thegarbage collector finds out there are only weak references to it.
1.124.12 Object: introspection
instVarNamed: aStringAnswer the instance variable named aString in the receiver.
instVarNamed: aString put: anObjectAnswer the instance variable named aString in the receiver.
1.124.13 Object: printing
basicPrintNlPrint a basic representation of the receiver, followed by a new line.
basicPrintOn: aStreamPrint a represention of the receiver on aStream
206 GNU Smalltalk Library Reference
display Print a represention of the receiver on the Transcript (stdout the GUI is notactive). For most objects this is simply its #print representation, but for stringsand characters, superfluous dollars or extra pair of quotes are stripped.
displayNl Print a represention of the receiver, then put a new line on the Transcript(stdout the GUI is not active). For most objects this is simply its #printNlrepresentation, but for strings and characters, superfluous dollars or extra pairof quotes are stripped.
displayOn: aStreamPrint a represention of the receiver on aStream. For most objects this is simplyits #printOn: representation, but for strings and characters, superfluous dollarsor extra pair of quotes are stripped.
displayStringAnswer a String representing the receiver. For most objects this is simply its#printString, but for strings and characters, superfluous dollars or extra pairof quotes are stripped.
print Print a represention of the receiver on the Transcript (stdout the GUI is notactive)
printNl Print a represention of the receiver on stdout, put a new line the Transcript(stdout the GUI is not active)
printOn: aStreamPrint a represention of the receiver on aStream
printStringAnswer a String representing the receiver
1.124.14 Object: relational operators
~= anObjectAnswer whether the receiver and anObject are not equal
~~ anObjectAnswer whether the receiver and anObject are not the same object
1.124.15 Object: saving and loading
binaryRepresentationObjectThis method must be implemented if PluggableProxies are used with the re-ceiver’s class. The default implementation raises an exception.
postLoad Called after loading an object; must restore it to the state before ‘preStore’ wascalled. Do nothing by default
postStore Called after an object is dumped; must restore it to the state before ‘preStore’was called. Call #postLoad by default
preStore Called before dumping an object; it must *change* it (it must not answer anew object) if necessary. Do nothing by default
Chapter 1: Base classes 207
reconstructOriginalObjectUsed if an instance of the receiver’s class is returned as the #binaryRepresenta-tionObject of another object. The default implementation raises an exception.
1.124.16 Object: storing
store Put a String of Smalltalk code compiling to the receiver on the Transcript(stdout the GUI is not active)
storeLiteralOn: aStreamPut a Smalltalk literal compiling to the receiver on aStream
storeNl Put a String of Smalltalk code compiling to the receiver, followed by a new line,on the Transcript (stdout the GUI is not active)
storeOn: aStreamPut Smalltalk code compiling to the receiver on aStream
storeStringAnswer a String of Smalltalk code compiling to the receiver
1.124.17 Object: syntax shortcuts
-> anObjectCreates a new instance of Association with the receiver being the key and theargument becoming the value
1.124.18 Object: testing functionality
ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else answer self
ifNil: nilBlock ifNotNil: notNilBlockEvaluate nilBlock if the receiver is nil, else evaluate notNilBlock, passing thereceiver.
ifNotNil: notNilBlockEvaluate notNilBlock if the receiver is not nil, passing the receiver. Else answernil.
ifNotNil: notNilBlock ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else evaluate notNilBlock, passing thereceiver.
isArray Answer ‘false’.
isBehavior Answer ‘false’.
isCObject Answer ‘false’.
isCharacterAnswer ‘false’.
isCharacterArrayAnswer ‘false’.
208 GNU Smalltalk Library Reference
isClass Answer ‘false’.
isFloat Answer ‘false’.
isInteger Answer ‘false’.
isKindOf: aClassAnswer whether the receiver’s class is aClass or a subclass of aClass
isMemberOf: aClassReturns true if the receiver is an instance of the class ’aClass’
isMeta Same as isMetaclass
isMetaClassSame as isMetaclass
isMetaclassAnswer ‘false’.
isNamespaceAnswer ‘false’.
isNil Answer whether the receiver is nil
isNumber Answer ‘false’.
isSmallIntegerAnswer ‘false’.
isString Answer ‘false’.
isSymbol Answer ‘false’.
notNil Answer whether the receiver is not nil
respondsTo: aSymbolReturns true if the receiver understands the given selector
1.124.19 Object: VM callbacks
badReturnErrorCalled back when a block performs a bad return.
mustBeBooleanCalled by the system when ifTrue:*, ifFalse:*, and: or or: are sent to anythingbut a boolean
noRunnableProcessCalled back when all processes are suspended
userInterruptCalled back when the user presses Ctrl-Break
Chapter 1: Base classes 209
1.125 ObjectDumper
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Files
I’m not part of a normal Smalltalk system, but most Smalltalks provide a similarfeature: that is, support for storing objects in a binary format; there are manyadvantages in using me instead of #storeOn: and the Smalltalk compiler.
The data is stored in a very compact format, which has the side effect of makingloading much faster when compared with compiling the Smalltalk code preparedby #storeOn:. In addition, my instances support circular references betweenobjects, while #storeOn: supports it only if you know of such references atdesign time and you override #storeOn: to deal with them
1.125.1 ObjectDumper class: establishing proxy classes
disableProxyFor: aClassDisable proxies for instances of aClass and its descendants
hasProxyFor: aClassAnswer whether a proxy class has been registered for instances of aClass.
proxyClassFor: anObjectAnswer the class of a valid proxy for an object, or nil if none could be found
proxyFor: anObjectAnswer a valid proxy for an object, or the object itself if none could be found
registerProxyClass: aProxyClass for: aClassRegister the proxy class aProxyClass - descendent of DumperProxy - to be usedfor instances of aClass and its descendants
1.125.2 ObjectDumper class: instance creation
new This method should not be called for instances of this class.
on: aFileStreamAnswer an ObjectDumper working on aFileStream.
1.125.3 ObjectDumper class: shortcuts
dump: anObject to: aFileStreamDump anObject to aFileStream. Answer anObject
loadFrom: aFileStreamLoad an object from aFileStream and answer it
1.125.4 ObjectDumper class: testing
example This is a real torture test: it outputs recursive objects, identical objects multipletimes, classes, metaclasses, integers, characters and proxies (which is also a testof more complex objects)!
210 GNU Smalltalk Library Reference
1.125.5 ObjectDumper: accessing
flush ‘Forget’ any information on previously stored objects.
stream Answer the ByteStream to which the ObjectDumper will write and from whichit will read.
stream: aByteStreamSet the ByteStream to which the ObjectDumper will write and from which itwill read.
1.125.6 ObjectDumper: loading/dumping objects
dump: anObjectDump anObject on the stream associated with the receiver. Answer anObject
load Load an object from the stream associated with the receiver and answer it
1.125.7 ObjectDumper: stream interface
atEnd Answer whether the underlying stream is at EOF
next Load an object from the underlying stream
nextPut: anObjectStore an object on the underlying stream
1.126 ObjectMemory
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I provide a few methods that enable one to tune the virtual machine’s usageof memory. In addition, I can signal to my dependants some ‘events’ that canhappen during the virtual machine’s life.
ObjectMemory has both class-side and instance-side methods. In general, class-side methods provide means to tune the parameters of the memory manager,while instance-side methods are used together with the #current class-sidemethod to take a look at statistics on the memory manager’s state.
1.126.1 ObjectMemory class: accessing
current Return a snapshot of the VM’s memory management statistics.
1.126.2 ObjectMemory class: builtins
abort Quit the Smalltalk environment, dumping core.
addressOf: anObjectReturns the address of the actual object that anObject references. Note that,with the exception of fixed objects this address is only valid until the nextgarbage collection; thus it’s pretty risky to count on the address returned bythis method for very long.
Chapter 1: Base classes 211
addressOfOOP: anObjectReturns the address of the OOP (object table slot) for anObject. The address isan Integer and will not change over time (i.e. is immune from garbage collectoraction) except if the virtual machine is stopped and restarted.
bigObjectThresholdAnswer the smallest size for objects that are allocated outside the main heapin the hope of providing more locality of reference between small objects.
bigObjectThreshold: bytesSet the smallest size for objects that are allocated outside the main heap in thehope of providing more locality of reference between small objects. bytes mustbe a positive SmallInteger.
compact Force a full garbage collection, including compaction of oldspace
finishIncrementalGCDo a step in the incremental garbage collection.
gcMessage Answer whether messages indicating that garbage collection is taking place areprinted on stdout
gcMessage: aBooleanSet whether messages indicating that garbage collection is taking place areprinted on stdout
globalGarbageCollectForce a full garbage collection
growThresholdPercentAnswer the percentage of the amount of memory used by the system growswhich has to be full for the system to allocate more memory
growThresholdPercent: growPercentSet the percentage of the amount of memory used by the system grows whichhas to be full for the system to allocate more memory
growTo: numBytesGrow the amount of memory used by the system grows to numBytes.
incrementalGCStepDo a step in the incremental garbage collection.
quit Quit the Smalltalk environment. Whether files are closed and other similarcleanup occurs depends on the platform
quit: exitStatusQuit the Smalltalk environment, passing the exitStatus integer to the OS. Filesare closed and other similar cleanups occur.
scavenge Force a minor garbage collection
smoothingFactorAnswer the factor (between 0 and 1) used to smooth the statistics provided bythe virtual machine about memory handling. 0 disables updating the averages,1 disables the smoothing (the statistics return the last value).
212 GNU Smalltalk Library Reference
smoothingFactor: rateSet the factor (between 0 and 1) used to smooth the statistics provided by thevirtual machine about memory handling. 0 disables updating the averages, 1disables the smoothing (the statistics return the last value).
spaceGrowRateAnswer the rate with which the amount of memory used by the system grows
spaceGrowRate: rateSet the rate with which the amount of memory used by the system grows
1.126.3 ObjectMemory class: initialization
changed: aSymbolNot commented.
initialize Initialize the globals
1.126.4 ObjectMemory class: saving the image
snapshot Save a snapshot on the image file that was loaded on startup.
snapshot: aStringSave an image on the aString file
1.126.5 ObjectMemory: accessing
allocFailuresAnswer the number of times that the old-space allocator found no block thatwas at least as big as requested, and had to ask the operating system for morememory.
allocMatchesAnswer the number of times that the old-space allocator found a block thatwas exactly as big as requested.
allocProbesAnswer the number of free blocks that the old-space allocator had to examineso far to allocate all the objects that are in old-space
allocSplits Answer the number of times that the old-space allocator could not find a blockthat was exactly as big as requested, and had to split a larger free block in twoparts.
bytesPerOOPAnswer the number of bytes that is taken by an ordinary object pointer (inpractice, a field such as a named instance variable).
bytesPerOTEAnswer the number of bytes that is taken by an object table entry (in practice,the overhead incurred by every object in the system, with the sole exception ofSmallIntegers).
edenSize Answer the number of bytes in the ‘eden’ area of the young generation (inpractice, the number of allocated bytes between two scavenges).
Chapter 1: Base classes 213
edenUsedBytesAnswer the number of bytes that are currently filled in the ‘eden’ area of theyoung generation.
fixedSpaceSizeAnswer the number of bytes in the special heap devoted to objects that thegarbage collector cannot move around in memory.
fixedSpaceUsedBytesAnswer the number of bytes that are currently filled in the special heap devotedto objects that the garbage collector cannot move around in memory.
numCompactionsAnswer the number of oldspace compactions that happened since the VM wasstarted.
numFixedOOPsAnswer the number of objects that the garbage collector cannot move aroundin memory.
numFreeOTEsAnswer the number of entries that are currently free in the object table.
numGlobalGCsAnswer the number of global garbage collections (collection of the entire heap)that happened since the VM was started.
numGrowthsAnswer the number of times that oldspace was grown since the VM was started.
numOTEs Answer the number of entries that are currently allocated for the object table.
numOldOOPsAnswer the number of objects that reside in the old generation.
numScavengesAnswer the number of scavenges (fast collections of the young generation) thathappened since the VM was started.
numWeakOOPsAnswer the number of weak objects that the garbage collector is currentlytracking.
oldSpaceSizeAnswer the number of bytes in the old generation.
oldSpaceUsedBytesAnswer the number of bytes that are currently filled in the old generation.
reclaimedBytesPerGlobalGCAnswer the average number of bytes that are found to be garbage during aglobal garbage collections.
reclaimedBytesPerScavengeAnswer the average number of bytes that are found to be garbage during ascavenge.
214 GNU Smalltalk Library Reference
reclaimedPercentPerScavengeAnswer the average percentage of allocated bytes that are found to be garbageduring a scavenge. If this number falls below 60-70 you should definitely incre-ment the size of the eden, because you risk that scavenging is eating a consider-able fraction of your execution time; do the measurement on a restarted image,so that the extra tenuring incurred when creating long-lived objects such asclasses or methods is not considered.
survSpaceSizeAnswer the number of bytes in the ‘survivor’ area of the young generation (thearea to which young objects are relocated during scavenges).
survSpaceUsedBytesAnswer the number of bytes that are currently filled in the ‘survivor’ area ofthe young generation.
tenuredBytesPerScavengeAnswer the average number of bytes that are promoted to oldspace during ascavenge.
timeBetweenGlobalGCsAnswer the average number of milliseconds between two global garbage collec-tions.
timeBetweenGrowthsAnswer the average number of milliseconds between decisions to grow the heap.
timeBetweenScavengesAnswer the average number of milliseconds between two scavenges (fast collec-tions of the young generation).
timeToCollectAnswer the average number of milliseconds that a global garbage collectiontakes.
timeToCompactAnswer the average number of milliseconds that compacting the heap takes.This the same time that is taken by growing the heap.
timeToScavengeAnswer the average number of milliseconds that a scavenge takes (fast collec-tions of the young generation).
1.126.6 ObjectMemory: builtins
update Update the values in the object to the current state of the VM.
1.126.7 ObjectMemory: derived information
scavengesBeforeTenuringAnswer the number of scavenges that an object must on average survive beforebeing promoted to oldspace; this is however only an estimate because objectsthat are reachable from oldspace have a higher probability to be tenured soon,
Chapter 1: Base classes 215
while objects that are only reachable from thisContext have a lower probabilityto be tenured. Anyway, if this number falls below 2-3 you should definitelyincrement the size of eden and/or of survivor space, because you are tenuringtoo often and relying too much on global garbage collection to keep your heapclean; do the measurement on a restarted image, so that the extra tenuringincurred when creating long-lived objects such as classes or methods is notconsidered.
1.127 OrderedCollection
Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable
My instances represent ordered collections of arbitrary typed objects which arenot directly accessible by an index. They can be accessed indirectly through anindex, and can be manipulated by adding to the end or based on content (suchas add:after:)
1.127.1 OrderedCollection class: instance creation
new Answer an OrderedCollection of default size
new: anIntegerAnswer an OrderedCollection of size anInteger
1.127.2 OrderedCollection: accessing
at: anIndexAnswer the anIndex-th item of the receiver
at: anIndex put: anObjectStore anObject at the anIndex-th item of the receiver, answer anObject
first Answer the first item of the receiver
last Answer the last item of the receiver
size Return the number of objects in the receiver
1.127.3 OrderedCollection: adding
add: anObjectAdd anObject in the receiver, answer it
add: newObject after: oldObjectAdd newObject in the receiver just after oldObject, answer it. Fail if oldObjectcan’t be found
add: newObject afterIndex: iAdd newObject in the receiver just after the i-th, answer it. Fail if i < 0 or i >self size
add: newObject before: oldObjectAdd newObject in the receiver just before oldObject, answer it. Fail if oldOb-ject can’t be found
216 GNU Smalltalk Library Reference
add: newObject beforeIndex: iAdd newObject in the receiver just before the i-th, answer it. Fail if i < 1 or i> self size + 1
addAll: aCollectionAdd every item of aCollection to the receiver, answer it
addAll: newCollection after: oldObjectAdd every item of newCollection to the receiver just after oldObject, answer it.Fail if oldObject is not found
addAll: newCollection afterIndex: iAdd every item of newCollection to the receiver just after the i-th, answer it.Fail if i < 0 or i > self size
addAll: newCollection before: oldObjectAdd every item of newCollection to the receiver just before oldObject, answerit. Fail if oldObject is not found
addAll: newCollection beforeIndex: iAdd every item of newCollection to the receiver just before the i-th, answer it.Fail if i < 1 or i > self size + 1
addAllFirst: aCollectionAdd every item of newCollection to the receiver right at the start of the receiver.Answer aCollection
addAllLast: aCollectionAdd every item of newCollection to the receiver right at the end of the receiver.Answer aCollection
addFirst: newObjectAdd newObject to the receiver right at the start of the receiver. Answer newOb-ject
addLast: newObjectAdd newObject to the receiver right at the end of the receiver. Answer newOb-ject
1.127.4 OrderedCollection: built ins
primReplaceFrom: start to: stop with: byteArray startingAt: replaceStartReplace the characters from start to stop with new characters whose ASCIIcodes are contained in byteArray, starting at the replaceStart location ofbyteArray
1.127.5 OrderedCollection: enumerating
do: aBlockEvaluate aBlock for all the elements in the collection
1.127.6 OrderedCollection: removing
identityRemove: oldObjectRemove oldObject from the receiver. If absent, fail, else answer oldObject.
Chapter 1: Base classes 217
identityRemove: anObject ifAbsent: aBlockRemove anObject from the receiver. If it can’t be found, answer the result ofevaluating aBlock
remove: anObject ifAbsent: aBlockRemove anObject from the receiver. If it can’t be found, answer the result ofevaluating aBlock
removeAtIndex: anIndexRemove the object at index anIndex from the receiver. Fail if the index is outof bounds.
removeFirstRemove an object from the start of the receiver. Fail if the receiver is empty
removeLastRemove an object from the end of the receiver. Fail if the receiver is empty
1.128 Package
Defined in namespace SmalltalkSuperclass: Kernel.PackageInfoCategory: Language-Packaging
I am not part of a standard Smalltalk system. I store internally the informationon a Smalltalk package, and can output my description in XML.
1.128.1 Package class: accessing
tags Not commented.
1.128.2 Package class: instance creation
parse: file Answer a package from the XML description in file.
1.128.3 Package: accessing
addBuiltFile: aStringNot commented.
addCallout: aStringNot commented.
addFeature: aStringNot commented.
addFile: aStringNot commented.
addFileIn: aStringNot commented.
addLibrary: aStringNot commented.
218 GNU Smalltalk Library Reference
addModule: aStringNot commented.
addPrerequisite: aStringNot commented.
addSunitScript: aStringNot commented.
baseDirectoriesAnswer ‘baseDirectories’.
baseDirectories: aCollectionCheck if it’s possible to resolve the names in the package according to thebase directories in baseDirectories, which depend on where the packages.xmlis found: the three possible places are 1) the system kernel directory’s parentdirectory, 2) the local kernel directory’s parent directory, 3) the local imagedirectory (in order of decreasing priority).
For a packages.xml found in the system kernel directory’s parent directory,all three directories are searched. For a packages.xml found in the local ker-nel directory’s parent directory, only directories 2 and 3 are searched. For apackages.xml directory in the local image directory, instead, only directory 3 issearched.
builtFiles Answer a (modifiable) OrderedCollection of files that are part of the packagebut are not distributed.
callouts Answer a (modifiable) Set of call-outs that are required to load the package.Their presence is checked after the libraries and modules are loaded so that youcan do a kind of versioning.
directory Answer the base directory from which to load the package.
features Answer a (modifiable) Set of features provided by the package.
fileIns Answer a (modifiable) OrderedCollections of files that are to be filed-in to loadthe package. This is usually a subset of ‘files’ and ‘builtFiles’.
files Answer a (modifiable) OrderedCollection of files that are part of the package.
fullPathOf: fileNameTry appending ’self directory’ and fileName to each of the directory in baseDi-rectories, and return the path to the first tried filename that exists. Raise aPackageNotAvailable exception if no directory is found that contains the file.
libraries Answer a (modifiable) Set of shared library names that are required to load thepackage.
modules Answer a (modifiable) Set of modules that are required to load the package.
namespaceAnswer the namespace in which the package is loaded.
namespace: aStringSet to aString the namespace in which the package is loaded.
Chapter 1: Base classes 219
prerequisitesAnswer a (modifiable) Set of prerequisites.
primFileInPrivate - File in the given package without paying attention at dependenciesand C callout availability
relativeDirectoryAnswer the directory, relative to the packages file, from which to load thepackage.
relativeDirectory: dirSet the directory, relative to the packages file, from which to load the package,to dir.
startScriptAnswer the start script for the package.
startScript: aStringSet the start script for the package to aString.
stopScript Answer the start script for the package.
stopScript: aStringSet the stop script for the package to aString.
sunitScriptsAnswer a (modifiable) OrderedCollection of SUnit scripts that compose thepackage’s test suite.
test Answer the test sub-package.
test: aPackageSet the test sub-package to be aPackage.
url Answer the URL at which the package repository can be found.
url: aStringSet to aString the URL at which the package repository can be found.
version Not commented.
version: aVersionNot commented.
1.128.4 Package: still unclassified
checkTagIfInPath: aStringNot commented.
dir: file tag: aDictionaryNot commented.
isInPath Not commented.
parseAttributes: aStringNot commented.
220 GNU Smalltalk Library Reference
path Not commented.
path: aStringNot commented.
1.128.5 Package: version parsing
parseVersion: aStringNot commented.
1.129 PackageLoader
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Packaging
I am not part of a standard Smalltalk system. I provide methods for retrievingpackage information from an XML file and to load packages into a Smalltalkimage, correctly handling dependencies.
1.129.1 PackageLoader class: accessing
builtFilesFor: packageAnswer a Set of Strings containing the filenames of the given package’s machine-generated files (relative to the directory answered by #directoryFor:)
calloutsFor: packageAnswer a Set of Strings containing the filenames of the given package’s requiredcallouts (relative to the directory answered by #directoryFor:)
directoryFor: packageAnswer a Directory object to the given package’s files
featuresFor: packageAnswer a Set of Strings containing the features provided by the given package.
fileInsFor: packageAnswer a Set of Strings containing the filenames of the given package’s file-ins(relative to the directory answered by #directoryFor:)
filesFor: packageAnswer a Set of Strings containing the filenames of the given package’s files(relative to the directory answered by #directoryFor:)
flush Set to reload the ‘packages.xml’ file the next time it is needed.
ignoreCalloutsAnswer whether unavailable C callouts must generate errors or not.
ignoreCallouts: aBooleanSet whether unavailable C callouts must generate errors or not.
librariesFor: packageAnswer a Set of Strings containing the filenames of the given package’s libraries(relative to the directory answered by #directoryFor:)
Chapter 1: Base classes 221
modulesFor: packageAnswer a Set of Strings containing the filenames of the given package’s modules(relative to the directory answered by #directoryFor:)
packageAt: packageAnswer a Package object for the given package
packageAt: package ifAbsent: aBlockAnswer a Package object for the given package
prerequisitesFor: packageAnswer a Set of Strings containing the prerequisites for the given package
refresh Reload the ‘packages.xml’ file in the image and kernel directories. The threepossible places are 1) the kernel directory’s parent directory, 2) the ‘.st’ subdi-rectory of the user’s home directory, 3) the local image directory (in order ofdecreasing priority).
For a packages.xml found in the kernel directory’s parent directory, all threedirectories are searched. For a packages.xml found in the ‘.st’ subdirectory,only directories 2 and 3 are searched. For a packages.xml directory in the localimage directory, finally, only directory 3 is searched.
sunitScriptFor: packageAnswer a Strings containing a SUnit script that describes the package’s testsuite.
1.129.2 PackageLoader class: loading
fileInPackage: packageFile in the given package into GNU Smalltalk.
fileInPackages: packagesListFile in all the packages in packagesList into GNU Smalltalk.
1.129.3 PackageLoader class: testing
canLoad: packageAnswer whether all the needed pre-requisites for package are available.
1.130 Permission
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Security
I am the basic class that represents whether operations that could harm thesystem’s security are allowed or denied.
1.130.1 Permission class: testing
allowing: aSymbol target: aTarget action: actionNot commented.
222 GNU Smalltalk Library Reference
allowing: aSymbol target: aTarget actions: actionsArrayNot commented.
denying: aSymbol target: aTarget action: actionNot commented.
denying: aSymbol target: aTarget actions: actionsArrayNot commented.
granting: aSymbol target: aTarget action: actionNot commented.
granting: aSymbol target: aTarget actions: actionsArrayNot commented.
name: aSymbol target: aTarget action: actionNot commented.
name: aSymbol target: aTarget actions: actionsArrayNot commented.
1.130.2 Permission: accessing
action: anObjectNot commented.
actions Answer ‘actions’.
actions: anObjectNot commented.
allow Not commented.
allowing Not commented.
deny Not commented.
denying Not commented.
isAllowing Answer ‘positive’.
name Answer ‘name’.
name: anObjectNot commented.
target Answer ‘target’.
target: anObjectNot commented.
1.130.3 Permission: testing
check: aPermission for: anObjectNot commented.
implies: aPermissionNot commented.
Chapter 1: Base classes 223
1.131 PluggableAdaptor
Defined in namespace SmalltalkSuperclass: ValueAdaptorCategory: Language-Data types
I mediate between complex get/set behavior and the #value/#value: proto-col used by ValueAdaptors. The get/set behavior can be implemented by twoblocks, or can be delegated to another object with messages such as #some-Property to get and #someProperty: to set.
1.131.1 PluggableAdaptor class: creating instances
getBlock: getBlock putBlock: putBlockAnswer a PluggableAdaptor using the given blocks to implement #value and#value:
on: anObject aspect: aSymbolAnswer a PluggableAdaptor using anObject’s aSymbol message to implement#value, and anObject’s aSymbol: message (aSymbol followed by a colon) toimplement #value:
on: anObject getSelector: getSelector putSelector: putSelectorAnswer a PluggableAdaptor using anObject’s getSelector message to implement#value, and anObject’s putSelector message to implement #value:
on: anObject index: anIndexAnswer a PluggableAdaptor using anObject’s #at: and #at:put: message toimplement #value and #value:; the first parameter of #at: and #at:put: isanIndex
on: aDictionary key: aKeySame as #on:index:. Provided for clarity and completeness.
1.131.2 PluggableAdaptor: accessing
value Get the value of the receiver.
value: anObjectSet the value of the receiver.
1.132 PluggableProxy
Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files
I am a proxy that stores a different object and, upon load, sends #reconstruc-tOriginalObject to that object (which can be a DirectedMessage, in which casethe message is sent). The object to be stored is retrieved by sending #bina-ryRepresentationObject to the object.
224 GNU Smalltalk Library Reference
1.132.1 PluggableProxy class: accessing
on: anObjectAnswer a proxy to be used to save anObject. The proxy stores a different objectobtained by sending to anObject the #binaryRepresentationObject message(embedded between #preStore and #postStore as usual).
1.132.2 PluggableProxy: saving and restoring
object Reconstruct the object stored in the proxy and answer it; the binaryRepresen-tationObject is sent the #reconstructOriginalObject message, and the resultingobject is sent the #postLoad message.
1.133 Point
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
Beginning of a Point class for simple display manipulation. Has not been ex-haustively tested but appears to work for the basic primitives and for the needsof the Rectangle class.
1.133.1 Point class: instance creation
new Create a new point with both coordinates set to 0
x: xInteger y: yIntegerCreate a new point with the given coordinates
1.133.2 Point: accessing
x Answer the x coordinate
x: aNumberSet the x coordinate to aNumber
x: anXNumber y: aYNumberSet the x and y coordinate to anXNumber and aYNumber, respectively
y Answer the y coordinate
y: aNumberSet the y coordinate to aNumber
1.133.3 Point: arithmetic
* scale Multiply the receiver by scale, which can be a Number or a Point
+ delta Sum the receiver and delta, which can be a Number or a Point
- delta Subtract delta, which can be a Number or a Point, from the receiver
/ scale Divide the receiver by scale, which can be a Number or a Point, with no loss ofprecision
Chapter 1: Base classes 225
// scale Divide the receiver by scale, which can be a Number or a Point, with truncationtowards -infinity
abs Answer a new point whose coordinates are the absolute values of the receiver’s
1.133.4 Point: comparing
< aPoint Answer whether the receiver is higher and to the left of aPoint
<= aPoint Answer whether aPoint is equal to the receiver, or the receiver is higher and tothe left of aPoint
= aPoint Answer whether the receiver is equal to aPoint
> aPoint Answer whether the receiver is lower and to the right of aPoint
>= aPoint Answer whether aPoint is equal to the receiver, or the receiver is lower and tothe right of aPoint
max: aPointAnswer self if it is lower and to the right of aPoint, aPoint otherwise
min: aPointAnswer self if it is higher and to the left of aPoint, aPoint otherwise
1.133.5 Point: converting
asPoint Answer the receiver.
asRectangleAnswer an empty rectangle whose origin is self
corner: aPointAnswer a Rectangle whose origin is the receiver and whose corner is aPoint
extent: aPointAnswer a Rectangle whose origin is the receiver and whose extent is aPoint
hash Answer an hash value for the receiver
1.133.6 Point: point functions
arcTan Answer the angle (measured counterclockwise) between the receiver and a raystarting in (0, 0) and moving towards (1, 0) - i.e. 3 o’clock
dist: aPointAnswer the distance between the receiver and aPoint
dotProduct: aPointAnswer the dot product between the receiver and aPoint
grid: aPointAnswer a new point whose coordinates are rounded towards the nearest multipleof aPoint
normal Rotate the Point 90degrees clockwise and get the unit vector
226 GNU Smalltalk Library Reference
transpose Answer a new point whose coordinates are the receiver’s coordinates exchanged(x becomes y, y becomes x)
truncatedGrid: aPointAnswer a new point whose coordinates are rounded towards -infinity, to a mul-tiple of grid (which must be a Point)
1.133.7 Point: printing
printOn: aStreamPrint a representation for the receiver on aStream
1.133.8 Point: storing
storeOn: aStreamPrint Smalltalk code compiling to the receiver on aStream
1.133.9 Point: truncation and round off
rounded Answer a new point whose coordinates are rounded to the nearest integer
truncateTo: gridAnswer a new point whose coordinates are rounded towards -infinity, to a mul-tiple of grid (which must be a Number)
1.134 PositionableStream
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Collections
My instances represent streams where explicit positioning is permitted. Thus,my streams act in a manner to normal disk files: you can read or write se-quentially, but also position the file to a particular place whenever you choose.Generally, you’ll want to use ReadStream, WriteStream or ReadWriteStreaminstead of me to create and use streams.
1.134.1 PositionableStream class: instance creation
on: aCollectionAnswer an instance of the receiver streaming on the whole contents of aCollec-tion
on: aCollection from: firstIndex to: lastIndexAnswer an instance of the receiver streaming from the firstIndex-th item ofaCollection to the lastIndex-th
1.134.2 PositionableStream: accessing-reading
close Disassociate a stream from its backing store.
contents Returns a collection of the same type that the stream accesses, up to andincluding the final element.
Chapter 1: Base classes 227
copyFrom: start to: endAnswer the data on which the receiver is streaming, from the start-th item tothe end-th. Note that this method is 0-based, unlike the one in Collection,because a Stream’s #position method returns 0-based values.
next Answer the next item of the receiver. Returns nil when at end of stream.
nextAvailable: anInteger into: aCollection startingAt: posPlace up to anInteger objects from the receiver into aCollection, starting fromposition pos in the collection and stopping if no more data is available.
nextAvailable: anInteger putAllOn: aStreamCopy up to anInteger objects from the receiver into aStream, stopping if nomore data is available.
peek Returns the next element of the stream without moving the pointer. Returnsnil when at end of stream.
peekFor: anObjectReturns true and gobbles the next element from the stream of it is equal toanObject, returns false and doesn’t gobble the next element if the next elementis not equal to anObject.
readStreamAnswer a ReadStream on the same contents as the receiver
reverseContentsReturns a collection of the same type that the stream accesses, up to andincluding the final element, but in reverse order.
upTo: anObjectReturns a collection of the same type that the stream accesses, up to but notincluding the object anObject. Returns the entire rest of the stream’s contentsif anObject is not present.
upToEnd Returns a collection of the same type that the stream accesses, containing theentire rest of the stream’s contents.
1.134.3 PositionableStream: class type methods
isExternalStreamWe stream on a collection residing in the image, so answer false
species Return the type of the collections returned by #upTo: etc., which are the samekind as those returned by the collection with methods such as #select:.
1.134.4 PositionableStream: compiling
name Answer a string that represents what the receiver is streaming on
segmentFrom: startPos to: endPosAnswer an object that, when sent #asString, will yield the result of sending‘copyFrom: startPos to: endPos’ to the receiver
228 GNU Smalltalk Library Reference
1.134.5 PositionableStream: positioning
basicPosition: anIntegerMove the stream pointer to the anInteger-th object
isPositionableAnswer true if the stream supports moving backwards with #skip:.
position Answer the current value of the stream pointer
position: anIntegerMove the stream pointer to the anInteger-th object
reset Move the stream back to its first element. For write-only streams, the streamis truncated there.
setToEnd Move the current position to the end of the stream.
size Answer the size of data on which we are streaming.
skip: anIntegerMove the current position by anInteger places, either forwards or backwards.
1.134.6 PositionableStream: still unclassified
nextPutAllOn: aStreamWrite all the objects in the receiver to aStream.
1.134.7 PositionableStream: testing
atEnd Answer whether the objects in the stream have reached an end
basicAtEndAnswer whether the objects in the stream have reached an end. This methodmust NOT be overridden.
isEmpty Answer whether the stream has no objects
1.134.8 PositionableStream: truncating
truncate Truncate the receiver to the current position - only valid for writing streams
1.135 Process
Defined in namespace SmalltalkSuperclass: LinkCategory: Language-Processes
I represent a unit of computation. My instances are independantly executableblocks that have a priority associated with them, and they can suspend them-selves and resume themselves however they wish.
1.135.1 Process: accessing
externalInterruptsEnabledAnswer whether the receiver is executed with interrupts enabled
Chapter 1: Base classes 229
name Answer the user-friendly name of the process.
name: aStringGive the name aString to the process
priority Answer the receiver’s priority
priority: anIntegerChange the receiver’s priority to anInteger
queueInterrupt: aBlockForce the receiver to be interrupted and to evaluate aBlock as soon as it becomesthe active process (this could mean NOW if the receiver is active). If the processis temporarily suspended or waiting on a semaphore, it is temporarily wokenup so that the interrupt is processed as soon as the process priority allows todo. Answer the receiver.
suspendedContextAnswer the context that the process was executing at the time it was suspended.
suspendedContext: aContextModify the context that the process was executing at the time it was suspended.
valueWithoutInterrupts: aBlockEvaluate aBlock and delay all interrupts that are requested during its executionto after aBlock returns.
1.135.2 Process: basic
context Return the execution context of the receiver.
debugger Return the object in charge of debugging the receiver. This always returns nilunless the DebugTools package is loaded.
finalize Terminate processes that are GCed while waiting on a dead semaphore.
lowerPriorityLower a bit the priority of the receiver. A #lowerPriority will cancel a previous#raisePriority, and vice versa.
makeUntrusted: aBooleanSet whether the receiver is trusted or not.
primTerminateTerminate the receiver - This is nothing more than prohibiting to resume theprocess, then suspending it.
raisePriorityRaise a bit the priority of the receiver. A #lowerPriority will cancel a previous#raisePriority, and vice versa.
singleStep Execute a limited amount of code (usually a bytecode, or up to the next back-ward jump, or up to the next message send) of the receiver, which must ina ready-to-run state (neither executing nor terminating nor suspended), thenrestart running the current process. The current process should have higher pri-ority than the receiver. For better performance, use the underlying primitive,Process>>#singleStepWaitingOn:.
230 GNU Smalltalk Library Reference
terminate Terminate the receiver after having evaluated all the #ensure: and#ifCurtailed: blocks that are active in it. This is done by signalling aProcessBeingTerminated notification.
terminateOnQuitMark the receiver so that it is terminated when ObjectMemory class>>#quit:is sent.
1.135.3 Process: builtins
resume Resume the receiver’s execution
singleStepWaitingOn: aSemaphoreExecute a limited amount of code (usually a bytecode, or up to the next back-ward jump, or up to the next message send) of the receiver, which must ina ready-to-run state (neither executing nor terminating nor suspended), thenrestart running the current process. aSemaphore is used as a means to synchro-nize the execution of the current process and the receiver and should have nosignals on it. The current process should have higher priority than the receiver.
suspend Do nothing if we’re already suspended. Note that the blue book made suspenda primitive - but the real primitive is yielding control to another process. Sus-pending is nothing more than taking ourselves out of every scheduling list andTHEN yielding control to another process
yield Yield control from the receiver to other processes
1.135.4 Process: debugging
detach Do nothing, instances of Process are already detached.
1.135.5 Process: printing
printOn: aStreamPrint a representation of the receiver on aStream
1.136 ProcessEnvironment
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes
I represent a proxy for thread-local variables defined for Smalltalk processes.Associations requested to me retrieve the thread-local value for the currentprocess. For now, I don’t provide the full protocol of a Dictionary; in particularthe iteration protocol is absent.
1.136.1 ProcessEnvironment class: disabled
new This method should not be called for instances of this class.
1.136.2 ProcessEnvironment class: singleton
uniqueInstanceReturn the singleton instance of ProcessEnvironment.
Chapter 1: Base classes 231
1.136.3 ProcessEnvironment: accessing
add: newObjectAdd the newObject association to the receiver
associationAt: keyAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
associationAt: key ifAbsent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
at: key Answer the value associated to the given key. Return nil if the key is not found
at: key ifAbsent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
at: key ifAbsentPut: aBlockAnswer the value associated to the given key, setting it to the result of evaluatingaBlock if the key is not found.
at: key ifPresent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
at: key put: valueStore value as associated to the given key
keys Answer a kind of Set containing the keys of the receiver
1.136.4 ProcessEnvironment: dictionary removing
remove: anAssociationRemove anAssociation’s key from the dictionary
remove: anAssociation ifAbsent: aBlockRemove anAssociation’s key from the dictionary
removeAllKeys: keysRemove all the keys in keys, without raising any errors
removeAllKeys: keys ifAbsent: aBlockRemove all the keys in keys, passing the missing keys as parameters to aBlockas they’re encountered
removeKey: aSymbolRemove the aSymbol key from the dictionary
removeKey: aSymbol ifAbsent: aBlockRemove the aSymbol key from the dictionary
1.136.5 ProcessEnvironment: dictionary testing
includesKey: keyAnswer whether the receiver contains the given key
232 GNU Smalltalk Library Reference
1.137 ProcessorScheduler
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes
I provide methods that control the execution of processes.
1.137.1 ProcessorScheduler class: instance creation
new Error—new instances of ProcessorScheduler should not be created.
1.137.2 ProcessorScheduler: basic
activeDebuggerAnswer the active process’ debugger
activePriorityAnswer the active process’ priority
activeProcessAnswer the active process
processEnvironmentAnswer another singleton object hosting thread-local variables for the Smalltalkprocesses. This acts like a normal Dictionary with a couple of differences: a)using #associationAt: will return special associations that retrieve a thread-local value; b) requesting missing keys will return nil, and removing them willbe a nop.
processesAt: aPriorityAnswer a linked list of processes at the given priority
terminateActiveTerminate the active process
timeSlice Answer the timeslice that is assigned to each Process before it is automati-cally preempted by the system (in milliseconds). An answer of zero meansthat preemptive multitasking is disabled. Note that the system by default iscompiled without preemptive multitasking, and that even if it is enabled itwill work only under BSD derivatives (or, in general, systems that supportITIMER VIRTUAL).
timeSlice: milliSecondsSet the timeslice that is assigned to each Process before it is automaticallypreempted by the system. Setting this to zero disables preemptive multitask-ing. Note that the system by default is compiled with preemptive multitaskingdisabled, and that even if it is enabled it will surely work only under BSDderivatives (or, in general, systems that support ITIMER VIRTUAL).
yield Let the active process yield control to other processes
Chapter 1: Base classes 233
1.137.3 ProcessorScheduler: built ins
disableInterruptsDisable interrupts caused by external events while the current process is execut-ing. Note that interrupts are disabled on a per-process basis, and that calling#disableInterrupts twice requires calling #enableInterrupts twice as well tore-enable interrupts.
enableInterruptsRe-enable interrupts caused by external events while the current process isexecuting. By default, interrupts are enabled.
1.137.4 ProcessorScheduler: idle tasks
idle Private - Call the next idle task. Return whether GNU Smalltalk should pauseuntil the next OS signal.
idleAdd: aBlockRegister aBlock to be executed when things are idle
initialize Private - Start the finalization process.
pause: aBooleanPrivate - Pause for some time if aBoolean is false, or until a signal if it is true.
startFinalizersPrivate - Fire a low-priority process to finalize the objects
update: aSymbolIf we left some work behind when the image was saved, do it now.
1.137.5 ProcessorScheduler: printing
printOn: aStreamStore onto aStream a printed representation of the receiver
1.137.6 ProcessorScheduler: priorities
highIOPriorityAnswer the priority for system high-priority I/O processes, such as a processhandling input from a network.
highestPriorityAnswer the highest valid priority
idlePriorityAnswer the priority of idle processes.
lowIOPriorityAnswer the priority for system low-priority I/O processes. Examples are theprocess handling input from the user (keyboard, pointing device, etc.) and theprocess distributing input from a network.
lowestPriorityAnswer the lowest valid priority
234 GNU Smalltalk Library Reference
priorityName: priorityPrivate - Answer a name for the given process priority
systemBackgroundPriorityAnswer the priority for system background-priority processes. An incrementalgarbage collector could run at this level but now it runs at idlePriority instead.
timingPriorityAnswer the priority for system real-time processes.
unpreemptedPriorityAnswer the highest priority avilable in the system; never create a process withthis priority, instead use BlockClosure>>#valueWithoutPreemption.
userBackgroundPriorityAnswer the priority for user background-priority processes
userInterruptPriorityAnswer the priority for user interrupt-priority processes. Processes run at thislevel will preempt the window scheduler and should, therefore, not consume theprocessor forever.
userSchedulingPriorityAnswer the priority for user standard-priority processes
1.137.7 ProcessorScheduler: storing
storeOn: aStreamStore onto aStream a Smalltalk expression which evaluates to the receiver
1.137.8 ProcessorScheduler: timed invocation
isTimeoutProgrammedPrivate - Answer whether there is a pending call to #signal:atMilliseconds:
signal: aSemaphore atNanosecondClockValue: nsPrivate - signal ’aSemaphore’ when the nanosecond clock reaches ’ns’ nanosec-onds.
signal: aSemaphore onInterrupt: anIntegerSignalNumberSignal ’aSemaphore’ when the given C signal occurs.
1.138 ProcessVariable
Defined in namespace SmalltalkSuperclass: LookupKeyCategory: Language-Processes
I represent a proxy for a thread-local variable defined for a process. Requestingthe value will return the thread-local setting for the current process.
1.138.1 ProcessVariable class: accessing
key: anObjectReturn a new ProcessVariable with the given key. Not that the key need notbe a symbol or string, for example you could use an array #(#{class name}
Chapter 1: Base classes 235
’name’). Setting the variable’s value will automatically create it in the currentprocess, while removal must be done by hand through the ProcessEnvironmentsingleton object.
new Return a new ProcessVariable with a new anonymous but unique key. It issuggested to use a descriptive name instead to ease debugging. Setting thevariable’s value will automatically create it in the current process, while removalmust be done by hand through the ProcessEnvironment singleton object.
1.138.2 ProcessVariable: accessing
environmentReturn the environment in which this ProcessVariable lives. This is the single-ton instance of ProcessEnvironment for all variables.
use: anObject during: aBlockSet the value of this variable to anObject during the execution of aBlock, thenrestore it.
value Return the value of this variable in the current process.
value: anObjectSet the value of the current process’s copy of the variable to be anObject.
valueIfAbsent: aBlockReturn the value of this variable in the current process.
1.139 Promise
Defined in namespace SmalltalkSuperclass: ValueHolderCategory: Language-Data types
I store my value in a variable, and know whether I have been initialized or not.If you ask for my value and I have not been initialized, I suspend the processuntil a value has been assigned.
1.139.1 Promise class: creating instances
for: aBlockInvoke aBlock at an indeterminate time in an indeterminate process beforeanswering its value from #value sent to my result.
null This method should not be called for instances of this class.
1.139.2 Promise: accessing
hasError Answer whether calling #value will raise an exception.
hasValue Answer whether we already have a value (or calling #value will raise an error).
value Get the value of the receiver.
value: anObjectSet the value of the receiver.
236 GNU Smalltalk Library Reference
1.139.3 Promise: initializing
initialize Private - set the initial state of the receiver
1.139.4 Promise: printing
printOn: aStreamPrint a representation of the receiver
1.139.5 Promise: still unclassified
errorValue: anExceptionPrivate - Raise anException whenever #value is called.
1.140 Random
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams
My instances are generator streams that produce random numbers, which arefloating point values between 0 and 1.
1.140.1 Random class: instance creation
new Create a new random number generator whose seed is given by the current timeon the millisecond clock
seed: aFloatCreate a new random number generator whose seed is aFloat
1.140.2 Random class: shortcuts
between: low and: highReturn a random integer between the given extrema
next Return a random number between 0 and 1 (excluded)
source Return a standard source of random numbers.
1.140.3 Random: basic
atEnd This stream never ends. Always answer false.
between: low and: highReturn a random integer between low and high.
next Return the next random number in the sequence.
nextPut: valueThis method should not be called for instances of this class.
Chapter 1: Base classes 237
1.140.4 Random: testing
chiSquare Compute the chi-square of the random that this class generates.
chiSquare: n range: rReturn the chi-square deduced from calculating n random numbers in the 0..rrange.
1.141 ReadStream
Defined in namespace SmalltalkSuperclass: PositionableStreamCategory: Streams-Collections
I implement the set of read-only stream objects. You may read from my objects,but you may not write to them.
1.141.1 ReadStream class: instance creation
on: aCollectionAnswer a new stream working on aCollection from its start.
on: aCollection from: firstIndex to: lastIndexAnswer an instance of the receiver streaming from the firstIndex-th item ofaCollection to the lastIndex-th
1.142 ReadWriteStream
Defined in namespace SmalltalkSuperclass: WriteStreamCategory: Streams-Collections
I am the class of streams that may be read and written from simultaneously.In some sense, I am the best of both ReadStream and WriteStream.
1.142.1 ReadWriteStream class: instance creation
on: aCollectionAnswer a new stream working on aCollection from its start. The stream startsat the front of aCollection.
on: aCollection from: firstIndex to: lastIndexAnswer an instance of the receiver streaming from the firstIndex-th item ofaCollection to the lastIndex-th
with: aCollectionAnswer a new instance of the receiver which streams from the end of aCollection.
1.142.2 ReadWriteStream: positioning
contents Unlike WriteStreams, ReadWriteStreams return the whole contents of the un-derlying collection.
238 GNU Smalltalk Library Reference
1.143 Rectangle
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
Beginning of the Rectangle class for simple display manipulation. Rectanglesrequire the Point class to be available. An extension to the Point class is madehere that since it requires Rectangles to be defined (see converting)
1.143.1 Rectangle class: instance creation
left: leftNumber right: rightNumber top: topNumber bottom: bottomNumberAnswer a rectangle with the given coordinates
left: leftNumber top: topNumber right: rightNumber bottom: bottomNumberAnswer a rectangle with the given coordinates
new Answer the (0 @ 0 corner: 0 @ 0) rectangle
origin: originPoint corner: cornerPointAnswer a rectangle with the given corners
origin: originPoint extent: extentPointAnswer a rectangle with the given origin and size
1.143.2 Rectangle: accessing
bottom Answer the corner’s y of the receiver
bottom: aNumberSet the corner’s y of the receiver
bottomCenterAnswer the center of the receiver’s bottom side
bottomLeftAnswer the bottom-left corner of the receiver
bottomLeft: aPointAnswer the receiver with the bottom-left changed to aPoint
bottomRightAnswer the bottom-right corner of the receiver
bottomRight: aPointChange the bottom-right corner of the receiver
center Answer the center of the receiver
corner Answer the corner of the receiver
corner: aPointSet the corner of the receiver
extent Answer the extent of the receiver
extent: aPointChange the size of the receiver, keeping the origin the same
Chapter 1: Base classes 239
height Answer the height of the receiver
height: aNumberSet the height of the receiver
left Answer the x of the left edge of the receiver
left: aValueSet the x of the left edge of the receiver
left: l top: t right: r bottom: bChange all four the coordinates of the receiver’s corners
leftCenter Answer the center of the receiver’s left side
origin Answer the top-left corner of the receiver
origin: aPointChange the top-left corner of the receiver to aPoint
origin: pnt1 corner: pnt2Change both the origin (top-left corner) and the corner (bottom-right corner)of the receiver
origin: pnt1 extent: pnt2Change the top-left corner and the size of the receiver
right Answer the x of the bottom-right corner of the receiver
right: aNumberChange the x of the bottom-right corner of the receiver
rightCenterAnswer the center of the receiver’s right side
top Answer the y of the receiver’s top-left corner
top: aValueChange the y of the receiver’s top-left corner
topCenter Answer the center of the receiver’s top side
topLeft Answer the receiver’s top-left corner
topLeft: aPointChange the receiver’s top-left corner’s coordinates to aPoint
topRight Answer the receiver’s top-right corner
topRight: aPointChange the receiver’s top-right corner to aPoint
width Answer the receiver’s width
width: aNumberChange the receiver’s width to aNumber
1.143.3 Rectangle: copying
copy Return a deep copy of the receiver for safety.
240 GNU Smalltalk Library Reference
1.143.4 Rectangle: printing
printOn: aStreamPrint a representation of the receiver on aStream
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.143.5 Rectangle: rectangle functions
amountToTranslateWithin: aRectangleAnswer a Point so that if aRectangle is translated by that point, its origin lieswithin the receiver’s.
area Answer the receiver’s area. The area is the width times the height, so it ispossible for it to be negative if the rectangle is not normalized.
areasOutside: aRectangleAnswer a collection of rectangles containing the parts of the receiver outside ofaRectangle. For all points in the receiver, but outside aRectangle, exactly onerectangle in the collection will contain that point.
expandBy: deltaAnswer a new rectangle that is the receiver expanded by aValue: if aValue is arectangle, calculate origin=origin-aValue origin, corner=corner+aValue corner;else calculate origin=origin-aValue, corner=corner+aValue.
insetBy: deltaAnswer a new rectangle that is the receiver inset by aValue: if aValue is arectangle, calculate origin=origin+aValue origin, corner=corner-aValue corner;else calculate origin=origin+aValue, corner=corner-aValue.
insetOriginBy: originDelta corner: cornerDeltaAnswer a new rectangle that is the receiver inset so that ori-gin=origin+originDelta, corner=corner-cornerDelta. The deltas can be pointsor numbers
intersect: aRectangleAnswers the rectangle (if any) created by the overlap of rectangles A and B.Answers nil if the rectangles do not overlap
merge: aRectangleAnswer a new rectangle which is the smallest rectangle containing both thereceiver and aRectangle.
translatedToBeWithin: aRectangleAnswer a copy of the receiver that does not extend beyond aRectangle.
1.143.6 Rectangle: testing
= aRectangleAnswer whether the receiver is equal to aRectangle
Chapter 1: Base classes 241
contains: aRectangleAnswer true if the receiver contains (see containsPoint:) both aRectangle’sorigin and aRectangle’s corner
containsPoint: aPointAnswer true if aPoint is equal to, or below and to the right of, the receiver’sorigin; and aPoint is above and to the left of the receiver’s corner
hash Answer an hash value for the receiver
intersects: aRectangleAnswer true if the receiver intersect aRectangle, i.e. if it contains (seecontainsPoint:) any of aRectangle corners or if aRectangle contains thereceiver
1.143.7 Rectangle: transforming
moveBy: aPointChange the receiver so that the origin and corner are shifted by aPoint
moveTo: aPointChange the receiver so that the origin moves to aPoint and the size remainsunchanged
scaleBy: scaleAnswer a copy of the receiver in which the origin and corner are multiplied byscale
translateBy: factorAnswer a copy of the receiver in which the origin and corner are shifted byaPoint
1.143.8 Rectangle: truncation and round off
rounded Answer a copy of the receiver with the coordinates rounded to the nearestintegers
1.144 RecursionLock
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes
1.144.1 RecursionLock class: instance creation
new Answer a new semaphore
1.144.2 RecursionLock: accessing
isOwnerProcessAnswer whether the receiver is the owner of the lock.
name Answer a user-defined name for the lock.
242 GNU Smalltalk Library Reference
name: aStringSet to aString the user-defined name for the lock.
waitingProcessesAnswer the set of processes that are waiting on the semaphore.
wouldBlockAnswer whether sending #wait to the receiver would suspend the active process.
1.144.3 RecursionLock: mutual exclusion
critical: aBlockWait for the receiver to be free, execute aBlock and signal the receiver again.Return the result of evaluating aBlock.
1.144.4 RecursionLock: printing
printOn: aStreamPrint a human-readable represention of the receiver on aStream.
1.145 Regex
Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections-Text
A Regex is a read-only string for which the regular expression matcher cancache a compiled representation, thus speeding up matching. Regex objectsare constructed automatically by methods that expect to match many timesthe same regular expression, but can also be constructed explicitly sending#asRegex to a String or Symbol.
Creation of Regex objects inside a loop is of course slower than creating themoutside the loop, but special care is taken so that the same Regex object is usedwhenever possible (when converting Strings to Regex, the cache is sought foran equivalent, already constructed Regex).
1.145.1 Regex class: instance creation
fromString: aStringLike ‘aString asRegex’.
new Do not send this message.
1.145.2 Regex: basic
at: anIndex put: anObjectFail. Regex objects are read-only.
copy Answer the receiver; instances of Regex are identity objects because their onlypurpose is to ease caching, and we obtain better caching if we avoid copyingRegex objects
Chapter 1: Base classes 243
1.145.3 Regex: conversion
asRegex Answer the receiver, which *is* a Regex!
asString Answer the receiver, converted back to a String
species Answer ‘String’.
1.145.4 Regex: printing
displayOn: aStreamPrint a represention of the receiver on aStream. For most objects this is simplyits #printOn: representation, but for strings and characters, superfluous dollarsor extra pairs of quotes are stripped.
displayStringAnswer a String representing the receiver. For most objects this is simply its#printString, but for strings and characters, superfluous dollars or extra pairof quotes are stripped.
printOn: aStreamPrint a represention of the receiver on aStream.
1.146 RegexResults
Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections-Text
I hold the results of a regular expression match, and I can reconstruct whichparts of the matched string were assigned to each subexpression. Methods suchas #=~ return RegexResults objects, while others transform the string directlywithout passing the results object back to the caller.
1.146.1 RegexResults: accessing
asArray If the regular expression was matched, return an Array with the subexpressionsthat were present in the regular expression.
at: anIndexIf the regular expression was matched, return the text of the anIndex-th subex-pression in the successful match.
from If the regular expression was matched, return the index of the first character inthe successful match.
fromAt: anIndexIf the regular expression was matched, return the index of the first character ofthe anIndex-th subexpression in the successful match.
intervalAt: anIndexIf the regular expression was matched, return an Interval for the range of indicesin the anIndex-th subexpression of the successful match.
match If the regular expression was matched, return the text of the successful match.
244 GNU Smalltalk Library Reference
matchIntervalIf the regular expression was matched, return an Interval for the range of indicesof the successful match.
size If the regular expression was matched, return the number of subexpressionsthat were present in the regular expression.
subject If the regular expression was matched, return the text that was matched againstit.
to If the regular expression was matched, return the index of the last character inthe successful match.
toAt: anIndexIf the regular expression was matched, return the index of the last character ofthe anIndex-th subexpression in the successful match.
1.146.2 RegexResults: testing
ifMatched: oneArgBlockIf the regular expression was matched, pass the receiver to oneArgBlock andreturn its result. Otherwise, return nil.
ifMatched: oneArgBlock ifNotMatched: zeroArgBlockIf the regular expression was matched, evaluate oneArgBlock with the receiveras the argument. If it was not, evaluate zeroArgBlock. Answer the result ofthe block’s evaluation.
ifNotMatched: zeroArgBlockIf the regular expression was matched, return the receiver. If it was not, evaluatezeroArgBlock and return its result.
ifNotMatched: zeroArgBlock ifMatched: oneArgBlockIf the regular expression was matched, evaluate oneArgBlock with the receiveras the argument. If it was not, evaluate zeroArgBlock. Answer the result ofthe block’s evaluation.
matched Answer whether the regular expression was matched
1.147 RootNamespace
Defined in namespace SmalltalkSuperclass: AbstractNamespaceCategory: Language-Implementation
I am a special form of dictionary. Classes hold on an instance of me; it is calledtheir ‘environment’.
1.147.1 RootNamespace class: instance creation
new: spaceNameCreate a new root namespace with the given name, and add to Smalltalk a keythat references it.
Chapter 1: Base classes 245
1.147.2 RootNamespace: namespace hierarchy
siblings Answer all the other root namespaces
siblingsDo: aBlockEvaluate aBlock once for each of the other root namespaces, passing the names-pace as a parameter.
1.147.3 RootNamespace: overrides for superspaces
inheritedKeysAnswer a Set of all the keys in the receiver and its superspaces
set: key to: newValue ifAbsent: aBlockAssign newValue to the variable named as specified by ‘key’. This methodwon’t define a new variable; instead if the key is not found it will search insuperspaces and evaluate aBlock if it is not found. Answer newValue.
1.147.4 RootNamespace: printing
nameIn: aNamespaceAnswer Smalltalk code compiling to the receiver when the current namespaceis aNamespace
printOn: aStream in: aNamespacePrint on aStream some Smalltalk code compiling to the receiver when the cur-rent namespace is aNamespace
storeOn: aStreamStore Smalltalk code compiling to the receiver
1.148 RunArray
Defined in namespace SmalltalkSuperclass: OrderedCollectionCategory: Collections-Sequenceable
My instances are OrderedCollections that automatically apply Run Length En-coding compression to the things they store. Be careful when using me: I canprovide great space savings, but my instances don’t grant linear access time.RunArray’s behavior currently is similar to that of OrderedCollection (you canadd elements to RunArrays); maybe it should behave like an ArrayedCollection.
1.148.1 RunArray class: instance creation
new Answer an empty RunArray
new: aSizeAnswer a RunArray with space for aSize runs
1.148.2 RunArray: accessing
at: anIndexAnswer the element at index anIndex
246 GNU Smalltalk Library Reference
at: anIndex put: anObjectReplace the element at index anIndex with anObject and answer anObject
1.148.3 RunArray: adding
add: anObject afterIndex: anIndexAdd anObject after the element at index anIndex
addAll: aCollection afterIndex: anIndexAdd all the elements of aCollection after the one at index anIndex. If aCol-lection is unordered, its elements could be added in an order which is not the#do: order
addAllFirst: aCollectionAdd all the elements of aCollection at the beginning of the receiver. If aCol-lection is unordered, its elements could be added in an order which is not the#do: order
addAllLast: aCollectionAdd all the elements of aCollection at the end of the receiver. If aCollection isunordered, its elements could be added in an order which is not the #do: order
addFirst: anObjectAdd anObject at the beginning of the receiver. Watch out: this operation cancause serious performance pitfalls
addLast: anObjectAdd anObject at the end of the receiver
1.148.4 RunArray: basic
first Answer the first element in the receiver
last Answer the last element of the receiver
size Answer the number of elements in the receiver
1.148.5 RunArray: copying
deepCopy Answer a copy of the receiver containing copies of the receiver’s elements (-#copy is used to obtain them)
shallowCopyAnswer a copy of the receiver. The elements are not copied
1.148.6 RunArray: enumerating
do: aBlockEnumerate all the objects in the receiver, passing each one to aBlock
objectsAndRunLengthsDo: aBlockEnumerate all the runs in the receiver, passing to aBlock two parameters forevery run: the first is the repeated object, the second is the number of copies
Chapter 1: Base classes 247
1.148.7 RunArray: removing
removeAtIndex: anIndexRemove the object at index anIndex from the receiver and answer the removedobject
removeFirstRemove the first object from the receiver and answer the removed object
removeLastRemove the last object from the receiver and answer the removed object
1.148.8 RunArray: searching
indexOf: anObject startingAt: anIndex ifAbsent: aBlockAnswer the index of the first copy of anObject in the receiver, starting thesearch at the element at index anIndex. If no equal object is found, answer theresult of evaluating aBlock
1.148.9 RunArray: testing
= anObjectAnswer true if the receiver is equal to anObject
hash Answer an hash value for the receiver
1.149 ScaledDecimal
Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types
ScaledDecimal provides a numeric representation of fixed point decimal num-bers able to accurately represent decimal fractions. It supports unboundedprecision, with no limit to the number of digits before and after the decimalpoint.
1.149.1 ScaledDecimal class: instance creation
newFromNumber: aNumber scale: scaleAnswer a new instance of ScaledDecimal, representing a decimal fraction witha decimal representation considered valid up to the scale-th digit.
1.149.2 ScaledDecimal: arithmetic
* aNumberMultiply two numbers and answer the result.
+ aNumberSum two numbers and answer the result.
- aNumberSubtract aNumber from the receiver and answer the result.
248 GNU Smalltalk Library Reference
/ aNumberDivide two numbers and answer the result.
// aNumberAnswer the integer quotient after dividing the receiver by aNumber with trun-cation towards negative infinity.
\\ aNumberAnswer the remainder after integer division the receiver by aNumber with trun-cation towards negative infinity.
1.149.3 ScaledDecimal: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
asFloatD Answer the receiver, converted to a FloatD
asFloatE Answer the receiver, converted to a FloatE
asFloatQ Answer the receiver, converted to a FloatQ
asFraction Answer the receiver, converted to a Fraction
ceiling Answer the receiver, converted to an Integer and truncated towards +infinity.
coerce: aNumberAnswer aNumber, converted to a ScaledDecimal with the same scale as thereceiver.
fractionPartAnswer the fractional part of the receiver.
generality Return the receiver’s generality
integerPartAnswer the fractional part of the receiver.
truncated Answer the receiver, converted to an Integer and truncated towards -infinity.
1.149.4 ScaledDecimal: comparing
< aNumberAnswer whether the receiver is less than arg.
<= aNumberAnswer whether the receiver is less than or equal to arg.
= arg Answer whether the receiver is equal to arg.
> aNumberAnswer whether the receiver is greater than arg.
>= aNumberAnswer whether the receiver is greater than or equal to arg.
hash Answer an hash value for the receiver.
~= arg Answer whether the receiver is not equal arg.
Chapter 1: Base classes 249
1.149.5 ScaledDecimal: constants
one Answer the receiver’s representation of one.
zero Answer the receiver’s representation of zero.
1.149.6 ScaledDecimal: printing
displayOn: aStreamPrint a representation of the receiver on aStream, intended to be directed to auser. In this particular case, the ‘scale’ part of the #printString is not emitted.
printOn: aStreamPrint a representation of the receiver on aStream.
1.149.7 ScaledDecimal: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStreamPrint Smalltalk code that compiles to the receiver on aStream.
1.150 SecurityPolicy
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Security
I am the class that represents which operations that could harm the system’ssecurity are allowed or denied to a particular class. If a class does not havea policy, it is allowed everything if it is trusted, and denied everything if it isuntrusted
1.150.1 SecurityPolicy: modifying
addPermission: aPermissionNot commented.
owner: aClassNot commented.
removePermission: aPermissionNot commented.
withOwner: aClassNot commented.
1.150.2 SecurityPolicy: querying
check: aPermissionNot commented.
250 GNU Smalltalk Library Reference
implies: aPermissionNot commented.
1.151 Semaphore
Defined in namespace SmalltalkSuperclass: LinkedListCategory: Language-Processes
My instances represent counting semaphores. I provide methods for signallingthe semaphore’s availability, and methods for waiting for its availability. I alsoprovide some methods for implementing critical sections.
1.151.1 Semaphore class: instance creation
forMutualExclusionAnswer a new semaphore with a signal on it. These semaphores are a usefulshortcut when you use semaphores as critical sections.
new Answer a new semaphore
1.151.2 Semaphore: accessing
name Answer a user-friendly name for the receiver
name: aStringAnswer a user-friendly name for the receiver
waitingProcessesAnswer an Array of processes currently waiting on the receiver.
wouldBlockAnswer whether waiting on the receiver would suspend the current process.
1.151.3 Semaphore: builtins
lock Without putting the receiver to sleep, force processes that try to wait on thesemaphore to block. Answer whether this was the case even before.
notify Resume one of the processes that were waiting on the semaphore if there wereany. Do not leave a signal on the semaphore if no process is waiting.
notifyAll Resume all the processes that were waiting on the semaphore if there were any.Do not leave a signal on the semaphore if no process is waiting.
signal Signal the receiver, resuming a waiting process’ if there is one
wait Wait for the receiver to be signalled, suspending the executing process if it isnot yet. Return nil if the wait was interrupted, the receiver otherwise.
waitAfterSignalling: aSemaphoreSignal aSemaphore then, atomically, wait for the receiver to be signalled, sus-pending the executing process if it is not yet. This is needed to avoid race con-ditions when the #notify and #notifyAll are used before waiting on receiver:otherwise, if a process sends any of the two between the time aSemaphore issignaled and the time the process starts waiting on the receiver, the notificationis lost.
Chapter 1: Base classes 251
1.151.4 Semaphore: mutual exclusion
critical: aBlockWait for the receiver to be free, execute aBlock and signal the receiver again.Return the result of evaluating aBlock.
1.151.5 Semaphore: printing
printOn: aStreamPrint a human-readable represention of the receiver on aStream.
1.152 SequenceableCollection
Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Sequenceable
My instances represent collections of objects that are ordered. I provide someaccess and manipulation methods.
1.152.1 SequenceableCollection class: instance creation
join: aCollection separatedBy: sepCollectionWhere aCollection is a collection of SequenceableCollections, answer a newinstance with all the elements therein, in order, each separated by an occurrenceof sepCollection.
1.152.2 SequenceableCollection: basic
after: oldObjectReturn the element after oldObject. Error if oldObject not found or if nofollowing object is available
allButFirstAnswer a copy of the receiver without the first object.
allButFirst: nAnswer a copy of the receiver without the first n objects.
allButLast Answer a copy of the receiver without the last object.
allButLast: nAnswer a copy of the receiver without the last n objects.
at: anIndex ifAbsent: aBlockAnswer the anIndex-th item of the collection, or evaluate aBlock and answerthe result if the index is out of range
atAll: keyCollectionAnswer a collection of the same kind returned by #collect:, that only includesthe values at the given indices. Fail if any of the values in keyCollection is outof bounds for the receiver.
atAll: aCollection put: anObjectPut anObject at every index contained in aCollection
252 GNU Smalltalk Library Reference
atAllPut: anObjectPut anObject at every index in the receiver
atRandom Return a random item of the receiver.
before: oldObjectReturn the element before oldObject. Error if oldObject not found or if nopreceding object is available
first Answer the first item in the receiver
first: n Answer the first n items in the receiver
fourth Answer the fourth item in the receiver
identityIncludes: anObjectAnswer whether we include the anObject object
identityIndexOf: anElementAnswer the index of the first occurrence of an object identical to anElement inthe receiver. Answer 0 if no item is found
identityIndexOf: anElement ifAbsent: exceptionBlockAnswer the index of the first occurrence of an object identical to anElement inthe receiver. Invoke exceptionBlock and answer its result if no item is found
identityIndexOf: anElement startingAt: anIndexAnswer the first index > anIndex which contains an object identical to anEle-ment. Answer 0 if no item is found
identityIndexOf: anObject startingAt: anIndex ifAbsent: exceptionBlockAnswer the first index > anIndex which contains an object exactly identical toanObject. Invoke exceptionBlock and answer its result if no item is found
identityIndexOfLast: anElement ifAbsent: exceptionBlockAnswer the last index which contains an object identical to anElement. InvokeexceptionBlock and answer its result if no item is found
includes: anObjectAnswer whether we include anObject
indexOf: anElementAnswer the index of the first occurrence of anElement in the receiver. Answer0 if no item is found
indexOf: anElement ifAbsent: exceptionBlockAnswer the index of the first occurrence of anElement in the receiver. InvokeexceptionBlock and answer its result if no item is found
indexOf: anElement startingAt: anIndexAnswer the first index > anIndex which contains anElement. Answer 0 if noitem is found
indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlockAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
Chapter 1: Base classes 253
indexOfLast: anElement ifAbsent: exceptionBlockAnswer the last index which contains anElement. Invoke exceptionBlock andanswer its result if no item is found
indexOfSubCollection: aSubCollectionAnswer the first index > anIndex at which starts a sequence of items matchingaSubCollection. Answer 0 if no such sequence is found.
indexOfSubCollection: aSubCollection ifAbsent: exceptionBlockAnswer the first index > anIndex at which starts a sequence of items matchingaSubCollection. Answer 0 if no such sequence is found.
indexOfSubCollection: aSubCollection startingAt: anIndexAnswer the first index > anIndex at which starts a sequence of items matchingaSubCollection. Answer 0 if no such sequence is found.
indexOfSubCollection: aSubCollection startingAt: anIndex ifAbsent: exceptionBlockAnswer the first index > anIndex at which starts a sequence of items matchingaSubCollection. Invoke exceptionBlock and answer its result if no such sequenceis found
last Answer the last item in the receiver
last: n Answer the last n items in the receiver
second Answer the second item in the receiver
third Answer the third item in the receiver
1.152.3 SequenceableCollection: comparing
endsWith: aSequenceableCollectionReturns true if the receiver ends with the same characters as aSequenceableCol-lection.
startsWith: aSequenceableCollectionReturns true if the receiver starts with the same characters as aSequence-ableCollection.
1.152.4 SequenceableCollection: concatenating
join: sepCollectionAnswer a new collection like my first element, with all the elements (in order)of all my elements (which should be collections) separated by sepCollection.
I use my first element instead of myself as a prototype because my elements aremore likely to share the desired properties than I am, such as in:
#(’hello,’ ’world’) join: ’ ’ => ’hello, world’
with: aSequenceableCollectionReturn an Array with the same size as the receiver and aSequenceableCollec-tion, each element of which is a 2-element Arrays including one element fromthe receiver and one from aSequenceableCollection.
254 GNU Smalltalk Library Reference
with: seqColl1 with: seqColl2Return an Array with the same size as the receiver and the arguments, eachelement of which is a 3-element Arrays including one element from the receiverand one from each argument.
with: seqColl1 with: seqColl2 with: seqColl3Return an Array with the same size as the receiver and the arguments, eachelement of which is a 4-element Arrays including one element from the receiverand one from each argument.
1.152.5 SequenceableCollection: copying SequenceableCollections
copyAfter: anObjectAnswer a new collection holding all the elements of the receiver after the firstoccurrence of anObject, up to the last.
copyAfterLast: anObjectAnswer a new collection holding all the elements of the receiver after the lastoccurrence of anObject, up to the last.
copyFrom: startAnswer a new collection containing all the items in the receiver from the start-th.
copyFrom: start to: stopAnswer a new collection containing all the items in the receiver from the start-thand to the stop-th
copyReplaceAll: oldSubCollection with: newSubCollectionAnswer a new collection in which all the sequences matching oldSubCollectionare replaced with newSubCollection
copyReplaceFrom: start to: stop with: replacementCollectionAnswer a new collection of the same class as the receiver that contains thesame elements as the receiver, in the same order, except for elements fromindex ‘start’ to index ‘stop’.
If start < stop, these are replaced by the contents of the replacementCollection.Instead, If start = (stop + 1), like in ‘copyReplaceFrom: 4 to: 3 with: anArray’,then every element of the receiver will be present in the answered copy; theoperation will be an append if stop is equal to the size of the receiver or, if itis not, an insert before index ‘start’.
copyReplaceFrom: start to: stop withObject: anObjectAnswer a new collection of the same class as the receiver that contains thesame elements as the receiver, in the same order, except for elements fromindex ‘start’ to index ‘stop’.
If start < stop, these are replaced by stop-start+1 copies of anObject. Instead,If start = (stop + 1), then every element of the receiver will be present in theanswered copy; the operation will be an append if stop is equal to the size ofthe receiver or, if it is not, an insert before index ‘start’.
Chapter 1: Base classes 255
copyUpTo: anObjectAnswer a new collection holding all the elements of the receiver from the firstup to the first occurrence of anObject, excluded.
copyUpToLast: anObjectAnswer a new collection holding all the elements of the receiver from the firstup to the last occurrence of anObject, excluded.
copyWithFirst: anObjectAnswer a new collection holding all the elements of the receiver after the firstoccurrence of anObject, up to the last.
1.152.6 SequenceableCollection: enumerating
anyOne Answer an unspecified element of the collection.
do: aBlockEvaluate aBlock for all the elements in the sequenceable collection
do: aBlock separatedBy: sepBlockEvaluate aBlock for all the elements in the sequenceable collection. Betweeneach element, evaluate sepBlock without parameters.
doWithIndex: aBlockEvaluate aBlock for all the elements in the sequenceable collection, passing theindex of each element as the second parameter. This method is mantainedfor backwards compatibility and is not mandated by the ANSI standard; use#keysAndValuesDo:
findFirst: aBlockReturns the index of the first element of the sequenceable collection for whichaBlock returns true, or 0 if none
findLast: aBlockReturns the index of the last element of the sequenceable collection for whichaBlock returns true, or 0 if none does
fold: binaryBlockFirst, pass to binaryBlock the first and second elements of the receiver; for eachsubsequent element, pass the result of the previous evaluation and an element.Answer the result of the last invocation, or the first element if the collectionhas size 1. Fail if the collection is empty.
from: startIndex to: stopIndex do: aBlockEvaluate aBlock for all the elements in the sequenceable collection whose indicesare in the range index to stopIndex
from: startIndex to: stopIndex doWithIndex: aBlockEvaluate aBlock for all the elements in the sequenceable collection whose indicesare in the range index to stopIndex, passing the index of each element as thesecond parameter. This method is mantained for backwards compatibility andis not mandated by the ANSI standard; use #from:to:keysAndValuesDo:
256 GNU Smalltalk Library Reference
from: startIndex to: stopIndex keysAndValuesDo: aBlockEvaluate aBlock for all the elements in the sequenceable collection whose indicesare in the range index to stopIndex, passing the index of each element as thefirst parameter and the element as the second.
keys Return an Interval corresponding to the valid indices in the receiver.
keysAndValuesDo: aBlockEvaluate aBlock for all the elements in the sequenceable collection, passing theindex of each element as the first parameter and the element as the second.
readStreamAnswer a ReadStream streaming on the receiver
readWriteStreamAnswer a ReadWriteStream which streams on the receiver
reverse Answer the receivers’ contents in reverse order
reverseDo: aBlockEvaluate aBlock for all elements in the sequenceable collection, from the lastto the first.
with: aSequenceableCollection collect: aBlockEvaluate aBlock for each pair of elements took respectively from the receiverand from aSequenceableCollection; answer a collection of the same kind of thereceiver, made with the block’s return values. Fail if the receiver has not thesame size as aSequenceableCollection.
with: aSequenceableCollection do: aBlockEvaluate aBlock for each pair of elements took respectively from the receiverand from aSequenceableCollection. Fail if the receiver has not the same size asaSequenceableCollection.
1.152.7 SequenceableCollection: manipulation
swap: anIndex with: anotherIndexSwap the item at index anIndex with the item at index another index
1.152.8 SequenceableCollection: replacing items
replaceAll: anObject with: anotherObjectIn the receiver, replace every occurrence of anObject with anotherObject.
replaceFrom: start to: stop with: replacementCollectionReplace the items from start to stop with replacementCollection’s items from1 to stop-start+1 (in unexpected order if the collection is not sequenceable).
replaceFrom: start to: stop with: replacementCollection startingAt: repStartReplace the items from start to stop with replacementCollection’s items fromrepStart to repStart+stop-start
replaceFrom: anIndex to: stopIndex withObject: replacementObjectReplace every item from start to stop with replacementObject.
Chapter 1: Base classes 257
1.152.9 SequenceableCollection: sorting
sort Sort the contents of the receiver according to the default sort block, which uses#<= to compare items.
sort: sortBlockSort the contents of the receiver according to the given sort block, which acceptspair of items and returns true if the first item is less than the second one.
sorted Return a copy of the receiver sorted according to the default sort block, whichuses #<= to compare items.
sorted: sortBlockReturn a copy of the receiver sorted according to the given sort block, whichaccepts pair of items and returns true if the first item is less than the secondone.
1.152.10 SequenceableCollection: still unclassified
nextPutAllOn: aStreamWrite all the objects in the receiver to aStream
1.152.11 SequenceableCollection: testing
= aCollectionAnswer whether the receiver’s items match those in aCollection
examineOn: aStreamPrint all the instance variables and context of the receiver on aStream
hash Answer an hash value for the receiver
isSequenceableAnswer whether the receiver can be accessed by a numeric index with #at:/-#at:put:.
1.152.12 SequenceableCollection: testing collections
size Answer a dummy size of 0, so that SequenceableCollection>>#do: works.
1.153 Set
Defined in namespace SmalltalkSuperclass: HashedCollectionCategory: Collections-Unordered
I am the typical set object; I also known how to do arithmetic on my instances.
1.153.1 Set: arithmetic
& aSet Compute the set intersection of the receiver and aSet.
+ aSet Compute the set union of the receiver and aSet.
- aSet Compute the set difference of the receiver and aSet.
258 GNU Smalltalk Library Reference
1.153.2 Set: awful ST-80 compatibility hacks
findObjectIndex: objectTries to see if anObject exists as an indexed variable. As soon as nil or anObjectis found, the index of that slot is answered
1.153.3 Set: comparing
< aSet Answer whether the receiver is a strict subset of aSet
<= aSet Answer whether the receiver is a subset of aSet
> aSet Answer whether the receiver is a strict superset of aSet
>= aSet Answer whether the receiver is a superset of aSet
1.154 SharedQueue
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes
My instances provide a guaranteed safe mechanism to allow for communicationbetween processes. All access to the underlying data structures is controlledwith critical sections so that things proceed smoothly.
1.154.1 SharedQueue class: instance creation
new Create a new instance of the receiver
sortBlock: sortBlockCreate a new instance of the receiver which implements a priority queue withthe given sort block
1.154.2 SharedQueue: accessing
isEmpty Answer whether there is an object on the queue
next Wait for an object to be on the queue, then remove it and answer it
nextPut: valuePut value on the queue and answer it
peek Wait for an object to be on the queue if necessary, then answer the same objectthat #next would answer without removing it.
1.155 SingletonProxy
Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files
I am a proxy that stores the class of an object rather than the object itself, andpretends that a registered instance (which most likely is a singleton instance ofthe stored class) was stored instead.
Chapter 1: Base classes 259
1.155.1 SingletonProxy class: accessing
acceptUsageForClass: aClassThe receiver was asked to be used as a proxy for the class aClass. The regis-tration is fine if the class is actually a singleton.
1.155.2 SingletonProxy class: instance creation
on: anObjectAnswer a proxy to be used to save anObject. The proxy stores the class andrestores the object by looking into a dictionary of class -> singleton objects.
1.155.3 SingletonProxy: saving and restoring
object Reconstruct the object stored in the proxy and answer it; the binaryRepresen-tationObject is sent the #reconstructOriginalObject message, and the resultingobject is sent the #postLoad message.
1.156 SmallInteger
Defined in namespace SmalltalkSuperclass: IntegerCategory: Language-Data types
I am the integer class of the GNU Smalltalk system. My instances can representsigned 30 bit integers and are as efficient as possible.
1.156.1 SmallInteger class: getting limits
bits Answer the number of bits (excluding the sign) that can be represented directlyin an object pointer
largest Answer the largest integer represented directly in an object pointer
smallest Answer the smallest integer represented directly in an object pointer
1.156.2 SmallInteger class: testing
isIdentity Answer whether x = y implies x == y for instances of the receiver
1.156.3 SmallInteger: bit arithmetic
highBit Return the index of the highest order 1 bit of the receiver
lowBit Return the index of the lowest order 1 bit of the receiver.
1.156.4 SmallInteger: built ins
* arg Multiply the receiver and arg and answer another Number
+ arg Sum the receiver and arg and answer another Number
- arg Subtract arg from the receiver and answer another Number
/ arg Divide the receiver by arg and answer another Integer or Fraction
260 GNU Smalltalk Library Reference
// arg Dividing receiver by arg (with truncation towards -infinity) and answer theresult
< arg Answer whether the receiver is less than arg
<= arg Answer whether the receiver is less than or equal to arg
= arg Answer whether the receiver is equal to arg
== arg Answer whether the receiver is the same object as arg
> arg Answer whether the receiver is greater than arg
>= arg Answer whether the receiver is greater than or equal to arg
\\ arg Calculate the remainder of dividing receiver by arg (with truncation towards-infinity) and answer it
asFloatD Convert the receiver to a FloatD, answer the result
asFloatE Convert the receiver to a FloatE, answer the result
asFloatQ Convert the receiver to a FloatQ, answer the result
asObject Answer the object whose index is in the receiver, nil if there is a free object,fail if index is out of bounds
asObjectNoFailAnswer the object whose index is in the receiver, or nil if no object is found atthat index
bitAnd: argDo a bitwise AND between the receiver and arg, answer the result
bitOr: arg Do a bitwise OR between the receiver and arg, answer the result
bitShift: argShift the receiver by arg places to the left if arg > 0, by arg places to the rightif arg < 0, answer another Number
bitXor: argDo a bitwise XOR between the receiver and arg, answer the result
divExact: argDividing receiver by arg assuming that the remainder is zero, and answer theresult
nextValidOopAnswer the index of the first non-free OOP after the receiver. This is usedinternally; it is placed here to avoid polluting Object.
quo: arg Dividing receiver by arg (with truncation towards zero) and answer the result
~= arg Answer whether the receiver is not equal to arg
~~ arg Answer whether the receiver is not the same object as arg
Chapter 1: Base classes 261
1.156.5 SmallInteger: builtins
at: anIndexAnswer the index-th indexed instance variable of the receiver. This methodalways fails.
at: anIndex put: valueStore value in the index-th indexed instance variable of the receiver This methodalways fails.
basicAt: anIndexAnswer the index-th indexed instance variable of the receiver. This methodalways fails.
basicAt: anIndex put: valueStore value in the index-th indexed instance variable of the receiver This methodalways fails.
scramble Answer the receiver with its bits mixed and matched.
1.156.6 SmallInteger: coercion
asCNumberConvert the receiver to a kind of number that is understood by the C call-outmechanism.
1.156.7 SmallInteger: coercion methods
generality Return the receiver’s generality
unity Coerce 1 to the receiver’s class
zero Coerce 0 to the receiver’s class
1.156.8 SmallInteger: testing functionality
isSmallIntegerAnswer ‘true’.
1.157 SortedCollection
Defined in namespace SmalltalkSuperclass: OrderedCollectionCategory: Collections-Sequenceable
I am a collection of objects, stored and accessed according to some sortingcriteria. I store things using heap sort and quick sort. My instances have acomparison block associated with them; this block takes two arguments andis a predicate which returns true if the first argument should be sorted earlierthan the second. The default block is [ :a :b | a <= b ], but I will accept anyblock that conforms to the above criteria – actually any object which respondsto #value:value:.
262 GNU Smalltalk Library Reference
1.157.1 SortedCollection class: hacking
defaultSortBlockAnswer a default sort block for the receiver.
1.157.2 SortedCollection class: instance creation
new Answer a new collection with a default size and sort block
new: aSizeAnswer a new collection with a default sort block and the given size
sortBlock: aSortBlockAnswer a new collection with a default size and the given sort block
1.157.3 SortedCollection: basic
last Answer the last item of the receiver
removeLastRemove an object from the end of the receiver. Fail if the receiver is empty
sortBlock Answer the receiver’s sort criteria
sortBlock: aSortBlockChange the sort criteria for a sorted collection, resort the elements of the col-lection, and return it.
1.157.4 SortedCollection: copying
copyEmpty: newSizeAnswer an empty copy of the receiver, with the same sort block as the receiver
1.157.5 SortedCollection: disabled
add: anObject afterIndex: iThis method should not be called for instances of this class.
addAll: aCollection afterIndex: iThis method should not be called for instances of this class.
addAllFirst: aCollectionThis method should not be called for instances of this class.
addAllLast: aCollectionThis method should not be called for instances of this class.
addFirst: anObjectThis method should not be called for instances of this class.
addLast: anObjectThis method should not be called for instances of this class.
at: index put: anObjectThis method should not be called for instances of this class.
Chapter 1: Base classes 263
1.157.6 SortedCollection: enumerating
beConsistentPrepare the receiver to be walked through with #do: or another enumerationmethod.
1.157.7 SortedCollection: saving and loading
postLoad Restore the default sortBlock if it is nil
preStore Store the default sortBlock as nil
1.157.8 SortedCollection: searching
includes: anObjectPrivate - Answer whether the receiver includes an item which is equal to anOb-ject
indexOf: anObject startingAt: index ifAbsent: aBlockAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
occurrencesOf: anObjectAnswer how many occurrences of anObject can be found in the receiver
1.157.9 SortedCollection: sorting
sort Sort the contents of the receiver according to the given sort block, which acceptspair of items and returns true if the first item is less than the second one. Failsif the collections’s sort block is not the same as the default sort block.
sort: sortBlockSort the contents of the receiver according to the given sort block, which acceptspair of items and returns true if the first item is less than the second one. Failsif the sort block is not the same as the collection’s sort block.
1.158 Stream
Defined in namespace SmalltalkSuperclass: IterableCategory: Streams
I am an abstract class that provides interruptable sequential access to objects.I can return successive objects from a source, or accept successive objects andstore them sequentially on a sink. I provide some simple iteration over thecontents of one of my instances, and provide for writing collections sequentially.
1.158.1 Stream: accessing-reading
contents Answer the whole contents of the receiver, from the next object to the last
file Return nil by default; not all streams have a file.
name Return nil by default; not all streams have a name.
264 GNU Smalltalk Library Reference
next Return the next object in the receiver
next: anIntegerReturn the next anInteger objects in the receiver
nextAvailable: anIntegerReturn up to anInteger objects in the receiver. Besides stopping if the end ofthe stream is reached, this may return less than this number of bytes for variousreasons. For example, on files and sockets this operation could be non-blocking,or could do at most one I/O operation.
nextAvailable: anInteger into: aCollection startingAt: posPlace the next anInteger objects from the receiver into aCollection, startingat position pos. Return the number of items stored. Besides stopping if theend of the stream is reached, this may return less than this number of bytesfor various reasons. For example, on files and sockets this operation could benon-blocking, or could do at most one I/O operation.
nextAvailable: anInteger putAllOn: aStreamCopy up to anInteger objects in the receiver to aStream. Besides stopping ifthe end of the stream is reached, this may return less than this number of bytesfor various reasons. For example, on files and sockets this operation could benon-blocking, or could do at most one I/O operation.
nextLine Returns a collection of the same type that the stream accesses, containing thenext line up to the next new-line character. Returns the entire rest of thestream’s contents if no new-line character is found.
nextMatchFor: anObjectAnswer whether the next object is equal to anObject. Even if it does not,anObject is lost
splitAt: anObjectAnswer an OrderedCollection of parts of the receiver. A new (possibly empty)part starts at the start of the receiver, or after every occurrence of an objectwhich is equal to anObject (as compared by #=).
upTo: anObjectReturns a collection of the same type that the stream accesses, up to but notincluding the object anObject. Returns the entire rest of the stream’s contentsif anObject is not present.
upToAll: aCollectionIf there is a sequence of objects remaining in the stream that is equal to thesequence in aCollection, set the stream position just past that sequence andanswer the elements up to, but not including, the sequence. Else, set thestream position to its end and answer all the remaining elements.
upToEnd Answer every item in the collection on which the receiver is streaming, fromthe next one to the last
Chapter 1: Base classes 265
1.158.2 Stream: accessing-writing
next: anInteger put: anObjectWrite anInteger copies of anObject to the receiver
next: n putAll: aCollection startingAt: startWrite n objects to the stream, reading them from aCollection and starting atthe start-th item.
nextPut: anObjectWrite anObject to the receiver
nextPutAll: aCollectionWrite all the objects in aCollection to the receiver
nextPutAllFlush: aCollectionPut all the elements of aCollection in the stream, then flush the buffers ifsupported by the stream.
1.158.3 Stream: basic
species Answer ‘Array’.
1.158.4 Stream: buffering
next: anInteger into: answer startingAt: posRead up to anInteger bytes from the stream and store them into answer. Returnthe number of bytes that were read, raising an exception if we could not readthe full amount of data.
next: anInteger putAllOn: aStreamRead up to anInteger bytes from the stream and store them into aStream.Return the number of bytes that were read, raising an exception if we couldnot read the full amount of data.
1.158.5 Stream: built ins
fileIn File in the contents of the receiver. During a file in operation, global vari-ables (starting with an uppercase letter) that are not declared don’t yield an‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’dictionary (a global variable residing in Smalltalk). As soon as you add thevariable to a namespace (for example by creating a class) the Association willbe removed from Undeclared and reused in the namespace, so that the oldreferences will automagically point to the new value.
fileInLine: lineNum file: aFile at: charPosIntPrivate - Much like a preprocessor #line directive; it is used internally by#fileIn, and explicitly by the Emacs Smalltalk mode.
fileInLine: lineNum fileName: aString at: charPosIntPrivate - Much like a preprocessor #line directive; it is used internally by#fileIn, and explicitly by the Emacs Smalltalk mode.
266 GNU Smalltalk Library Reference
1.158.6 Stream: character writing
cr Store a cr on the receiver
crTab Store a cr and a tab on the receiver
encoding Answer the encoding to be used when storing Unicode characters.
isUnicode Answer whether the receiver is able to store Unicode characters. Note that ifthis method returns true, the stream may or may not be able to store Characters(as opposed to UnicodeCharacters) whose value is above 127.
nl Store a new line on the receiver
nlTab Store a new line and a tab on the receiver
space Store a space on the receiver
space: n Store n spaces on the receiver
tab Store a tab on the receiver
tab: n Store n tabs on the receiver
1.158.7 Stream: compiling
segmentFrom: startPos to: endPosAnswer an object that, when sent #asString, will yield the result of sending‘copyFrom: startPos to: endPos’ to the receiver
1.158.8 Stream: concatenating
with: aStreamReturn a new Stream whose elements are 2-element Arrays, including one ele-ment from the receiver and one from aStream.
with: stream1 with: stream2Return a new Stream whose elements are 3-element Arrays, including one ele-ment from the receiver and one from each argument.
with: stream1 with: stream2 with: stream3Return a new Stream whose elements are 3-element Arrays, including one ele-ment from the receiver and one from each argument.
1.158.9 Stream: enumerating
do: aBlockEvaluate aBlock once for every object in the receiver
linesDo: aBlockEvaluate aBlock once for every line in the receiver (assuming the receiver isstreaming on Characters).
1.158.10 Stream: filing out
fileOut: aClassFile out aClass on the receiver. If aClass is not a metaclass, file out class andinstance methods; if aClass is a metaclass, file out only the class methods
Chapter 1: Base classes 267
1.158.11 Stream: filtering
, anIterableAnswer a new stream that concatenates the data in the receiver with the datain aStream. Both the receiver and aStream should be readable.
collect: aBlockAnswer a new stream that will pass the returned objects through aBlock, andreturn whatever object is returned by aBlock instead. Note that when peekingin the returned stream, the block will be invoked multiple times, with possiblysurprising results.
lines Answer a new stream that answers lines from the receiver.
peek Returns the next element of the stream without moving the pointer. Returnsnil when at end of stream. Lookahead is implemented automatically for streamsthat are not positionable but can be copied.
peekFor: aCharacterReturns true and gobbles the next element from the stream of it is equal toanObject, returns false and doesn’t gobble the next element if the next elementis not equal to anObject. Lookahead is implemented automatically for streamsthat are not positionable but can be copied.
reject: aBlockAnswer a new stream that only returns those objects for which aBlock returnsfalse. Note that the returned stream will not be positionable.
select: aBlockAnswer a new stream that only returns those objects for which aBlock returnstrue. Note that the returned stream will not be positionable.
1.158.12 Stream: polymorphism
close Do nothing. This is provided for consistency with file streams
flush Do nothing. This is provided for consistency with file streams
pastEnd The end of the stream has been reached. Signal a Notification.
1.158.13 Stream: positioning
isPositionableAnswer true if the stream supports moving backwards with #skip:.
skip: anIntegerMove the position forwards by anInteger places
skipSeparatorsAdvance the receiver until we find a character that is not a separator. Answerfalse if we reach the end of the stream, else answer true; in this case, sending#next will return the first non-separator character (possibly the same to whichthe stream pointed before #skipSeparators was sent).
268 GNU Smalltalk Library Reference
skipTo: anObjectMove the current position to after the next occurrence of anObject and returntrue if anObject was found. If anObject doesn’t exist, the pointer is atEnd,and false is returned.
skipToAll: aCollectionIf there is a sequence of objects remaining in the stream that is equal to thesequence in aCollection, set the stream position just past that sequence andanswer true. Else, set the stream position to its end and answer false.
1.158.14 Stream: printing
<< anObjectThis method is a short-cut for #display:; it prints anObject on the receiver bysending displayOn: to anObject. This method is provided so that you can usecascading and obtain better-looking code
display: anObjectPrint anObject on the receiver by sending displayOn: to anObject. Thismethod is provided so that you can use cascading and obtain better-lookingcode
print: anObjectPrint anObject on the receiver by sending printOn: to anObject. This methodis provided so that you can use cascading and obtain better-looking code
1.158.15 Stream: still unclassified
nextPutAllOn: aStreamWrite all the objects in the receiver to aStream
1.158.16 Stream: storing
store: anObjectPrint Smalltalk code compiling to anObject on the receiver, by sendingstoreOn: to anObject. This method is provided so that you can use cascadingand obtain better-looking code
1.158.17 Stream: streaming protocol
nextAvailablePutAllOn: aStreamCopy to aStream a more-or-less arbitrary amount of data. When used on files,this does at most one I/O operation. For other kinds of stream, the definitionmay vary. This method is used to do stream-to-stream copies.
1.158.18 Stream: testing
atEnd Answer whether the stream has got to an end
isExternalStreamAnswer whether the receiver streams on a file or socket. By default, answerfalse.
Chapter 1: Base classes 269
isSequenceableAnswer whether the receiver can be accessed by a numeric index with #at:/-#at:put:.
readStreamAs a wild guess, return the receiver. WriteStreams should override this method.
1.159 String
Defined in namespace SmalltalkSuperclass: CharacterArrayCategory: Collections-Text
My instances represent 8-bit character strings. Being a very common case, theyare particularly optimized.
Note that, if you care about multilingualization, you should treat String onlyas an encoded representation of a UnicodeString. The I18N package adds moreUnicode-friendliness to the system so that encoding and decoding is performedautomatically in more cases. In that case, String represents a case when theencoding is either unknown, irrelevant, or assumed to be the system default.
1.159.1 String class: instance creation
fromCData: aCObjectAnswer a String containing the bytes starting at the location pointed to byaCObject, up to the first NUL character.
fromCData: aCObject size: anIntegerAnswer a String containing anInteger bytes starting at the location pointed toby aCObject
1.159.2 String class: multibyte encodings
isUnicode Answer false; the receiver stores bytes (i.e. an encoded form), not characters.
1.159.3 String: accessing
byteAt: indexAnswer the ascii value of index-th character variable of the receiver
byteAt: index put: valueStore (Character value: value) in the index-th indexed instance variable of thereceiver
1.159.4 String: basic
, aString Answer a new instance of an ArrayedCollection containing all the elements inthe receiver, followed by all the elements in aSequenceableCollection
= aCollectionAnswer whether the receiver’s items match those in aCollection
270 GNU Smalltalk Library Reference
indexOf: anElement startingAt: anIndexAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlockAnswer the first index > anIndex which contains anElement. Invoke exception-Block and answer its result if no item is found
1.159.5 String: built ins
asCData: aCTypeAllocate memory with malloc for a NULL-terminated copy of the receiver, andreturn a pointer to it as a CObject of the given type.
at: anIndexAnswer the index-th indexed instance variable of the receiver
at: anIndex ifAbsent: aBlockAnswer the index-th indexed instance variable of the receiver
at: anIndex put: valueStore value in the index-th indexed instance variable of the receiver
basicAt: anIndexAnswer the index-th indexed instance variable of the receiver. This methodmust not be overridden, override at: instead
basicAt: anIndex put: valueStore value in the index-th indexed instance variable of the receiver This methodmust not be overridden, override at:put: instead
hash Answer an hash value for the receiver
replaceFrom: start to: stop with: aString startingAt: replaceStartReplace the characters from start to stop with new characters whose ASCIIcodes are contained in aString, starting at the replaceStart location of aString
replaceFrom: start to: stop withByteArray: byteArray startingAt: replaceStartReplace the characters from start to stop with new characters whose ASCIIcodes are contained in byteArray, starting at the replaceStart location ofbyteArray
similarityTo: aStringAnswer a number that denotes the similarity between aString and the receiver.0 indicates equality, negative numbers indicate some difference. Implementedas a primitive for speed.
size Answer the size of the receiver
1.159.6 String: CObject
asCData Allocate memory with malloc for a NULL-terminated copy of the receiver, andreturn a pointer to it as a CChar.
Chapter 1: Base classes 271
1.159.7 String: converting
asByteArrayReturn the receiver, converted to a ByteArray of ASCII values
asString But I already am a String! Really!
asSymbol Returns the symbol corresponding to the receiver
encoding Answer the encoding of the receiver. This is not implemented unless you loadthe Iconv package.
1.159.8 String: filesystem
/ aName Answer a File object as appropriate for a file named ’aName’ in the directoryrepresented by the receiver.
asFile Answer a File object for the file whose name is in the receiver.
1.159.9 String: printing
displayOn: aStreamPrint a representation of the receiver on aStream. Unlike #printOn:, thismethod strips extra quotes.
displayStringAnswer a String representing the receiver. For most objects this is simply its#printString, but for CharacterArrays and characters, superfluous dollars orextra pair of quotes are stripped.
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
printOn: aStreamPrint a representation of the receiver on aStream
storeLiteralOn: aStreamStore a Smalltalk literal compiling to the receiver on aStream
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream
1.159.10 String: regex
=~ patternAnswer a RegexResults object for matching the receiver against the Regex orString object pattern.
allOccurrencesOfRegex: patternFind all the matches of pattern within the receiver and collect them into anOrderedCollection.
allOccurrencesOfRegex: pattern do: aBlockFind all the matches of pattern within the receiver and pass the RegexResultsobjects to aBlock.
272 GNU Smalltalk Library Reference
allOccurrencesOfRegex: pattern from: from to: toFind all the matches of pattern within the receiver and within the given rangeof indices. Collect them into an OrderedCollection, which is then returned.
allOccurrencesOfRegex: pattern from: from to: to do: aBlockFind all the matches of pattern within the receiver and within the given rangeof indices. For each match, pass the RegexResults object to aBlock.
asRegex Answer the receiver, converted to a Regex object.
copyFrom: from to: to replacingAllRegex: pattern with: aStringOrBlockReturns the substring of the receiver between from and to. Any match ofpattern in that part of the string is replaced using aStringOrBlock as follows: ifit is a block, a RegexResults object is passed, while if it is a string, %n sequencesare replaced with the captured subexpressions of the match (as in #%).
copyFrom: from to: to replacingRegex: pattern with: aStringOrBlockReturns the substring of the receiver between from and to. If pattern has amatch in that part of the string, the match is replaced using aStringOrBlock asfollows: if it is a block, a RegexResults object is passed, while if it is a string,%n sequences are replaced with the captured subexpressions of the match (asin #%).
copyReplacingAllRegex: pattern with: aStringOrBlockReturns the receiver after replacing all the matches of pattern (if any) usingaStringOrBlock as follows: if it is a block, a RegexResults object is passed, whileif it is a string, %n sequences are replaced with the captured subexpressions ofthe match (as in #%).
copyReplacingRegex: pattern with: aStringOrBlockReturns the receiver after replacing the first match of pattern (if any) usingaStringOrBlock as follows: if it is a block, a RegexResults object is passed, whileif it is a string, %n sequences are replaced with the captured subexpressions ofthe match (as in #%).
indexOfRegex: regexStringIf an occurrence of the regex is present in the receiver, return the Intervalcorresponding to the leftmost-longest match. Otherwise return nil.
indexOfRegex: regexString from: from to: toIf an occurrence of the regex is present in the receiver, return the Intervalcorresponding to the leftmost-longest match occurring within the given rangeof indices. Otherwise return nil.
indexOfRegex: regexString from: from to: to ifAbsent: excBlockIf an occurrence of the regex is present in the receiver, return the Intervalcorresponding to the leftmost-longest match occurring within the given indices.Otherwise, evaluate excBlock and return the result.
indexOfRegex: regexString ifAbsent: excBlockIf an occurrence of the regex is present in the receiver, return the Intervalcorresponding to the leftmost-longest match. Otherwise, evaluate excBlockand return the result.
Chapter 1: Base classes 273
indexOfRegex: regexString startingAt: indexIf an occurrence of the regex is present in the receiver, return the Interval cor-responding to the leftmost-longest match starting after the given index. Oth-erwise return nil.
indexOfRegex: regexString startingAt: index ifAbsent: excBlockIf an occurrence of the regex is present in the receiver, return the Interval cor-responding to the leftmost-longest match starting after the given index. Oth-erwise, evaluate excBlock and return the result.
matchRegex: patternAnswer whether the receiver is an exact match for the pattern. This meansthat the pattern is implicitly anchored at the beginning and the end.
matchRegex: pattern from: from to: toAnswer whether the given range of indices is an exact match for the pattern.This means that there is a match starting at from and ending at to (which isnot necessarily the longest match starting at from).
occurrencesOfRegex: patternReturns count of how many times pattern repeats in the receiver.
occurrencesOfRegex: pattern from: from to: toReturn a count of how many times pattern repeats in the receiver within thegiven range of index.
occurrencesOfRegex: pattern startingAt: indexReturns count of how many times pattern repeats in the receiver, starting thesearch at the given index.
onOccurrencesOfRegex: pattern do: bodyFind all the matches of pattern within the receiver and, for each match, passthe RegexResults object to aBlock.
onOccurrencesOfRegex: pattern from: from to: to do: aBlockFind all the matches of pattern within the receiver and within the given rangeof indices. For each match, pass the RegexResults object to aBlock.
replacingAllRegex: pattern with: aStringOrBlockReturns the receiver if the pattern has no match in it. Otherwise, any match ofpattern in that part of the string is replaced using aStringOrBlock as follows: ifit is a block, a RegexResults object is passed, while if it is a string, %n sequencesare replaced with the captured subexpressions of the match (as in #%).
replacingRegex: pattern with: aStringOrBlockReturns the receiver if the pattern has no match in it. If it has a match, it isreplaced using aStringOrBlock as follows: if it is a block, a RegexResults objectis passed, while if it is a string, %n sequences are replaced with the capturedsubexpressions of the match (as in #%).
searchRegex: patternA synonym for #=~. Answer a RegexResults object for matching the receiveragainst the Regex or String object pattern.
274 GNU Smalltalk Library Reference
searchRegex: pattern from: from to: toAnswer a RegexResults object for matching the receiver against the Regex orString object pattern, restricting the match to the specified range of indices.
searchRegex: pattern startingAt: anIndexAnswer a RegexResults object for matching the receiver against the Regex orString object pattern, starting the match at index anIndex.
tokenize: patternSplit the receiver at every occurrence of pattern. All parts that do not matchpattern are separated and stored into an Array of Strings that is returned.
tokenize: pattern from: from to: toSplit the receiver at every occurrence of pattern (considering only the indicesbetween from and to). All parts that do not match pattern are separated andstored into an Array of Strings that is returned.
~ pattern Answer whether the receiver matched against the Regex or String object pat-tern.
1.159.11 String: still unclassified
escapeRegexAnswer the receiver with all regex special characters escaped by a backslash.
1.159.12 String: testing functionality
isString Answer ‘true’.
1.160 Symbol
Defined in namespace SmalltalkSuperclass: StringCategory: Language-Implementation
My instances are unique throughout the Smalltalk system. My instances behavefor the most part like strings, except that they print differently, and I guaranteethat any two instances that have the same printed representation are in factthe same instance.
1.160.1 Symbol class: built ins
intern: aStringPrivate - Same as ’aString asSymbol’
1.160.2 Symbol class: instance creation
internCharacter: aCharacterAnswer the one-character symbol associated to the given character.
new This method should not be called for instances of this class.
new: size This method should not be called for instances of this class.
Chapter 1: Base classes 275
with: element1Answer a collection whose only element is element1
with: element1 with: element2Answer a collection whose only elements are the parameters in the order theywere passed
with: element1 with: element2 with: element3Answer a collection whose only elements are the parameters in the order theywere passed
with: element1 with: element2 with: element3 with: element4Answer a collection whose only elements are the parameters in the order theywere passed
with: element1 with: element2 with: element3 with: element4 with: element5Answer a collection whose only elements are the parameters in the order theywere passed
1.160.3 Symbol class: symbol table
hasInterned: aString ifTrue: aBlockIf aString has not been interned yet, answer false. Else, pass the internedversion to aBlock and answer true. Note that this works because String>>-#hash calculates the same hash value used by the VM when interning stringsinto the SymbolTable. Changing one of the hashing methods without changingthe other will break this method.
isSymbolString: aStringAnswer whether aString has already been interned. Note that this works be-cause String>>#hash calculates the same hash value used by the VM wheninterning strings into the SymbolTable. Changing one of the hashing methodswithout changing the other will break this method.
rebuildTableRebuild the SymbolTable, thereby garbage-collecting unreferenced Symbols.While this process is done, preemption is disabled because it is not acceptableto leave the SymbolTable in a partially updated state. Note that this worksbecause String>>#hash calculates the same hash value used by the VM wheninterning strings into the SymbolTable. Changing one of the hashing methodswithout changing the other will break this method.
1.160.4 Symbol: accessing the method dictionary
implementorsAnswer a Set of all the compiled method associated with selector named by thereceiver, which is supposed to be a valid message name.
1.160.5 Symbol: basic
deepCopy Returns a deep copy of the receiver. As Symbols are identity objects, we actu-ally return the receiver itself.
276 GNU Smalltalk Library Reference
keywords Answer an array of keywords that compose the receiver, which is supposed tobe a valid message name (#+, #not, #printOn:, #ifTrue:ifFalse:, etc.)
numArgs Answer the number of arguments supported by the receiver, which is supposedto be a valid message name (#+, #not, #printOn:, #ifTrue:ifFalse:, etc.)
shallowCopyReturns a deep copy of the receiver. As Symbols are identity objects, we actu-ally return the receiver itself.
1.160.6 Symbol: built ins
= aSymbolAnswer whether the receiver and aSymbol are the same object
hash Answer an hash value for the receiver. Symbols are optimized for speed
1.160.7 Symbol: converting
asString Answer a String with the same characters as the receiver
asSymbol But we are already a Symbol, and furthermore, Symbols are identity objects!So answer the receiver.
1.160.8 Symbol: misc
species Answer ‘String’.
1.160.9 Symbol: storing
displayOn: aStreamPrint a represention of the receiver on aStream. For most objects this is simplyits #printOn: representation, but for strings and characters, superfluous dollarsor extra pairs of quotes are stripped.
displayStringAnswer a String representing the receiver. For most objects this is simply its#printString, but for strings and characters, superfluous dollars or extra pairof quotes are stripped.
printOn: aStreamPrint a represention of the receiver on aStream.
storeLiteralOn: aStreamPrint Smalltalk code on aStream that compiles to the same symbol as thereceiver.
storeOn: aStreamPrint Smalltalk code on aStream that compiles to the same symbol as thereceiver.
1.160.10 Symbol: testing
isSimpleSymbolAnswer whether the receiver must be represented in quoted-string (e.g. #’abc-def’) form.
Chapter 1: Base classes 277
1.160.11 Symbol: testing functionality
isString Answer ‘false’.
isSymbol Answer ‘true’.
1.161 SymLink
Defined in namespace SmalltalkSuperclass: LinkCategory: Language-Implementation
I am used to implement the Smalltalk symbol table. My instances are linksthat contain symbols, and the symbol table basically a hash table that pointsto chains of my instances.
1.161.1 SymLink class: instance creation
symbol: aSymbol nextLink: aSymLinkAnswer a new SymLink, which refers to aSymbol and points to aSymLink asthe next SymLink in the chain.
1.161.2 SymLink: accessing
symbol Answer the Symbol that the receiver refers to in the symbol table.
symbol: aSymbolSet the Symbol that the receiver refers to in the symbol table.
1.161.3 SymLink: iteration
do: aBlockEvaluate aBlock for each symbol in the list
1.161.4 SymLink: printing
printOn: aStreamPrint a representation of the receiver on aStream.
1.162 SystemDictionary
Defined in namespace SmalltalkSuperclass: RootNamespaceCategory: Language-Implementation
I am a special namespace. I only have one instance, called "Smalltalk", whichis known to the Smalltalk interpreter. I define several methods that are "sys-tem" related, such as #quitPrimitive. My instance also helps keep track ofdependencies between objects.
1.162.1 SystemDictionary class: initialization
initialize Create the kernel’s private namespace.
278 GNU Smalltalk Library Reference
1.162.2 SystemDictionary: basic
halt Interrupt interpreter
hash Smalltalk usually contains a reference to itself, avoid infinite loops
1.162.3 SystemDictionary: builtins
basicBacktracePrints the method invocation stack backtrace, as an aid to debugging
byteCodeCounterAnswer the number of bytecodes executed by the VM
debug This methods provides a way to break in the VM code. Set a breakpointin gst debug and call this method near the point where you think the bughappens.
declarationTraceAnswer whether compiled bytecodes are printed on stdout
declarationTrace: aBooleanSet whether compiled bytecodes are printed on stdout
executionTraceAnswer whether executed bytecodes are printed on stdout
executionTrace: aBooleanSet whether executed bytecodes are printed on stdout
getTraceFlag: anIndexPrivate - Returns a boolean value which is one of the interpreter’s tracing flags
setTraceFlag: anIndex to: aBooleanPrivate - Sets the value of one of the interpreter’s tracing flags (indicated by’anIndex’) to the value aBoolean.
verboseTraceAnswer whether execution tracing prints the object on the stack top
verboseTrace: aBooleanSet whether execution tracing prints the object on the stack top
1.162.4 SystemDictionary: c call-outs
environ Not commented.
getArgc Not commented.
getArgv: indexNot commented.
getenv: aStringNot commented.
putenv: aStringNot commented.
Chapter 1: Base classes 279
system: aStringNot commented.
system: aString withArguments: argsNot commented.
1.162.5 SystemDictionary: command-line
arguments: pattern do: actionBlockParse the command-line arguments according to the syntax specified in pattern.For every command-line option found, the two-argument block actionBlock isevaluated passing the option name and the argument. For file names (or ingeneral, other command-line arguments than options) the block’s first argu-ment will be nil. For options without arguments, or with unspecified optionalarguments, the block’s second argument will be nil. The option name will bepassed as a character object for short options, and as a string for long options.
If an error is found, nil is returned. For more information on the syntax ofpattern, see #arguments:do:ifError:.
arguments: pattern do: actionBlock ifError: errorBlockParse the command-line arguments according to the syntax specified in pattern.For every command-line option found, the two-argument block actionBlock isevaluated passing the option name and the argument. For file names (or ingeneral, other command-line arguments than options) the block’s first argu-ment will be nil. For options without arguments, or with unspecified optionalarguments, the block’s second argument will be nil. The option name will bepassed as a character object for short options, and as a string for long options.
If an error is found, the parsing is interrupted, errorBlock is evaluated, and thereturned value is answered.
Every whitespace-separated part (‘word’) of pattern specifies a command-lineoption. If a word ends with a colon, the option will have a mandatory argument.If a word ends with two colons, the option will have an optional argument.Before the colons, multiple option names (either short names like ‘-l’ or longnames like ‘–long’) can be specified. Before passing the option to actionBlock,the name will be canonicalized to the last one.
Prefixes of long options are accepted as long as they’re unique, and they arecanonicalized to the full name before passing it to actionBlock. Additionally,the full name of an option is accepted even if it is the prefix of a longer option.
Mandatory arguments can appear in the next argument, or in the same argu-ment (separated by an = for arguments to long options). Optional argumentsmust appear in the same argument.
1.162.6 SystemDictionary: miscellaneous
arguments Return the command line arguments after the -a switch
backtrace Print a backtrace on the Transcript.
280 GNU Smalltalk Library Reference
hostSystemAnswer the triplet corresponding to the system for which GNU Smalltalk wasbuilt.
1.162.7 SystemDictionary: printing
nameIn: aNamespaceAnswer ‘’Smalltalk”.
printOn: aStream in: aNamespaceStore Smalltalk code compiling to the receiver
storeOn: aStreamStore Smalltalk code compiling to the receiver
1.162.8 SystemDictionary: profiling
rawProfile: anIdentityDictionarySet the raw profile to be anIdentityDictionary and return the old one.
1.162.9 SystemDictionary: special accessing
addFeature: aFeatureAdd the aFeature feature to the Features set
hasFeatures: featuresReturns true if the feature or features in ’features’ is one of the implementationdependent features present
removeFeature: aFeatureRemove the aFeature feature to the Features set
version Answer the current version of the GNU Smalltalk environment
1.162.10 SystemDictionary: testing
imageLocalAnswer whether the kernel directory is a subdirectory of the image directory(non-local image) or not.
isSmalltalkAnswer ‘true’.
1.163 SystemExceptions.AlreadyDefined
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions
I am raised when one tries to define a symbol (class or pool variable) that isalready defined.
1.163.1 SystemExceptions.AlreadyDefined: accessing
descriptionAnswer a description for the error
Chapter 1: Base classes 281
1.164 SystemExceptions.ArgumentOutOfRange
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions
I am raised when one invokes a method with an argument outside of its validrange.
1.164.1 SystemExceptions.ArgumentOutOfRange class: signaling
signalOn: value mustBeBetween: low and: highRaise the exception. The given value was not between low and high.
1.164.2 SystemExceptions.ArgumentOutOfRange: accessing
descriptionAnswer a textual description of the exception.
high Answer the highest value that was permitted.
high: aMagnitudeSet the highest value that was permitted.
low Answer the lowest value that was permitted.
low: aMagnitudeSet the lowest value that was permitted.
1.165 SystemExceptions.BadReturn
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am raised when one tries to return from an already-terminated method.
1.165.1 SystemExceptions.BadReturn: accessing
descriptionAnswer a textual description of the exception.
1.166 SystemExceptions.CInterfaceError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.PrimitiveFailedCategory: Language-Exceptions
I am raised when an error happens that is related to the C interface.
1.166.1 SystemExceptions.CInterfaceError: accessing
descriptionAnswer a textual description of the exception.
282 GNU Smalltalk Library Reference
1.167 SystemExceptions.EmptyCollection
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when one invokes a method on an empty collection.
1.167.1 SystemExceptions.EmptyCollection: accessing
descriptionAnswer a textual description of the exception.
1.168 SystemExceptions.EndOfStream
Defined in namespace Smalltalk.SystemExceptionsSuperclass: NotificationCategory: Language-Exceptions
I am raised when a stream reaches its end.
1.168.1 SystemExceptions.EndOfStream class: signaling
signalOn: streamAnswer an exception reporting the parameter has reached its end.
1.168.2 SystemExceptions.EndOfStream: accessing
descriptionAnswer a textual description of the exception.
stream Answer the stream whose end was reached.
stream: anObjectSet the stream whose end was reached.
1.169 SystemExceptions.FileError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.PrimitiveFailedCategory: Language-Exceptions
I am raised when an error happens that is related to the file system.
1.169.1 SystemExceptions.FileError: accessing
descriptionAnswer a textual description of the exception.
1.170 SystemExceptions.IndexOutOfRange
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.ArgumentOutOfRangeCategory: Language-Exceptions
I am raised when one invokes am accessor method with an index outside of itsvalid range.
Chapter 1: Base classes 283
1.170.1 SystemExceptions.IndexOutOfRange class: signaling
signalOn: aCollection withIndex: valueThe given index was out of range in aCollection.
1.170.2 SystemExceptions.IndexOutOfRange: accessing
collection Answer the collection that triggered the error
collection: anObjectSet the collection that triggered the error
descriptionAnswer a textual description of the exception.
messageTextAnswer an exception’s message text.
1.171 SystemExceptions.InvalidArgument
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when one invokes a method with an invalid argument.
1.171.1 SystemExceptions.InvalidArgument: accessing
messageTextAnswer an exception’s message text.
1.172 SystemExceptions.InvalidProcessState
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am an error raised when trying to resume a terminated process, or stuff likethat.
1.172.1 SystemExceptions.InvalidProcessState: accessing
descriptionAnswer a textual description of the exception.
1.173 SystemExceptions.InvalidSize
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions
I am raised when an argument has an invalid size.
284 GNU Smalltalk Library Reference
1.173.1 SystemExceptions.InvalidSize: accessing
descriptionAnswer a textual description of the exception.
1.174 SystemExceptions.InvalidState
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when one invokes a method and the receiver or an argument are inan invalid state for the method.
1.174.1 SystemExceptions.InvalidState: accessing
messageTextAnswer an exception’s message text.
1.175 SystemExceptions.InvalidValue
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions
I am raised when one invokes a method with an invalid receiver or argument.
1.175.1 SystemExceptions.InvalidValue class: signaling
signalOn: valueAnswer an exception reporting the parameter as invalid.
signalOn: value reason: reasonAnswer an exception reporting ‘value’ as invalid, for the given reason.
1.175.2 SystemExceptions.InvalidValue: accessing
descriptionAnswer a textual description of the exception.
messageTextAnswer an exception’s message text.
value Answer the object that was found to be invalid.
value: anObjectSet the object that was found to be invalid.
1.176 SystemExceptions.MustBeBoolean
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.WrongClassCategory: Language-Exceptions
I am raised when one invokes a boolean method on a non-boolean.
Chapter 1: Base classes 285
1.176.1 SystemExceptions.MustBeBoolean class: signaling
signalOn: anObjectSignal a new exception, with the bad value in question being anObject.
1.177 SystemExceptions.MutationError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions
I am an error raised when a class is mutated in an invalid way.
1.177.1 SystemExceptions.MutationError class: instance creation
new Create an instance of the receiver, which you will be able to signal later.
1.177.2 SystemExceptions.MutationError: accessing
descriptionAnswer a textual description of the exception.
1.178 SystemExceptions.NoRunnableProcess
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am raised when no runnable process can be found in the image.
1.178.1 SystemExceptions.NoRunnableProcess: accessing
descriptionAnswer a textual description of the exception.
1.179 SystemExceptions.NotEnoughElements
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions
I am raised when one invokes #next: but not enough items remain in thestream.
1.179.1 SystemExceptions.NotEnoughElements class: signaling
signalOn: remainingCountAnswer an exception reporting the parameter as invalid.
1.179.2 SystemExceptions.NotEnoughElements: accessing
descriptionAnswer a textual description of the exception.
286 GNU Smalltalk Library Reference
messageTextAnswer an exception’s message text.
remainingCountAnswer the number of items that were to be read.
remainingCount: anObjectSet the number of items that were to be read.
1.180 SystemExceptions.NotFound
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions
I am raised when something is searched without success.
1.180.1 SystemExceptions.NotFound class: accessing
signalOn: value reason: aStringRaise an exception: reason specifies the reason of the exception.
signalOn: value what: aStringRaise an exception; aString specifies what was not found (a key, an object, aclass, and so on).
1.180.2 SystemExceptions.NotFound: accessing
descriptionAnswer a textual description of the exception.
1.181 SystemExceptions.NotImplemented
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions
I am raised when a method is called that has not been implemented.
1.181.1 SystemExceptions.NotImplemented: accessing
descriptionAnswer a textual description of the exception.
1.182 SystemExceptions.NotIndexable
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when an object is not indexable.
1.182.1 SystemExceptions.NotIndexable: accessing
descriptionAnswer a textual description of the exception.
Chapter 1: Base classes 287
1.183 SystemExceptions.NotYetImplemented
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.NotImplementedCategory: Language-Exceptions
I am raised when a method is called that has not been implemented yet.
1.183.1 SystemExceptions.NotYetImplemented: accessing
descriptionAnswer a textual description of the exception.
1.184 SystemExceptions.PackageNotAvailable
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.NotFoundCategory: Language-Packaging
1.184.1 SystemExceptions.PackageNotAvailable class: stillunclassified
signal: aStringSignal an exception saying that the package named aString can’t be found.
signal: package reason: reasonSignal an exception saying that be package named package can’t be found be-cause the reason named reason.
1.184.2 SystemExceptions.PackageNotAvailable: description
isResumableAnswer true. Package unavailability is resumable, because the package filesmight just lie elsewhere.
1.185 SystemExceptions.PrimitiveFailed
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am raised when a primitive fails for some reason.
1.185.1 SystemExceptions.PrimitiveFailed: accessing
descriptionAnswer a textual description of the exception.
1.186 SystemExceptions.ProcessBeingTerminated
Defined in namespace Smalltalk.SystemExceptionsSuperclass: NotificationCategory: Language-Exceptions
I am raised when a process is terminated.
288 GNU Smalltalk Library Reference
1.186.1 SystemExceptions.ProcessBeingTerminated class: stillunclassified
initialize Not commented.
1.186.2 SystemExceptions.ProcessBeingTerminated: accessing
descriptionAnswer a textual description of the exception.
semaphoreIf the process was waiting on a semaphore, answer it.
semaphore: aSemaphoreIf the process was waiting on a semaphore, answer it.
1.187 SystemExceptions.ProcessTerminated
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when somebody tries to resume or interrupt a terminated process.
1.187.1 SystemExceptions.ProcessTerminated: accessing
descriptionAnswer a textual description of the exception.
1.188 SystemExceptions.ReadOnlyObject
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when one writes to a read-only object.
1.188.1 SystemExceptions.ReadOnlyObject: accessing
descriptionAnswer a textual description of the exception.
1.189 SystemExceptions.SecurityError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am an error raised when an untrusted object tries to do an insecure operation.
1.189.1 SystemExceptions.SecurityError class: accessing
signal: aPermissionRaise the exception, setting to aPermission the permission that was tested andfailed.
Chapter 1: Base classes 289
1.189.2 SystemExceptions.SecurityError: accessing
descriptionAnswer a textual description of the exception.
failedPermissionAnswer the permission that was tested and that failed.
failedPermission: anObjectSet which permission was tested and failed.
1.190 SystemExceptions.ShouldNotImplement
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.NotImplementedCategory: Language-Exceptions
I am raised when a method is called that a class wishes that is not called.
1.190.1 SystemExceptions.ShouldNotImplement: accessing
descriptionAnswer a textual description of the exception.
1.191 SystemExceptions.SubclassResponsibility
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.ShouldNotImplementCategory: Language-Exceptions
I am raised when a method is called whose implementation is the responsibilityof concrete subclass.
1.191.1 SystemExceptions.SubclassResponsibility: accessing
descriptionAnswer a textual description of the exception.
1.192 SystemExceptions.UnhandledException
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ExceptionCategory: Language-Exception
I am raised when a backtrace is shown to terminate the current process.
1.192.1 SystemExceptions.UnhandledException: accessing
defaultActionTerminate the current process.
descriptionAnswer a textual description of the exception.
originalExceptionAnswer the uncaught exception.
290 GNU Smalltalk Library Reference
originalException: anObjectSet the uncaught exception to anObject.
1.193 SystemExceptions.UserInterrupt
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am raised when one presses Ctrl-C.
1.193.1 SystemExceptions.UserInterrupt: accessing
descriptionAnswer a textual description of the exception.
1.194 SystemExceptions.VerificationError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions
I am raised when the verification of a method fails.
1.194.1 SystemExceptions.VerificationError: accessing
descriptionAnswer a textual description of the exception.
1.195 SystemExceptions.VMError
Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions
I am an error related to the innards of the system.
1.195.1 SystemExceptions.VMError: accessing
descriptionAnswer a textual description of the exception.
1.196 SystemExceptions.WrongArgumentCount
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.PrimitiveFailedCategory: Language-Exceptions
I am raised when one tries to evaluate a method (via #perform:...) or a blockbut passes the wrong number of arguments.
1.196.1 SystemExceptions.WrongArgumentCount: accessing
descriptionAnswer a textual description of the exception.
Chapter 1: Base classes 291
1.197 SystemExceptions.WrongClass
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions
I am raised when an argument is constrained to be an instance of a determinateclass, and this constraint is not respected by the caller.
1.197.1 SystemExceptions.WrongClass class: signaling
signalOn: anObject mustBe: aClassOrArrayRaise an exception. The given object should have been an instance of one ofthe classes indicated by aClassOrArray (which should be a single class or anarray of classes). Whether instances of subclasses are allowed should be clearfrom the context, though in general (i.e. with the exception of a few systemmessages) they should be.
1.197.2 SystemExceptions.WrongClass: accessing
descriptionAnswer a textual description of the exception.
messageTextAnswer an exception’s message text.
validClassesAnswer the list of classes whose instances would have been valid.
validClasses: aCollectionSet the list of classes whose instances would have been valid.
validClassesStringAnswer the list of classes whose instances would have been valid, formatted asa string.
1.198 SystemExceptions.WrongMessageSent
Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.ShouldNotImplementCategory: Language-Exceptions
I am raised when a method is called that a class wishes that is not called. Thisexception also includes a suggestion on which message should be sent instead
1.198.1 SystemExceptions.WrongMessageSent class: signaling
signalOn: selector useInstead: aSymbolRaise an exception, signaling which selector was sent and suggesting a validalternative.
1.198.2 SystemExceptions.WrongMessageSent: accessing
messageTextAnswer an exception’s message text.
292 GNU Smalltalk Library Reference
selector Answer which selector was sent.
selector: aSymbolSet which selector was sent.
suggestedSelectorAnswer a valid alternative to the selector that was used.
suggestedSelector: aSymbolSet a valid alternative to the selector that was used.
1.199 TextCollector
Defined in namespace SmalltalkSuperclass: StreamCategory: Streams
I am a thread-safe class that maps between standard Stream protocol and asingle message to another object (its selector is pluggable and should roughlycorrespond to #nextPutAll:). I am, in fact, the class that implements the globalTranscript object.
1.199.1 TextCollector class: accessing
message: receiverToSelectorAssociationAnswer a new instance of the receiver, that uses the message identified byanAssociation to perform write operations. anAssociation’s key is the receiver,while its value is the selector.
new This method should not be called for instances of this class.
1.199.2 TextCollector: accessing
cr Emit a new-line (carriage return) to the Transcript
critical: aBlockEvaluate aBlock while holding the Transcript lock
endEntry Emit two new-lines. This method is present for compatibility with VisualWorks.
next: anInteger put: anObjectWrite anInteger copies of anObject to the Transcript
next: n putAll: aString startingAt: posWrite aString to the Transcript
nextPut: aCharacterEmit aCharacter to the Transcript
show: aStringWrite aString to the Transcript
showCr: aStringWrite aString to the Transcript, followed by a new-line character
showOnNewLine: aStringWrite aString to the Transcript, preceded by a new-line character
Chapter 1: Base classes 293
1.199.3 TextCollector: printing
print: anObjectPrint anObject’s representation to the Transcript
printOn: aStreamPrint a representation of the receiver onto aStream
1.199.4 TextCollector: set up
message Answer an association representing the message to be sent to perform writeoperations. The key is the receiver, the value is the selector
message: receiverToSelectorAssociationSet the message to be sent to perform write operations to the one representedby anAssociation. anAssociation’s key is the receiver, while its value is theselector
1.199.5 TextCollector: storing
store: anObjectPrint Smalltalk code which evaluates to anObject on the Transcript
storeOn: aStreamPrint Smalltalk code which evaluates to the receiver onto aStream
1.200 Time
Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types
My instances represent times of the day. I provide methods for instance cre-ation, methods that access components (hours, minutes, and seconds) of a timevalue, and a block execution timing facility.
1.200.1 Time class: basic (UTC)
midnight Answer a time representing midnight in Coordinated Universal Time (UTC)
utcNow Answer a time representing the current time of day in Coordinated UniversalTime (UTC)
utcSecondClockAnswer the number of seconds since the midnight of 1/1/1901 (unlike #sec-ondClock, the reference time is here expressed as UTC, that is as CoordinatedUniversal Time).
1.200.2 Time class: builtins
primNanosecondClockReturns the number of milliseconds since midnight.
primSecondClockReturns the number of seconds to/from 1/1/2000.
294 GNU Smalltalk Library Reference
timezone Answer a String associated with the current timezone (either standard ordaylight-saving) on this operating system. For example, the answer could be‘EST’ to indicate Eastern Standard Time; the answer can be empty and can’tbe assumed to be a three-character code such as ‘EST’.
timezoneBiasSpecifies the current bias, in seconds, for local time translation for the currenttime. The bias is the difference, in seconds, between Coordinated UniversalTime (UTC) and local time; a positive bias indicates that the local timezoneis to the east of Greenwich (e.g. Europe, Asia), while a negative bias indicatesthat it is to the west (e.g. America)
timezoneBias: secondsSpecifies the bias, in seconds, for local time translation for the given second clockvalue (0 being midnight of 1/1/1901). The bias is the difference, in seconds,between Coordinated Universal Time (UTC) and local time; a positive biasindicates that the local timezone is to the east of Greenwich (e.g. Europe,Asia), while a negative bias indicates that it is to the west (e.g. America)
1.200.3 Time class: clocks
millisecondClockAnswer the number of milliseconds since startup.
millisecondClockValueAnswer the number of milliseconds since startup
millisecondsPerDayAnswer the number of milliseconds in a day
millisecondsToRun: timedBlockAnswer the number of milliseconds which timedBlock took to run
nanosecondClockAnswer the number of nanoseconds since startup.
nanosecondClockValueAnswer the number of milliseconds since startup
secondClockAnswer the number of seconds since the midnight of 1/1/1901
1.200.4 Time class: initialization
initialize Initialize the Time class after the image has been bootstrapped
update: aspectPrivate - Initialize the receiver’s instance variables
1.200.5 Time class: instance creation
fromSeconds: secondCountAnswer a Time representing secondCount seconds past midnight
hour: h Answer a Time that is the given number of hours past midnight
Chapter 1: Base classes 295
hour: h minute: m second: sAnswer a Time that is the given number of hours, minutes and seconds pastmidnight
hours: h Answer a Time that is the given number of hours past midnight
hours: h minutes: m seconds: sAnswer a Time that is the given number of hours, minutes and seconds pastmidnight
minute: m Answer a Time that is the given number of minutes past midnight
minutes: mAnswer a Time that is the given number of minutes past midnight
new Answer a Time representing midnight
now Answer a time representing the current time of day
readFrom: aStreamParse an instance of the receiver (hours/minutes/seconds) from aStream
second: s Answer a Time that is the given number of seconds past midnight
seconds: s Answer a Time that is the given number of seconds past midnight
1.200.6 Time: accessing (ANSI for DateAndTimes)
hour Answer the number of hours in the receiver
hour12 Answer the hour in a 12-hour clock
hour24 Answer the hour in a 24-hour clock
minute Answer the number of minutes in the receiver
second Answer the number of seconds in the receiver
1.200.7 Time: accessing (non ANSI & for Durations)
asMillisecondsNot commented.
asNanosecondsNot commented.
asSeconds Answer ‘seconds’.
hours Answer the number of hours in the receiver
minutes Answer the number of minutes in the receiver
seconds Answer the number of seconds in the receiver
296 GNU Smalltalk Library Reference
1.200.8 Time: arithmetic
addSeconds: timeAmountAnswer a new Time that is timeAmount seconds after the receiver
addTime: timeAmountAnswer a new Time that is timeAmount seconds after the receiver; timeAmountis a Time.
printOn: aStreamPrint a representation of the receiver on aStream
subtractTime: timeAmountAnswer a new Time that is timeAmount seconds before the receiver;timeAmount is a Time.
1.200.9 Time: comparing
< aTime Answer whether the receiver is less than aTime
= aTime Answer whether the receiver is equal to aTime
hash Answer an hash value for the receiver
1.201 True
Defined in namespace SmalltalkSuperclass: BooleanCategory: Language-Data types
I represent truth and justice in the world. My motto is "semper veritatis".
1.201.1 True: basic
& aBooleanWe are true – anded with anything, we always answer the other operand
and: aBlockWe are true – anded with anything, we always answer the other operand, soevaluate aBlock
eqv: aBooleanAnswer whether the receiver and aBoolean represent the same boolean value
ifFalse: falseBlockWe are true – answer nil
ifFalse: falseBlock ifTrue: trueBlockWe are true – evaluate trueBlock
ifTrue: trueBlockWe are true – evaluate trueBlock
ifTrue: trueBlock ifFalse: falseBlockWe are true – evaluate trueBlock
not We are true – answer false
Chapter 1: Base classes 297
or: aBlock We are true – ored with anything, we always answer true
xor: aBooleanAnswer whether the receiver and aBoolean represent different boolean values
| aBooleanWe are true – ored with anything, we always answer true
1.201.2 True: C hacks
asCBooleanValueAnswer ‘1’.
1.201.3 True: printing
printOn: aStreamPrint a representation of the receiver on aStream
1.202 UndefinedObject
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation
I have the questionable distinction of being a class with only one instance, whichis the object "nil".
1.202.1 UndefinedObject: basic
copy Answer the receiver.
deepCopy Answer the receiver.
shallowCopyAnswer the receiver.
1.202.2 UndefinedObject: class creation - alternative
subclass: classNameString classInstanceVariableNames: stringClassInstVarNamesinstanceVariableNames: stringInstVarNames classVariableNames:stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableByteSubclass: classNameString classInstanceVariableNames:stringClassInstVarNames instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableByteSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
298 GNU Smalltalk Library Reference
variableLongSubclass: classNameString classInstanceVariableNames:stringClassInstVarNames instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableLongSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNamesinstanceVariableNames: stringInstVarNames classVariableNames:stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
variableSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don’t use this, it is only present to file in from IBM Smalltalk
1.202.3 UndefinedObject: class polymorphism
allSubclassesReturn all the classes in the system.
instSize Answer ‘0’.
metaclassFor: classNameStringCreate a Metaclass object for the given class name. The metaclass is a subclassof Class
methodDictionaryAnswer ‘nil’.
removeSubclass: aClassIgnored – necessary to support disjoint class hierarchies
subclass: classNameStringDefine a subclass of the receiver with the given name. If the class is alreadydefined, don’t modify its instance or class variables but still, if necessary, re-compile everything needed.
subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a fixed subclass of the receiver with the given name, instance variables,class variables, pool dictionaries and category. If the class is already defined, ifnecessary, recompile everything needed.
variable: shape subclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a variable subclass of the receiver with the given name, shape, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed. The shape can be one of
Chapter 1: Base classes 299
#byte #int8 #character #short #ushort #int #uint #int64 #uint64 #utf32#float #double or #pointer.
variableByteSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a byte variable subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed.
variableSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a variable pointer subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed.
variableWordSubclass: classNameString instanceVariableNames: stringInstVarNamesclassVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNamescategory: categoryNameString
Define a word variable subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If the class is alreadydefined, if necessary, recompile everything needed.
1.202.4 UndefinedObject: CObject interoperability
free Do nothing, a NULL pointer can be safely freed.
narrow Return the receiver: a NULL pointer is always nil, whatever its type.
1.202.5 UndefinedObject: dependents access
addDependent: ignoredFail, nil does not support dependents.
release Ignore this call, nil does not support dependents.
1.202.6 UndefinedObject: iteration
ifNil: nilBlock ifNotNilDo: iterableBlockEvaluate nilBlock if the receiver is nil, else evaluate iterableBlock with eachelement of the receiver (which should be an Iterable).
ifNotNilDo: iterableBlockEvaluate iterableBlock with each element of the receiver (which should be anIterable) if not nil. Else answer nil
ifNotNilDo: iterableBlock ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else evaluate iterableBlock, passing eachelement of the receiver (which should be an Iterable).
300 GNU Smalltalk Library Reference
1.202.7 UndefinedObject: printing
printOn: aStreamPrint a representation of the receiver on aStream.
printOn: aStream in: aNamespacePrint on aStream a representation of the receiver as it would be accessed fromaNamespace: nil is the same everywhere, so print the same as #printOn:
1.202.8 UndefinedObject: still unclassified
inheritsFrom: aClassAlways return false, as nil inherits from nothing.
1.202.9 UndefinedObject: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStreamStore Smalltalk code compiling to the receiver on aStream.
1.202.10 UndefinedObject: testing
ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else answer nil
ifNil: nilBlock ifNotNil: notNilBlockEvaluate nilBlock if the receiver is nil, else evaluate notNilBlock, passing thereceiver.
ifNotNil: notNilBlockEvaluate notNilBlock if the receiver is not nil, passing the receiver. Else answernil
ifNotNil: notNilBlock ifNil: nilBlockEvaluate nilBlock if the receiver is nil, else evaluate notNilBlock, passing thereceiver.
isNil Answer whether the receiver is the undefined object nil. Always answer true.
isNull Answer whether the receiver represents a NULL C pointer. Always answer true.
notNil Answer whether the receiver is not the undefined object nil. Always answerfalse.
1.203 UnicodeCharacter
Defined in namespace SmalltalkSuperclass: CharacterCategory: Language-Data types
My instances represent the over one million characters of the Unicode characterset. It provides messages to translate between integers and character objects.
Chapter 1: Base classes 301
UnicodeCharacter objects are created when accessing UnicodeStrings, or withCharacter class>>#codePoint:.
1.203.1 UnicodeCharacter class: built ins
value: anIntegerReturns the character object, possibly a Character, corresponding to anInteger.Error if anInteger is not an integer, or not in 0..16r10FFFF.
This is only a primitive for speed. UnicodeCharacter’s #value: method is equiv-alent to #codePoint: (which is the same for Character and UnicodeCharacter).
1.203.2 UnicodeCharacter: coercion methods
* aNumberReturns a String with aNumber occurrences of the receiver.
1.204 UnicodeString
Defined in namespace SmalltalkSuperclass: CharacterArrayCategory: Collections-Text
My instances represent Unicode string data types. Data is stored as 4-byteUTF-32 characters
1.204.1 UnicodeString class: converting
fromString: aStringReturn the String, aString, converted to its Unicode representation. Unless theI18N package is loaded, this is not implemented.
1.204.2 UnicodeString class: multibyte encodings
defaultEncodingAnswer the encoding used by the receiver. Conventionally, we answer ’Unicode’to ensure that two UnicodeStrings always have the same encoding.
isUnicode Answer true; the receiver stores characters.
1.204.3 UnicodeString: built ins
at: anIndex ifAbsent: aBlockAnswer the index-th indexed instance variable of the receiver
1.204.4 UnicodeString: built-ins
hash Answer an hash value for the receiver
1.204.5 UnicodeString: converting
asString Returns the string corresponding to the receiver. Without the Iconv package,unrecognized Unicode characters become $? characters. When it is loaded, anappropriate single- or multi-byte encoding could be used.
302 GNU Smalltalk Library Reference
asSymbol Returns the symbol corresponding to the receiver
asUnicodeStringBut I already am a UnicodeString! Really!
displayOn: aStreamPrint a representation of the receiver on aStream
printOn: aStreamPrint a representation of the receiver on aStream
1.204.6 UnicodeString: multibyte encodings
encoding Answer the encoding used by the receiver. Conventionally, we answer ’Unicode’to ensure that two UnicodeStrings always have the same encoding.
numberOfCharactersAnswer the number of Unicode characters in the receiver. This is the same as#size for UnicodeString.
1.205 ValueAdaptor
Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types
My subclasses are used to access data from different objects with a consistentprotocol. However, I’m an abstract class.
1.205.1 ValueAdaptor class: creating instances
new We don’t know enough of subclasses to have a shared implementation of new
1.205.2 ValueAdaptor: accessing
value Retrive the value of the receiver. Must be implemented by ValueAdaptor’ssubclasses
value: anObjectSet the value of the receiver. Must be implemented by ValueAdaptor’s sub-classes
1.205.3 ValueAdaptor: printing
printOn: aStreamPrint a representation of the receiver
1.206 ValueHolder
Defined in namespace SmalltalkSuperclass: ValueAdaptorCategory: Language-Data types
I store my value in a variable. For example, you can use me to pass numbers byreference. Just instance me before calling a method and ask for my value afterthat method. There are a lot of other creative uses for my intances, though.
Chapter 1: Base classes 303
1.206.1 ValueHolder class: creating instances
new Create a ValueHolder whose starting value is nil
null Answer the sole instance of NullValueHolder
with: anObjectCreate a ValueHolder whose starting value is anObject
1.206.2 ValueHolder: accessing
value Get the value of the receiver.
value: anObjectSet the value of the receiver.
1.206.3 ValueHolder: initializing
initialize Private - set the initial value of the receiver
1.207 VariableBinding
Defined in namespace SmalltalkSuperclass: HomedAssociationCategory: Language-Data types
My instances represent a mapping between a key in a namespace and its value.I print different than a normal Association, and know about my parent names-pace, otherwise my behavior is the same.
1.207.1 VariableBinding: compiler
literalEquals: anObjectNot commented.
literalHashNot commented.
1.207.2 VariableBinding: printing
path Print a dotted path that compiles to the receiver’s value
printOn: aStreamPut on aStream a representation of the receiver
1.207.3 VariableBinding: saving and loading
binaryRepresentationObjectThis method is implemented to allow for a PluggableProxy to be used with Vari-ableBindings. Answer a DirectedMessage which sends #at: to the environmentthat holds the receiver.
304 GNU Smalltalk Library Reference
1.207.4 VariableBinding: storing
isLiteralObjectAnswer whether the receiver is expressible as a Smalltalk literal.
storeLiteralOn: aStreamStore on aStream some Smalltalk code which compiles to the receiver
storeOn: aStreamPut on aStream some Smalltalk code compiling to the receiver
1.207.5 VariableBinding: testing
isDefined Answer true if this VariableBinding lives outside the Undeclared dictionary
1.208 VersionableObjectProxy
Defined in namespace SmalltalkSuperclass: NullProxyCategory: Streams-Files
I am a proxy that stores additional information to allow different versions of anobject’s representations to be handled by the program. VersionableObjectProx-ies are backwards compatible, that is you can support versioning even if you didnot use a VersionableObjectProxy for that class when the object was originarilydumped. VersionableObjectProxy does not support classes that changed shapeacross different versions. See the method comments for more information.
1.208.1 VersionableObjectProxy class: saving and restoring
loadFrom: anObjectDumperRetrieve the object. If the version number doesn’t match the #binaryRepre-sentationVersion answered by the class, call the class’ #convertFromVersion:-withFixedVariables:instanceVariables:for: method. The stored version numberwill be the first parameter to that method (or nil if the stored object did notemploy a VersionableObjectProxy), the remaining parameters will be respec-tively the fixed instance variables, the indexed instance variables (or nil if theclass is fixed), and the ObjectDumper itself. If no VersionableObjectProxy, theclass is sent #nonVersionedInstSize to retrieve the number of fixed instancevariables stored for the non-versioned object.
1.208.2 VersionableObjectProxy: saving and restoring
dumpTo: anObjectDumperSave the object with extra versioning information.
1.209 VFS.ArchiveFile
Defined in namespace Smalltalk.VFSSuperclass: VFS.FileWrapperCategory: Streams-Files
ArchiveFile handles virtual filesystems that have a directory structure of theirown. The directories and files in the archive are instances of ArchiveMember,
Chapter 1: Base classes 305
but the functionality resides entirely in ArchiveFile because the members willstill ask the archive to get directory information on them, to extract them to areal file, and so on.
1.209.1 VFS.ArchiveFile: ArchiveMember protocol
fillMember: anArchiveMemberExtract the information on anArchiveMember. Answer false if it actually doesnot exist in the archive; otherwise, answer true after having told anArchive-Member about them by sending #size:stCtime:stMtime:stAtime:isDirectory: toit.
member: anArchiveMember do: aBlockEvaluate aBlock once for each file in the directory represented by anArchive-Member, passing its name.
member: anArchiveMember mode: bitsSet the permission bits for the file in anArchiveMember.
refresh Extract the directory listing from the archive
removeMember: anArchiveMemberRemove the member represented by anArchiveMember.
updateMember: anArchiveMemberUpdate the member represented by anArchiveMember by copying the file intowhich it was extracted back to the archive.
1.209.2 VFS.ArchiveFile: directory operations
at: aNameAnswer a FilePath for a file named ‘aName’ residing in the directory representedby the receiver.
nameAt: aStringAnswer a FilePath for a file named ‘aName’ residing in the directory representedby the receiver.
namesDo: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing its name.
release Release the resources used by the receiver that don’t survive when reloading asnapshot.
1.209.3 VFS.ArchiveFile: querying
isAccessibleAnswer whether a directory with the name contained in the receiver does existand can be accessed
isDirectoryAnswer true. The archive can always be considered as a directory.
306 GNU Smalltalk Library Reference
1.209.4 VFS.ArchiveFile: still unclassified
displayOn: aStreamPrint a representation of the file identified by the receiver.
1.209.5 VFS.ArchiveFile: TmpFileArchiveMember protocol
extractMember: anArchiveMemberExtract the contents of anArchiveMember into a file that resides on disk, andanswer the name of the file.
extractMember: anArchiveMember into: fileExtract the contents of anArchiveMember into a file that resides on disk, andanswer the name of the file.
1.210 VFS.ArchiveMember
Defined in namespace Smalltalk.VFSSuperclass: FilePathCategory: Streams-Files
TmpFileArchiveMember is a handler class for members of archive files thatcreates temporary files when extracting files from an archive.
1.210.1 VFS.ArchiveMember: accessing
archive Answer the archive of which the receiver is a member.
asString Answer the name of the file identified by the receiver as answered by File>>-#name.
creationTimeAnswer the creation time of the file identified by the receiver. On some operat-ing systems, this could actually be the last change time (the ‘last change time’has to do with permissions, ownership and the like).
lastAccessTimeAnswer the last access time of the file identified by the receiver
lastChangeTimeAnswer the last change time of the file identified by the receiver (the ‘last changetime’ has to do with permissions, ownership and the like). On some operatingsystems, this could actually be the file creation time.
lastModifyTimeAnswer the last modify time of the file identified by the receiver (the ‘lastmodify time’ has to do with the actual file contents).
name Answer the receiver’s file name.
name: aNameSet the receiver’s file name to aName.
refresh Refresh the statistics for the receiver
size Answer the size of the file identified by the receiver
Chapter 1: Base classes 307
1.210.2 VFS.ArchiveMember: basic
= aFile Answer whether the receiver represents the same file as the receiver.
hash Answer a hash value for the receiver.
1.210.3 VFS.ArchiveMember: delegation
full Answer the size of the file identified by the receiver
1.210.4 VFS.ArchiveMember: directory operations
at: aNameAnswer a FilePath for a file named ‘aName’ residing in the directory representedby the receiver.
createDirectory: dirNameCreate a subdirectory of the receiver, naming it dirName.
namesDo: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing its name.
1.210.5 VFS.ArchiveMember: file operations
open: class mode: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
remove Remove the file with the given path name
renameTo: newFileNameRename the file with the given path name oldFileName to newFileName
update: aspectPrivate - Update the in-archive version of the file before closing.
1.210.6 VFS.ArchiveMember: initializing
archive: anArchiveFileSet the archive of which the receiver is a member.
fillFrom: dataCalled back by the receiver’s archive when the ArchiveMember asks for fileinformation.
size: bytes stCtime: ctime stMtime: mtime stAtime: atime mode: modeBitsSet the file information for the receiver.
size: bytes stMtime: mtime mode: modeBitsSet the file information for the receiver.
308 GNU Smalltalk Library Reference
1.210.7 VFS.ArchiveMember: still unclassified
, aName Answer an object of the same kind as the receiver, whose name is suffixed withaName.
displayOn: aStreamPrint a representation of the file identified by the receiver.
isAbsolute Answer whether the receiver identifies an absolute path.
1.210.8 VFS.ArchiveMember: testing
exists Answer whether a file with the name contained in the receiver does exist.
isAccessibleAnswer whether a directory with the name contained in the receiver does existand is accessible
isDirectoryAnswer whether a file with the name contained in the receiver does exist andidentifies a directory.
isExecutableAnswer whether a file with the name contained in the receiver does exist andis executable
isReadableAnswer whether a file with the name contained in the receiver does exist andis readable
isSymbolicLinkAnswer whether a file with the name contained in the receiver does exist andidentifies a symbolic link.
isWriteableAnswer whether a file with the name contained in the receiver does exist andis writeable
mode Answer the octal permissions for the file.
mode: modeSet the octal permissions for the file to be ‘mode’.
1.211 VFS.FileWrapper
Defined in namespace Smalltalk.VFSSuperclass: FilePathCategory: Streams-Files
FileWrapper gives information for virtual files that refer to a real file on disk.
1.211.1 VFS.FileWrapper class: initializing
initialize Register the receiver with ObjectMemory
update: aspectPrivate - Remove the files before quitting, and register the virtual filesystemsspecified by the subclasses upon image load.
Chapter 1: Base classes 309
1.211.2 VFS.FileWrapper class: instance creation
on: file Create an instance of this class representing the contents of the given file, underthe virtual filesystem fsName.
1.211.3 VFS.FileWrapper: accessing
asString Answer the string representation of the receiver’s path.
at: aNameAnswer a File or Directory object as appropriate for a file named ’aName’ inthe directory represented by the receiver.
lastAccessTime: accessDateTime lastModifyTime: modifyDateTimeUpdate the timestamps of the file corresponding to the receiver, to be access-DateTime and modifyDateTime.
name Answer the full path to the receiver.
owner: ownerString group: groupStringSet the receiver’s owner and group to be ownerString and groupString.
pathTo: destNameCompute the relative path from the receiver to destName.
1.211.4 VFS.FileWrapper: basic
= aFile Answer whether the receiver represents the same file as the receiver.
hash Answer a hash value for the receiver.
1.211.5 VFS.FileWrapper: delegation
creationTimeAnswer the creation time of the file identified by the receiver. On some operat-ing systems, this could actually be the last change time (the ‘last change time’has to do with permissions, ownership and the like).
full Answer the size of the file identified by the receiver
isExecutableAnswer whether a file with the name contained in the receiver does exist andis executable
isReadableAnswer whether a file with the name contained in the receiver does exist andis readable
isWriteableAnswer whether a file with the name contained in the receiver does exist andis writeable
lastAccessTimeAnswer the last access time of the file identified by the receiver
310 GNU Smalltalk Library Reference
lastChangeTimeAnswer the last change time of the file identified by the receiver (the ‘last changetime’ has to do with permissions, ownership and the like). On some operatingsystems, this could actually be the file creation time.
lastModifyTimeAnswer the last modify time of the file identified by the receiver (the ‘lastmodify time’ has to do with the actual file contents).
mode Answer the permission bits for the file identified by the receiver
mode: anIntegerAnswer the permission bits for the file identified by the receiver
open: class mode: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
remove Remove the file with the given path name
size Answer the size of the file identified by the receiver
1.211.6 VFS.FileWrapper: enumerating
namesDo: aBlockEvaluate aBlock once for each file in the directory represented by the receiver,passing its name.
1.211.7 VFS.FileWrapper: file operations
pathFrom: dirNameCompute the relative path from the directory dirName to the receiver
renameTo: newNameRename the file identified by the receiver to newName
symlinkAs: destNameCreate destName as a symbolic link of the receiver. The appropriate relativepath is computed automatically.
symlinkFrom: srcNameCreate the receiver as a symbolic link from srcName (relative to the path of thereceiver).
1.211.8 VFS.FileWrapper: testing
exists Answer whether a file with the name contained in the receiver does exist.
isAbsolute Answer whether the receiver identifies an absolute path.
isAccessibleAnswer whether a directory with the name contained in the receiver does existand can be accessed
isDirectoryAnswer whether a file with the name contained in the receiver does exist iden-tifies a directory.
Chapter 1: Base classes 311
isSymbolicLinkAnswer whether a file with the name contained in the receiver does exist andidentifies a symbolic link.
1.212 VFS.StoredZipMember
Defined in namespace Smalltalk.VFSSuperclass: VFS.TmpFileArchiveMemberCategory: Streams-Files
ArchiveMember is the handler class for stored ZIP archive members, which areoptimized.
1.212.1 VFS.StoredZipMember: accessing
offset Answer ‘offset’.
offset: anIntegerNot commented.
1.212.2 VFS.StoredZipMember: opening
open: class mode: mode ifFail: aBlockNot commented.
1.213 VFS.TmpFileArchiveMember
Defined in namespace Smalltalk.VFSSuperclass: VFS.ArchiveMemberCategory: Streams-Files
1.213.1 VFS.TmpFileArchiveMember: directory operations
file Answer the real file name which holds the file contents, or nil if it does notapply.
open: class mode: mode ifFail: aBlockOpen the receiver in the given mode (as answered by FileStream’s class constantmethods)
1.213.2 VFS.TmpFileArchiveMember: finalization
release Release the resources used by the receiver that don’t survive when reloading asnapshot.
1.213.3 VFS.TmpFileArchiveMember: still unclassified
extracted Answer whether the file has already been extracted to disk.
312 GNU Smalltalk Library Reference
1.214 VFS.ZipFile
Defined in namespace Smalltalk.VFSSuperclass: VFS.ArchiveFileCategory: Streams-Files
ZipFile transparently extracts files from a ZIP archive.
1.214.1 VFS.ZipFile: members
centralDirectoryRangeIn: fNot commented.
createDirectory: dirNameCreate a subdirectory of the receiver, naming it dirName.
extractMember: anArchiveMember into: tempExtract the contents of anArchiveMember into a file that resides on disk, andanswer the name of the file.
fileData Extract the directory listing from the archive
member: anArchiveMember mode: bitsSet the permission bits for the file in anArchiveMember.
removeMember: anArchiveMemberRemove the member represented by anArchiveMember.
updateMember: anArchiveMemberUpdate the member represented by anArchiveMember by copying the file intowhich it was extracted back to the archive.
1.215 Warning
Defined in namespace SmalltalkSuperclass: NotificationCategory: Language-Exceptions
Warning represents an ‘important’ but resumable error.
1.215.1 Warning: exception description
descriptionAnswer a textual description of the exception.
1.216 WeakArray
Defined in namespace SmalltalkSuperclass: ArrayCategory: Collections-Weak
I am similar to a plain array, but my items are stored in a weak object, so Itrack which of them are garbage collected.
Chapter 1: Base classes 313
1.216.1 WeakArray class: instance creation
new Create a new WeakArray of size 0.
new: size Create a new WeakArray of the given size.
1.216.2 WeakArray: accessing
aliveObjectsDo: aBlockEvaluate aBlock for all the elements in the array, excluding the garbage collectedones. Note: a finalized object stays alive until the next collection (the collectorhas no means to see whether it was resuscitated by the finalizer), so an objectbeing alive does not mean that it is usable.
at: index Answer the index-th item of the receiver, or nil if it has been garbage collected.
at: index put: objectStore the value associated to the given index; plus, store in nilValues whetherthe object is nil. nil objects whose associated item of nilValues is 1 were touchedby the garbage collector.
atAll: indices put: objectPut object at every index contained in the indices collection
atAllPut: objectPut object at every index in the receiver
clearGCFlag: indexClear the ‘object has been garbage collected’ flag for the item at the given index
do: aBlockEvaluate aBlock for all the elements in the array, including the garbage collectedones (pass nil for those).
isAlive: indexAnswer whether the item at the given index is still alive or has been garbagecollected. Note: a finalized object stays alive until the next collection (thecollector has no means to see whether it was resuscitated by the finalizer), soan object being alive does not mean that it is usable.
size Answer the number of items in the receiver
1.216.3 WeakArray: conversion
asArray Answer a non-weak version of the receiver
deepCopy Returns a deep copy of the receiver (the instance variables are copies of thereceiver’s instance variables)
shallowCopyReturns a shallow copy of the receiver (the instance variables are not copied)
species Answer Array; this method is used in the #copyEmpty: message, which in turnis used by all collection-returning methods (collect:, select:, reject:, etc.).
314 GNU Smalltalk Library Reference
1.216.4 WeakArray: loading
postLoad Called after loading an object; must restore it to the state before ‘preStore’ wascalled. Make it weak again
1.217 WeakIdentitySet
Defined in namespace SmalltalkSuperclass: WeakSetCategory: Collections-Weak
I am similar to a plain identity set, but my keys are stored in a weak array; Itrack which of them are garbage collected and, as soon as I encounter one ofthem, I swiftly remove all the garbage collected keys
1.217.1 WeakIdentitySet: accessing
identityIncludes: anObjectAnswer whether I include anObject exactly. As I am an identity-set, this is thesame as #includes:.
1.218 WeakKeyDictionary
Defined in namespace SmalltalkSuperclass: DictionaryCategory: Collections-Weak
I am similar to a plain Dictionary, but my keys are stored in a weak array; Itrack which of them are garbage collected and, as soon as I encounter one ofthem, I swiftly remove all the associations for the garbage collected keys
1.218.1 WeakKeyDictionary class: hacks
postLoad Called after loading an object; must restore it to the state before ‘preStore’ wascalled. Make it weak again
1.218.2 WeakKeyDictionary: accessing
add: anAssociationStore value as associated to the given key.
at: key put: valueStore value as associated to the given key.
1.219 WeakKeyIdentityDictionary
Defined in namespace SmalltalkSuperclass: WeakKeyDictionaryCategory: Collections-Weak
I am similar to a plain identity dictionary, but my keys are stored in a weakarray; I track which of them are garbage collected and, as soon as I encounterone of them, I swiftly remove all the associations for the garbage collected keys
Chapter 1: Base classes 315
1.220 WeakSet
Defined in namespace SmalltalkSuperclass: SetCategory: Collections-Weak
I am similar to a plain set, but my items are stored in a weak array; I trackwhich of them are garbage collected and, as soon as I encounter one of them, Iswiftly remove all.
1.220.1 WeakSet: accessing
add: newObjectAdd newObject to the set, if and only if the set doesn’t already contain anoccurrence of it. Don’t fail if a duplicate is found. Answer newObject
do: aBlockEnumerate all the non-nil members of the set
1.220.2 WeakSet: copying
deepCopy Returns a deep copy of the receiver (the instance variables are copies of thereceiver’s instance variables)
shallowCopyReturns a shallow copy of the receiver (the instance variables are not copied)
1.220.3 WeakSet: loading
postLoad Called after loading an object; must restore it to the state before ‘preStore’ wascalled. Make it weak again
1.221 WeakValueIdentityDictionary
Defined in namespace SmalltalkSuperclass: WeakValueLookupTableCategory: Collections-Weak
I am similar to a plain identity dictionary, but my values are stored in a weakarray; I track which of the values are garbage collected and, as soon as oneof them is accessed, I swiftly remove the associations for the garbage collectedvalues
1.222 WeakValueLookupTable
Defined in namespace SmalltalkSuperclass: LookupTableCategory: Collections-Weak
I am similar to a plain LookupTable, but my values are stored in a weak array;I track which of the values are garbage collected and, as soon as one of them isaccessed, I swiftly remove the associations for the garbage collected values
316 GNU Smalltalk Library Reference
1.222.1 WeakValueLookupTable class: hacks
primNew: realSizeAnswer a new, uninitialized instance of the receiver with the given size
1.222.2 WeakValueLookupTable: hacks
at: key ifAbsent: aBlockAnswer the value associated to the given key, or the result of evaluating aBlockif the key is not found
at: key ifPresent: aBlockIf aKey is absent, answer nil. Else, evaluate aBlock passing the associated valueand answer the result of the invocation
includesKey: keyAnswer whether the receiver contains the given key.
1.222.3 WeakValueLookupTable: rehashing
rehash Rehash the receiver
1.223 WordArray
Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable
I am similar to a plain array, but my items are 32-bit integers.
1.223.1 WordArray: built ins
at: anIndex ifAbsent: aBlockAnswer the index-th indexed instance variable of the receiver
1.224 WriteStream
Defined in namespace SmalltalkSuperclass: PositionableStreamCategory: Streams-Collections
I am the class of writeable streams. I only allow write operations to my in-stances; reading is strictly forbidden.
1.224.1 WriteStream class: instance creation
on: aCollectionAnswer a new instance of the receiver which streams on aCollection. Everyitem of aCollection is discarded.
with: aCollectionAnswer a new instance of the receiver which streams from the end of aCollection.
Chapter 1: Base classes 317
with: aCollection from: firstIndex to: lastIndexAnswer a new instance of the receiver which streams from the firstIndex-th itemof aCollection to the lastIndex-th. The pointer is moved to the last item in thatrange.
1.224.2 WriteStream: accessing-writing
contents Returns a collection of the same type that the stream accesses, up to andincluding the final element.
next: n putAll: aCollection startingAt: posPut n characters or bytes of aCollection, starting at the pos-th, in the collectionbuffer.
nextPut: anObjectStore anObject as the next item in the receiver. Grow the collection if necessary
readStreamAnswer a ReadStream on the same contents as the receiver
reverseContentsReturns a collection of the same type that the stream accesses, up to andincluding the final element, but in reverse order.
1.224.3 WriteStream: positioning
emptyStreamExtension - Reset the stream
1.225 ZeroDivide
Defined in namespace SmalltalkSuperclass: ArithmeticErrorCategory: Language-Exceptions
A ZeroDivide exception is raised by numeric classes when a program tries todivide by zero. Information on the dividend is available to the handler.
1.225.1 ZeroDivide class: instance creation
dividend: aNumberCreate a new ZeroDivide object remembering that the dividend was aNumber.
new Create a new ZeroDivide object; the dividend is conventionally set to zero.
1.225.2 ZeroDivide: accessing
dividend Answer the number that was being divided by zero
1.225.3 ZeroDivide: description
descriptionAnswer a textual description of the exception.
319
Class index
AAbstractNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8AlternativeObjectProxy . . . . . . . . . . . . . . . . . . . . . . . . 11ArithmeticError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12ArrayedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Autoload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
BBag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19BindingDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29BlockClosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31BlockContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36ByteArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
CCAggregate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42CallinProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42CArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42CArrayCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42CBoolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43CByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44CCallable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44CCallbackDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . 45CChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46CCompound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46CDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47CFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48CFunctionDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49CharacterArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52CInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57ClassDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62CLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64CLongDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65CLongLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65CObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69CompiledBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73CompiledCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75CompiledMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78ContextPart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Continuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86CPtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87CPtrCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87CScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88CScalarCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89CShort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
CSmalltalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89CString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90CStringCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91CStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91CType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91CUChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93CUInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93CULong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94CULongLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94CUnion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95CUShort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
DDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95DateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99DeferredVariableBinding . . . . . . . . . . . . . . . . . . . . . . 102Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102DelayedAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105DirectedMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110DLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111DumperProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113DynamicVariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
EError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115ExceptionSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
FFalse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120FileDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123FilePath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130FileSegment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136FileStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137Float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140FloatD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144FloatE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145FloatQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147Fraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
GGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152Getopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
320 GNU Smalltalk Library Reference
HHalt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154HashedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154HomedAssociation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
IIdentityDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157IdentitySet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Iterable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
LLargeArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164LargeArrayedCollection . . . . . . . . . . . . . . . . . . . . . . . 164LargeByteArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165LargeInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165LargeNegativeInteger . . . . . . . . . . . . . . . . . . . . . . . . . 168LargePositiveInteger . . . . . . . . . . . . . . . . . . . . . . . . . . 169LargeWordArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170LargeZeroInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172LinkedList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172LookupKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173LookupTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
MMagnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176MappedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180MessageNotUnderstood . . . . . . . . . . . . . . . . . . . . . . . 181Metaclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181MethodContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184MethodDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185MethodInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
NNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186NetClients.URIResolver . . . . . . . . . . . . . . . . . . . . . . . 188NetClients.URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192NullProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192NullValueHolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
OObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199ObjectDumper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209ObjectMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210OrderedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
PPackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217PackageLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220Permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221PluggableAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223PluggableProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224PositionableStream . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228ProcessEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . 230ProcessorScheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . 232ProcessVariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234Promise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
RRandom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236ReadStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237ReadWriteStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238RecursionLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241Regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242RegexResults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243RootNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244RunArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
SScaledDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247SecurityPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249Semaphore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250SequenceableCollection . . . . . . . . . . . . . . . . . . . . . . . 251Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257SharedQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258SingletonProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258SmallInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259SortedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274SymLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277SystemDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277SystemExceptions.AlreadyDefined . . . . . . . . . . . . . 280SystemExceptions.ArgumentOutOfRange . . . . . 281SystemExceptions.BadReturn . . . . . . . . . . . . . . . . . 281SystemExceptions.CInterfaceError . . . . . . . . . . . . 281SystemExceptions.EmptyCollection . . . . . . . . . . . 282SystemExceptions.EndOfStream . . . . . . . . . . . . . . 282SystemExceptions.FileError . . . . . . . . . . . . . . . . . . . 282SystemExceptions.IndexOutOfRange . . . . . . . . . . 282SystemExceptions.InvalidArgument . . . . . . . . . . . 283SystemExceptions.InvalidProcessState . . . . . . . . . 283SystemExceptions.InvalidSize . . . . . . . . . . . . . . . . . 283SystemExceptions.InvalidState . . . . . . . . . . . . . . . . 284SystemExceptions.InvalidValue . . . . . . . . . . . . . . . . 284SystemExceptions.MustBeBoolean . . . . . . . . . . . . 284SystemExceptions.MutationError . . . . . . . . . . . . . 285SystemExceptions.NoRunnableProcess . . . . . . . . 285
Class index 321
SystemExceptions.NotEnoughElements . . . . . . . . 285SystemExceptions.NotFound . . . . . . . . . . . . . . . . . . 286SystemExceptions.NotImplemented . . . . . . . . . . . 286SystemExceptions.NotIndexable . . . . . . . . . . . . . . . 286SystemExceptions.NotYetImplemented . . . . . . . . 287SystemExceptions.PackageNotAvailable . . . . . . . 287SystemExceptions.PrimitiveFailed . . . . . . . . . . . . . 287SystemExceptions.ProcessBeingTerminated . . . . 287SystemExceptions.ProcessTerminated . . . . . . . . . 288SystemExceptions.ReadOnlyObject . . . . . . . . . . . 288SystemExceptions.SecurityError . . . . . . . . . . . . . . . 288SystemExceptions.ShouldNotImplement . . . . . . . 289SystemExceptions.SubclassResponsibility . . . . . . 289SystemExceptions.UnhandledException . . . . . . . 289SystemExceptions.UserInterrupt . . . . . . . . . . . . . . 290SystemExceptions.VerificationError . . . . . . . . . . . 290SystemExceptions.VMError . . . . . . . . . . . . . . . . . . . 290SystemExceptions.WrongArgumentCount . . . . . 290SystemExceptions.WrongClass . . . . . . . . . . . . . . . . 291SystemExceptions.WrongMessageSent . . . . . . . . . 291
TTextCollector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293True . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
UUndefinedObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297UnicodeCharacter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300UnicodeString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
VValueAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302ValueHolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302VariableBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303VersionableObjectProxy . . . . . . . . . . . . . . . . . . . . . . 304VFS.ArchiveFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304VFS.ArchiveMember . . . . . . . . . . . . . . . . . . . . . . . . . . 306VFS.FileWrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308VFS.StoredZipMember . . . . . . . . . . . . . . . . . . . . . . . . 311VFS.TmpFileArchiveMember . . . . . . . . . . . . . . . . . 311VFS.ZipFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
WWarning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312WeakArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312WeakIdentitySet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314WeakKeyDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . 314WeakKeyIdentityDictionary . . . . . . . . . . . . . . . . . . . 314WeakSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315WeakValueIdentityDictionary . . . . . . . . . . . . . . . . . 315WeakValueLookupTable . . . . . . . . . . . . . . . . . . . . . . 315WordArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316WriteStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
ZZeroDivide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
323
Method index
%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
&& . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 257, 296
** . . . 50, 114, 144, 146, 148, 150, 165, 171, 193, 224,
247, 259, 301
++ . . . . 68, 99, 100, 114, 144, 146, 148, 150, 165, 168,
169, 171, 193, 224, 247, 257, 259
,, . . . . . . . . . 14, 71, 115, 118, 123, 162, 267, 269, 308
–- . . . . 68, 97, 100, 114, 144, 146, 148, 150, 165, 168,
169, 171, 193, 224, 247, 257, 259-> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
/
/ . . 114, 135, 144, 146, 148, 150, 165, 171, 193, 224,247, 259, 271
// . . . . . . . . . . . . . . . 150, 165, 171, 194, 224, 248, 259
<< . . . . . 51, 53, 99, 101, 144, 146, 148, 151, 167, 174,
176, 225, 248, 258, 260, 296<< . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
<= . . . 51, 53, 145, 146, 148, 151, 167, 176, 225, 248,258, 260
== . . 17, 19, 30, 37, 43, 50, 53, 61, 67, 74, 77, 80, 88, 92,
99, 101, 104, 109, 116, 122, 137, 145, 147, 148, 151,156, 162, 164, 167, 174, 176, 186, 190, 199, 225,240, 247, 248, 257, 260, 269, 276, 296, 307, 309
== . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199, 260=~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
>> . . . . 51, 53, 145, 147, 148, 151, 167, 176, 225, 248,
258, 260
>= . . . 51, 53, 145, 147, 148, 151, 167, 176, 225, 248,258, 260
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
@@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
\\\ . . . . . . . . . . . . . . . . . . . . 150, 165, 171, 194, 248, 260
|| . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 119, 297
~~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274~= . . . . . . . . . . . . . . . 145, 147, 149, 168, 206, 248, 260~~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206, 260
AabbreviationOfDay: . . . . . . . . . . . . . . . . . . . . . . . . . . . 96abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210abs . . . . . . . . . . . . . . . . . . . . . . . . 114, 168, 170, 195, 225acceptUsageForClass: . . . . . . . . . . . . . . . 11, 113, 259accesses: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78, 82action: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222actions: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222activeDebugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232activeDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103activePriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232activeProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
add: . . 14, 18, 69, 105, 155, 173, 174, 177, 215, 231,314, 315
add:after: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215add:afterIndex: . . . . . . . . . . . . . . . . . . . . 215, 246, 262add:before: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215add:beforeIndex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215add:withOccurrences: . . . . . . . . . . . . . . . . . . . . . . . . 18addAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 105, 216addAll:after: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216addAll:afterIndex: . . . . . . . . . . . . . . . . 216, 246, 262addAll:before: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216addAll:beforeIndex: . . . . . . . . . . . . . . . . . . . . . . . . 216addAllFirst: . . . . . . . . . . . . . . . . . . . . . . . 216, 246, 262addAllLast: . . . . . . . . . . . . . . . . . . . . . . . . 216, 246, 262
324 GNU Smalltalk Library Reference
addBuiltFile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217addCallout: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217addClassVarName: . . . . . . . . . . . . . . . . . . . . . . . . 57, 182addClassVarName:value: . . . . . . . . . . . . . . . . . . . . . . 57addDays: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97addDependent: . . . . . . . . . . . . . . . . . . . . . . . . . . . 204, 299addFeature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217, 280addFile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217addFileIn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217addFirst: . . . . . . . . . . . . . . . . . . . . . . 173, 216, 246, 262addInstVarName: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24addLast: . . . . . . . . . . . . . . . . . . . . . . . 173, 216, 246, 262addLibrary: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112, 217addLibraryHandle: . . . . . . . . . . . . . . . . . . . . . . . . . . . 112addModule: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112, 217addPermission: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249addPrerequisite: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66address: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66, 93addressAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68addressOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 210addressOfOOP: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210addSeconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296addSelector:withMethod: . . . . . . . . . . . . . . . . . . . . . 24addSharedPool: . . . . . . . . . . . . . . . . . . . . 8, 57, 64, 182addSubclass: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23addSubspace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9addSunitScript: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218addTime: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296addToBeFinalized . . . . . . . . . . . . . . . . . . . . . . . 129, 205after: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
alignof . . 42, 43, 46, 47, 48, 57, 64, 65, 87, 89, 90,92, 93, 94, 95
alignTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159aliveObjectsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132allAssociations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8allBehaviorsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8allBlocksDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79allButFirst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251allButFirst: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251allButLast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251allButLast: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251allClassesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8allClassObjectsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8allClassVarNames . . . . . . . . . . . . . . . . . . . . . 19, 57, 182allExceptionsDo: . . . . . . . . . . . . . . . . . . . . . . . 116, 118allFilesMatching:do: . . . . . . . . . . . . . . . . . . . 111, 132allInstances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19allInstancesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23allInstVarNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19allLiterals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79allLiteralsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77allLiteralSymbolsDo: . . . . . . . . . . . . . . . . . . . . . . . . 77allMask: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158allMetaclassesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8alloc: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66alloc:type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
allOccurrencesOfRegex: . . . . . . . . . . . . . . . . . . . . . 271allOccurrencesOfRegex:do: . . . . . . . . . . . . . . . . . . 271allOccurrencesOfRegex:from:to: . . . . . . . . . . . . 271allOccurrencesOfRegex:from:to:do: . . . . . . . . 272allocFailures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212allocMatches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212allocProbes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212allocSplits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212allow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222allowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222allowing:target:action: . . . . . . . . . . . . . . . . . . . . 221allowing:target:actions: . . . . . . . . . . . . . . . . . . . 221allOwners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199allSatisfy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162allSelectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20allSharedPoolDictionaries . . . . . . . . . . . . . . . . . . . 19allSharedPoolDictionariesDo: . . . . . . . 27, 61, 182allSharedPools . . . . . . . . . . . . . . . . . . . . . . . . . . . 20, 183allSubassociationsDo: . . . . . . . . . . . . . . . . . . . . . . . . 9allSubclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 298allSubclassesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23allSubinstancesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . 23allSubspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9allSubspacesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9allSuperclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19allSuperclassesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . 23allSuperspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107allSuperspacesDo: . . . . . . . . . . . . . . . . . . . . . . . . 9, 107amountToTranslateWithin: . . . . . . . . . . . . . . . . . . . 240and: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296anyMask: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158anyOne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71, 255anySatisfy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124append:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110, 130arcCos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 195arcCosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306archive: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307arcSin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 195arcSinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195arcTan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196, 225arcTan: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196arcTanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240areasOutside: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180argumentCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180, 279arguments: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180arguments:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279arguments:do:ifError: . . . . . . . . . . . . . . . . . . . . . . 279arithmeticError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195arrayType: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92article . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 60asAbsolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103asArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70, 243, 313asBag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70asByteArray . . . . . . . . . . . . . . . . . . . . . . . . . . 54, 70, 271
Method index 325
asByteArray: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46asCBooleanValue . . . . . . . . . . . . . . . . . . . . . 37, 119, 297asCData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 270asCData: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 270asCharacter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 158asciiValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50asciiValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49asClass . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 61, 62, 184asClassPoolKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54asCNumber . . . . . . . . . . . . 142, 150, 167, 194, 248, 261asDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101asExactFraction . . . . . . . . . . . . . . . . . . . . 141, 151, 194asFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132, 271asFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 194
asFloatD . . . 145, 147, 149, 151, 168, 169, 194, 248,260
asFloatE . . . 145, 147, 149, 151, 168, 169, 194, 248,260
asFloatQ . . . 145, 147, 149, 151, 168, 169, 194, 248,260
asFraction . . . . . . . . . . . . . . . . 141, 151, 158, 194, 248asGlobalKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54asInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 54, 199asLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101asLowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 54asMetaclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62asMilliseconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295asNanoseconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295asNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54, 195asObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167, 260asObjectNoFail . . . . . . . . . . . . . . . . . . . . . . . . . 167, 260asOop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200asOrderedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . 70asPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197, 225asPoolKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54asRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195, 225asRegex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243, 272asRunArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70asScaledDecimal: . . . . . . . . . . . . . . . . . . . . . . . 158, 195asScaledDecimal:radix:scale: . . . . . . . . . . . . . . 195asSeconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98, 100, 295asSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18, 70assigns: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78, 82associationAt: . . . . . . . . . . . . . . . . . . . . . . . . . 105, 231associationAt:ifAbsent: . . . . . . 105, 174, 187, 231associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105associationsDo: . . . . . . . . . . . . . . . . . . . . 106, 175, 187asSortedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . 70asSortedCollection: . . . . . . . . . . . . . . . . . . . . . . . . . . 70
asString . . . . 38, 46, 51, 54, 70, 121, 135, 136, 189,195, 243, 271, 276, 301, 306, 309
asString: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46asSymbol . . . . . . . . . . . . . . . . . . . . 51, 54, 271, 276, 301asTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101asUnicodeString . . . . . . . . . . . . . . . 38, 51, 54, 70, 302asUppercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 54asUTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101asValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
asyncCall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44asyncCallNoRetryFrom: . . . . . . . . . . . . . . . . . . . . . . . 45asyncCCall:numArgs:attributes: . . . . . . . . . . . . . 78
at: . . 68, 83, 101, 105, 121, 131, 155, 161, 164, 166,171, 172, 177, 178, 200, 215, 231, 243, 245, 261,
270, 305, 307, 309, 313
at:ifAbsent: . . . . . . 12, 38, 105, 174, 187, 231, 251,270, 301, 316
at:ifAbsentPut: . . . . . . . . . . . . . . . . . . . . . . . . 105, 231at:ifPresent: . . . . . . . . . . . . 106, 175, 187, 231, 316
at:put: . . . . 30, 68, 75, 83, 106, 155, 161, 164, 166,172, 175, 177, 178, 185, 200, 215, 231, 242, 245,
261, 262, 270, 313, 314at:put:type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67at:type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67atAll: . . . . . . . . . . . . . . . . . . . . . . . . . . 14, 106, 177, 251atAll:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251, 313atAllPut: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251, 313atEnd . . . . . . . . . . . . 129, 140, 152, 210, 228, 236, 268atRandom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252attributeAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80attributeAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . 80attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80attributesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Bbackspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49backtrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83, 86, 279backtraceOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83, 86badReturnError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208baseDirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218baseDirectories: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218basicAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200, 261, 270basicAt:put: . . . . . . . . . . . . . . . . . . . . . . . 200, 261, 270basicAtEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228basicBacktrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278basicLeftShift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167basicMessageText . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116basicNew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22basicNew: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22basicNewInFixedSpace . . . . . . . . . . . . . . . . . . . . . . . . 21basicNewInFixedSpace: . . . . . . . . . . . . . . . . . . . . . . . 21basicPosition: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228basicPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200basicPrintNl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205basicPrintOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205basicRightShift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167basicSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200become: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200becomeForward: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200beConsistent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71, 263before: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252bell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49between:and: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176, 236bigEndian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178bigObjectThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . 211bigObjectThreshold: . . . . . . . . . . . . . . . . . . . . . . . . 211
326 GNU Smalltalk Library Reference
binaryRepresentationObject . . . . 74, 82, 206, 303binaryRepresentationVersion . . . . . . . . . . . . . . . . 61binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62bindingFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57bindWith: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55bindWith:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55bindWith:with:with: . . . . . . . . . . . . . . . . . . . . . . . . . . 55bindWith:with:with:with: . . . . . . . . . . . . . . . . . . . . 55bindWithArguments: . . . . . . . . . . . . . . . . . . . . . . . . . . . 55binomial: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159bitAnd: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 260bitAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158, 166bitAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158bitClear: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158bitInvert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158, 166bitOr: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 260bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259bitShift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 260bitXor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 260block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 45block: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 32, 45block:receiver: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31block:receiver:outerContext: . . . . . . . . . . . . . . . 31blockAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75bottom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottomCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottomLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottomLeft: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottomRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238bottomRight: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238broadcast: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203broadcast:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203broadcast:with:with: . . . . . . . . . . . . . . . . . . . . . . . 203broadcast:withArguments: . . . . . . . . . . . . . . . . . . . 203broadcast:withBlock: . . . . . . . . . . . . . . . . . . . . . . . 203bufferSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139bufferSize: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139bufferStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138builtFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218builtFilesFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220byteAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 269byteAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 269bytecodeAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76bytecodeAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76byteCodeCounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278bytecodeInfoTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75bytes:from:compare: . . . . . . . . . . . . . . . . . . . . . . . . 169bytes:from:subtract: . . . . . . . . . . . . . . . . . . . . . . . 169bytes:multiply: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169bytesLeftShift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169bytesLeftShift:big: . . . . . . . . . . . . . . . . . . . . . . . . 169bytesLeftShift:n: . . . . . . . . . . . . . . . . . . . . . . . . . . . 169bytesPerOOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212bytesPerOTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212bytesRightShift:big: . . . . . . . . . . . . . . . . . . . . . . . 169bytesRightShift:n: . . . . . . . . . . . . . . . . . . . . . . . . . . 170bytesTrailingZeros: . . . . . . . . . . . . . . . . . . . . . . . . 170
CcallCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87caller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35callInto: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45callNoRetryFrom:into: . . . . . . . . . . . . . . . . . . . . . . . 45callouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218calloutsFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220canCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191canLoad: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221canRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125canUnderstand: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28canWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72, 156castTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 67categoriesFor:are: . . . . . . . . . . . . . . . . . . . . . . . . . . . 59category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 183, 185category: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 185cCall:numArgs:attributes: . . . . . . . . . . . . . . . . . . . 78ceiling . . . . . . . . . . . . . . . . . . . . . . . . 141, 150, 158, 248ceilingLog: . . . . . . . . . . . . . . . . . . . . . . . . 143, 159, 196center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238centralDirectoryRangeIn: . . . . . . . . . . . . . . . . . . . 312changeClassTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200changed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203changed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203, 212charAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 178charAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 178check: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61, 249check:for: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222checkError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120, 126checkError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120checkIndexableBounds: . . . . . . . . . . . . . . . . . . . . . . 200checkIndexableBounds:ifAbsent: . . . . . . . . . . . . 200checkIndexableBounds:put: . . . . . . . . . . . . . . . . . . 200checkSecurityFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86checkTagIfInPath: . . . . . . . . . . . . . . . . . . . . . . . . . . . 219chiSquare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237chiSquare:range: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17, 200class:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17class:in:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17class:in:loader: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17class:loader: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17classAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8classAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8classify:under: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63classPool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20, 57, 183classPragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46, 58classVariableString . . . . . . . . . . . . . . . . . . . . . . . . . . 64classVarNames . . . . . . . . . . . . . . . . . . . . . . . . 20, 58, 183clean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139clearBit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158clearGCFlag: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83clockPrecision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126, 226, 267closeTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Method index 327
cObjectBinding: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92cObjectType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92cObjectType: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
cObjStoredType . . 44, 46, 47, 48, 57, 64, 65, 88, 89,90, 91, 93, 94, 95
codePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50codePoint: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
coerce: . . . . 144, 145, 146, 147, 148, 149, 150, 157,158, 167, 193, 195, 248
collect: . . . . . . . . . . . 15, 71, 106, 161, 162, 177, 267collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283collection: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283collection:map: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 183comment: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58compact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211compile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24compile:classified: . . . . . . . . . . . . . . . . . . . . . . . . . . 62compile:classified:ifError: . . . . . . . . . . . . . . . . 62compile:classified:notifying: . . . . . . . . . . . . . . 62compile:ifError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25compile:notifying: . . . . . . . . . . . . . . . . . . . . . . . . . . . 25compileAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25compileAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25compileAllSubclasses . . . . . . . . . . . . . . . . . . . . . . . . 25compileAllSubclasses: . . . . . . . . . . . . . . . . . . . . . . . 25compiledMethodAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20compiledMethodAt:ifAbsent: . . . . . . . . . . . . . . . . . . 20compilerClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22compileSize:align: . . . . . . . . . . . . . . . . . . . . . . . . . . . 46compress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164computeAggregateType: . . . . . . . . . . . . . . . . . . . . . . . 92conform: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162construct: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191contains: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162, 240containsLiteral: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78containsPoint: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241contents . . . . 126, 134, 177, 191, 226, 237, 263, 317context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117, 229continue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85contractTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
convertFromVersion:withFixedVariables:
indexedVariables:for: . . . . . . . . . . . . . . . . . . . . . 61copy . . . . . . . . . . . . . . . . . . . . 30, 34, 204, 239, 242, 297copy:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62copy:from:classified: . . . . . . . . . . . . . . . . . . . . . . . 62copyAfter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254copyAfterLast: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254copyAll:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62copyAll:from:classified: . . . . . . . . . . . . . . . . . . . . 62copyAllCategoriesFrom: . . . . . . . . . . . . . . . . . . . . . . 62copyCategory:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . 62copyCategory:from:classified: . . . . . . . . . . . . . . 62copyEmpty: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 30, 262copyEmptyForCollect . . . . . . . . . . . . . . . . . . . . . . . . . . 30copyEmptyForCollect: . . . . . . . . . . . . . . . . . . . . . . . . 30copyFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254copyFrom:to: . . 14, 126, 136, 138, 161, 177, 226, 254
copyFrom:to:replacingAllRegex:with: . . . . . . 272copyFrom:to:replacingRegex:with: . . . . . . . . . 272copyReplaceAll:with: . . . . . . . . . . . . . . . . . . . . 14, 254copyReplaceFrom:to:with: . . . . . . . . . . . . . . . 14, 254copyReplaceFrom:to:withObject: . . . . . . . . 15, 254copyReplacing:withObject: . . . . . . . . . . . . . . . . . . . 70copyReplacingAllRegex:with: . . . . . . . . . . . . . . . 272copyReplacingRegex:with: . . . . . . . . . . . . . . . . . . . 272copyStack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85copyUpTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254copyUpToLast: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255copyWith: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14, 70copyWithFirst: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255copyWithout: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14, 70copyWithoutAuxiliaryParts . . . . . . . . . . . . . . . . . . 191copyWithoutFragment . . . . . . . . . . . . . . . . . . . . . . . . 191corner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238corner: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225, 238cos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196cosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196costOfNewIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165count: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162cr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49, 266, 292create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124create: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111createDirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . 132createDirectory . . . . . . . . . . . . . . . . . . . . . . . . 122, 132createDirectory: . . . . . . . . . . . . . . . . . . . . . . . 307, 312createGetMethod: . . . . . . . . . . . . . . . . . . . . . . . . . 25, 63createGetMethod:default: . . . . . . . . . . . . . . . . 25, 63createSetMethod: . . . . . . . . . . . . . . . . . . . . . . . . . 25, 63createTemporary: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111creationTime . . . . . . . . . . . . . . . . . . 121, 131, 306, 309critical: . . . . . . . . . . . . . . . . . . . . . . . . . . 242, 251, 292crTab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266cull: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32cull:cull: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32cull:cull:cull: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86, 186, 210current: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186currentDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86currentFileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83currentLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85currentLineInFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Ddate:time: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100date:time:offset: . . . . . . . . . . . . . . . . . . . . . . . . . . . 100dateAndTimeNow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97dayName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97dayOfMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98dayOfWeek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98, 100dayOfWeek: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96dayOfWeekAbbreviation . . . . . . . . . . . . . . . . . . . . . . . 98dayOfWeekName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98dayOfYear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
328 GNU Smalltalk Library Reference
days: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113days:hours:minutes:seconds: . . . . . . . . . . . . . . . 113daysFromBaseDay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98daysInMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98daysInMonth:forYear: . . . . . . . . . . . . . . . . . . . . . . . . 96daysInYear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98daysInYear: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96daysLeftInMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98daysLeftInYear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85, 229debuggerClass . . . . . . . . . . . . . . . . . . . . . . . . 26, 85, 183decimalDigits . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46declaration: . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 91, 95declaration:inject:into: . . . . . . . . . . . . . . . . . . . . 47declarationTrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278declarationTrace: . . . . . . . . . . . . . . . . . . . . . . . . . . . 278decode: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188decodedFields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189decodedFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189decodedFragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189decompile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25decompilerClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26decr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68decrBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
deepCopy . . . . 30, 34, 37, 77, 85, 155, 195, 204, 246,275, 297, 313, 315
defaultAction . . . . . . . . . . . . . . . . . . . . . . 116, 192, 289defaultElement . . . . . . . . . . . . . . . . . . . . . . . . . 165, 170defaultEncoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301defaultSortBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262define: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
defineAsyncCFunc:
withSelectorArgs:args: . . . . . . . . . . . . . . . . 25, 63defineCFunc:as: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
defineCFunc:withSelectorArgs:
returning:args: . . . . . . . . . . . . . . . . . . . . . . . . 25, 63definedKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107defineExternFunc: . . . . . . . . . . . . . . . . . . . . . . . . . . . 112definesKey: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108degreesToRadians . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195delayDuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103denominator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150, 157denormalized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140deny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222denying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222denying:target:action: . . . . . . . . . . . . . . . . . . . . . 222denying:target:actions: . . . . . . . . . . . . . . . . . . . . 222dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199dependencies: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199dependents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204deref: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
description . . . . . . 12, 115, 116, 154, 181, 192, 280,281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
291, 312, 317detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42, 230detect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
detect:ifNone: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163digitAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158, 166digitAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166digitLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166digitValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51digitValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50dir:tag: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133, 218directoryFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220disableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 233disableProxyFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209discardTranslation . . . . . . . . . . . . . . . . . . . . . . . . . . . 78dispatchTo:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205display: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268displayLines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71displayNl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
displayOn: . . 51, 135, 159, 206, 243, 249, 271, 276,302, 306, 308
displayString . . . . . . . . . . . . 159, 206, 243, 271, 276dist: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225divExact: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 260divide:using: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170dividend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317dividend: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
do: . . . . . 18, 106, 132, 155, 161, 163, 172, 173, 175,177, 187, 216, 246, 255, 266, 277, 313, 315
do:separatedBy: . . . . . . . . . . . . . . . . . . . . . . . . 163, 255doesNotUnderstand: . . . . . . . . . . . . . . . . . . 17, 29, 205domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177doSecurityCheckForName:actions:target: . . . . 86dotProduct: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225doubleAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178doubleAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178doWithIndex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255dump: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210dump:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209dumpTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113, 192, 304
Ee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 146, 148edenSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212edenUsedBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212edit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25elementType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42, 88, 91elementType: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43, 88elementType:numberOfElements: . . . . . . . . . . . . . . 43emax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148emin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148emitFieldNameTo:for: . . . . . . . . . . . . . . . . . . . . . . . . 47empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72emptyStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317enableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233encode: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188encoding . . . . . . . . . . . . . . . . . . . . . . . . 55, 266, 271, 302endEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Method index 329
endsWith: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253ensure: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34ensureReadable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125ensureWriteable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126entity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132entryNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132environ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278environment . . . . . . 16, 27, 29, 58, 83, 156, 183, 235environment: . . . . . . . . . . . . . . . . . . . . . . 16, 30, 58, 156eof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49eot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49epsilon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140eqv: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296errno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120error: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205errorValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236esc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49escapeDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86escapeRegex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274estimatedLog . . . . . . . . . . . . . 143, 150, 159, 166, 196evalString:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23evalString:to:ifError: . . . . . . . . . . . . . . . . . . . . . . 23evaluate: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24evaluate:ifError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24evaluate:notifying: . . . . . . . . . . . . . . . . . . . . . . . . . . 24evaluate:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24evaluate:to:ifError: . . . . . . . . . . . . . . . . . . . . . . . . 24evaluatorClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26even . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 198examine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204examineOn: . . . . . . . . . . . . . . 47, 71, 77, 108, 204, 257example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209exceptionalCondition . . . . . . . . . . . . . . . . . . . . . . . 126execPrefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111executable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121executionTrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278executionTrace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278exists . . . . . . . . . . . . . . . . . . . . . . . . . 123, 135, 308, 310exists: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196expandBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145, 147, 149extend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133extensionFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130extent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238extent: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225, 238externalInterruptsEnabled . . . . . . . . . . . . . . . . . . 228extracted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311extractMember: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306extractMember:into: . . . . . . . . . . . . . . . . . . . . 306, 312
Ffactorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159failedPermission . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289failedPermission: . . . . . . . . . . . . . . . . . . . . . . . . . . . 289fd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218featuresFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220ff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50fieldSelectorList . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47file . . . . . . . . . . . . . . . . . . . . . . . . . . . 126, 136, 263, 311fileData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312fileIn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128, 134, 265fileIn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137fileIn:ifMissing: . . . . . . . . . . . . . . . . . . . . . . . . . . . 137fileIn:ifTrue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137fileIn:line:from:at: . . . . . . . . . . . . . . . . . . . . . . . 138fileInLine:file:at: . . . . . . . . . . . . . . . . . . . . . . . . 265fileInLine:fileName:at: . . . . . . . . . . . . . . . . . . . . 265fileInPackage: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221fileInPackages: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221fileIns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218fileInsFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220fileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54, 136fileOp: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128fileOp:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128fileOp:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128fileOp:with:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . 128fileOp:with:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . 128fileOp:with:with:ifFail: . . . . . . . . . . . . . . . . . . . 128fileOp:with:with:with: . . . . . . . . . . . . . . . . . . . . . 128fileOp:with:with:with:ifFail: . . . . . . . . . . . . . 128fileOp:with:with:with:with: . . . . . . . . . . . . . . . 128fileOp:with:with:with:with:ifFail: . . . . . . . 128fileOut: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 266fileOutCategory:to: . . . . . . . . . . . . . . . . . . . . . . . . . . 63fileOutCategory:toStream: . . . . . . . . . . . . . . . . . . . 64fileOutDeclarationOn: . . . . . . . . . . . . . . . . . . . . . . . 58fileOutHeaderOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61fileOutOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 63, 183fileOutSelector:to: . . . . . . . . . . . . . . . . . . . . . . . . . . 63fileOutSelector:toStream: . . . . . . . . . . . . . . . . . . . 64filePos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54, 136files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132, 218filesFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220filesMatching: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132filesMatching:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . 133fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139fillFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307fillMember: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305finalIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32finalizableObjects . . . . . . . . . . . . . . . . . . . . . . . . . . 199finalize . . . . . . . . . . . . . . . . . . . . . . . . 67, 126, 205, 229findFirst: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255findKeyIndex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106findLast: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255findObjectIndex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258finishIncrementalGC . . . . . . . . . . . . . . . . . . . . . . . . 211first . . . . . . . . . . . . . . . . . . . . . . 161, 173, 215, 246, 252
330 GNU Smalltalk Library Reference
first: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252firstDayOfMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98fixedSpaceSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213fixedSpaceUsedBytes . . . . . . . . . . . . . . . . . . . . . . . . 213fixTemps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73, 76, 79floatAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178floatAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178floor . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 150, 158, 199floorLog: . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 159, 196flush . . . . . . . . . . . . . . . . . . . . . . . . . . 139, 210, 220, 267flushCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21flushTranslatorCache . . . . . . . . . . . . . . . . . . . . . . . . 75fmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148fmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140fminDenormalized . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140fminNormalized . . . . . . . . . . . . . . . . . . . . . 144, 146, 148fold: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163, 255fopen:mode: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124fopen:mode:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . . . 124for: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235for:returning:withArgs: . . . . . . . . . . . . . . 44, 45, 48fork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 110forkAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 110forkWithoutPreemption . . . . . . . . . . . . . . . . . . . . . . . 34formattedSourceStringAt: . . . . . . . . . . . . . . . . . . . . 20formattedSourceStringAt:ifAbsent: . . . . . . . . . 27forMilliseconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103forMutualExclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 250forNanoseconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103forSeconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103fourth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252fractionPart . . . . . . . . . . . . . 145, 147, 149, 199, 248fragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189fragment: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67, 299from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243from: . . . . . . . . . . . . . . . . . . . . . . 12, 43, 69, 88, 92, 105from:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161from:to:by: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161from:to:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255from:to:doWithIndex: . . . . . . . . . . . . . . . . . . . . . . . 255from:to:keysAndValuesDo: . . . . . . . . . . . . . . . . . . . 255fromAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243fromBytes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146fromCData: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269fromCData:size: . . . . . . . . . . . . . . . . . . . . . . . . . 37, 269fromDays: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97fromDays:seconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . 100fromDays:seconds:offset: . . . . . . . . . . . . . . 100, 113fromJulian: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97fromSeconds: . . . . . . . . . . . . . . . . . . . . . . . . 97, 100, 294fromSeconds:offset: . . . . . . . . . . . . . . . . . . . . . . . . 100fromString: . . . . . . . . . . . . . . . . . . . . . 52, 189, 242, 301full . . . . . . . . . . . . . . . . . . . . . . . . . . . 122, 133, 307, 309fullName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133fullNameFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
fullPathOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218fullRequestString . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Ggather: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71gcAlloc: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66gcAlloc:type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66gcd: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 168, 169gcMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211gcMessage: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211gcNew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46, 93gcNew: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66, 93gcValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88generality . . 145, 147, 149, 150, 167, 195, 248, 261generateMakefileOnto: . . . . . . . . . . . . . . . . . . . . . . 138getArgc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278getArgv: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278getBlock:putBlock: . . . . . . . . . . . . . . . . . . . . . . . . . . 223getenv: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278getTraceFlag: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278globalGarbageCollect . . . . . . . . . . . . . . . . . . . . . . . 211goodness: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115, 118granting:target:action: . . . . . . . . . . . . . . . . . . . . 222granting:target:actions: . . . . . . . . . . . . . . . . . . . 222grid: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225group: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131growThresholdPercent . . . . . . . . . . . . . . . . . . . . . . . 211growThresholdPercent: . . . . . . . . . . . . . . . . . . . . . . 211growTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Hhalf . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 145, 147, 149halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200, 278halt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205handleDelayRequestor . . . . . . . . . . . . . . . . . . . . . . . 103handles: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115, 118hasBytecode:between:and: . . . . . . . . . . . . . . . . . . . . 78hasError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235hasFeatures: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280hasFragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
hash . . . . . . 17, 19, 30, 38, 43, 67, 77, 80, 88, 92, 99,101, 104, 109, 122, 137, 141, 151, 156, 157, 162,164, 166, 171, 174, 175, 186, 190, 201, 225, 241,247, 248, 257, 270, 276, 278, 296, 301, 307, 309
hasInterned:ifTrue: . . . . . . . . . . . . . . . . . . . . . . . . 275hasMethodReturn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34hasMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28hasPostData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189hasPostData: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189hasProxyFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209hasQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191hasValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238height: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239hereAssociationAt: . . . . . . . . . . . . . . . . . . . . . . . . . . 108hereAssociationAt:ifAbsent: . . . . . . . . . . . . . . . 108
Method index 331
hereAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108hereAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108hierarchyIndent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281high: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281highBit . . . . . . . . . . . . . . . . . . . . . . . . 158, 168, 169, 259highestPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233highIOPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233home . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 83, 111, 184host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190host: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190hostSystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279hour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100, 295hour: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294hour:minute:second: . . . . . . . . . . . . . . . . . . . . . . . . 294hour12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100, 295hour24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100, 295hours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295hours: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295hours:minutes:seconds: . . . . . . . . . . . . . . . . . . . . . 295
IidentityHash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201identityIncludes: . . . . . . . . . 72, 157, 173, 252, 314identityIndexOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252identityIndexOf:ifAbsent: . . . . . . . . . . . . . . . . . . 252identityIndexOf:startingAt: . . . . . . . . . . . . . . . 252identityIndexOf:startingAt:ifAbsent: . . . . . 252identityIndexOfLast:ifAbsent: . . . . . . . . . . . . . 252identityRemove: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216identityRemove:ifAbsent: . . . . . . . . . . . . . . . . . . . 216idle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233idleAdd: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233idlePriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233ifCurtailed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34ifError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33ifFalse: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296ifFalse:ifTrue: . . . . . . . . . . . . . . . . . . . . . 36, 119, 296ifMatched: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244ifMatched:ifNotMatched: . . . . . . . . . . . . . . . . . . . . 244ifNil: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207, 300ifNil:ifNotNil: . . . . . . . . . . . . . . . . . . . . . . . . 207, 300ifNil:ifNotNilDo: . . . . . . . . . . . . . . . . . . . . . . 163, 299ifNotMatched: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244ifNotMatched:ifMatched: . . . . . . . . . . . . . . . . . . . . 244ifNotNil: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207, 300ifNotNil:ifNil: . . . . . . . . . . . . . . . . . . . . . . . . 207, 300ifNotNilDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163, 299ifNotNilDo:ifNil: . . . . . . . . . . . . . . . . . . . . . . 163, 299ifTrue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296ifTrue:ifFalse: . . . . . . . . . . . . . . . . . . . . . 36, 119, 296ignoreCallouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220ignoreCallouts: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111, 121imageLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280implementors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275implies: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222, 249
import: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 64import:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30includes: . . . . . 19, 72, 107, 131, 156, 173, 252, 263includesAllOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72includesAnyOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72includesAssociation: . . . . . . . . . . . . . . . . . . . . . . . 107includesBehavior: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28includesClassNamed: . . . . . . . . . . . . . . . . . . . . . . . . . . . 9includesGlobalNamed: . . . . . . . . . . . . . . . . . . . . . . . . . . 9includesKey: . . . . . . . . . . . . . . . . . . 107, 187, 231, 316includesSelector: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28incr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68incrBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68increment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161incrementalGCStep . . . . . . . . . . . . . . . . . . . . . . . . . . . 211indexOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252indexOf:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . . . 252indexOf:matchCase:startingAt: . . . . . . . . . . . . . . 53indexOf:startingAt: . . . . . . . . . . . . . . . . 37, 252, 269
indexOf:startingAt:ifAbsent: . . . . . 37, 247, 252,263, 270
indexOfInstVar: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20indexOfInstVar:ifAbsent: . . . . . . . . . . . . . . . . . . . . 20indexOfLast:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . 252indexOfMonth: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96indexOfRegex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272indexOfRegex:from:to: . . . . . . . . . . . . . . . . . . . . . . 272indexOfRegex:from:to:ifAbsent: . . . . . . . . . . . . 272indexOfRegex:ifAbsent: . . . . . . . . . . . . . . . . . . . . . 272indexOfRegex:startingAt: . . . . . . . . . . . . . . . . . . . 272indexOfRegex:startingAt:ifAbsent: . . . . . . . . 273indexOfSubCollection: . . . . . . . . . . . . . . . . . . . . . . 253indexOfSubCollection:ifAbsent: . . . . . . . . . . . . 253indexOfSubCollection:startingAt: . . . . . . . . . 253
indexOfSubCollection:
startingAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . 253infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148inheritedKeys . . . . . . . . . . . . . . . . . . . . . . . 10, 186, 245inheritsFrom: . . . . . . . . . . . . . . . . . . . . . . . 28, 108, 300inheritShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 66initDayNameDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96initForNanoseconds: . . . . . . . . . . . . . . . . . . . . . . . . 104initialIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 83
initialize . . . 50, 57, 58, 92, 96, 99, 112, 113, 120,123, 129, 138, 139, 149, 186, 188, 191, 199, 212,
233, 236, 277, 288, 294, 303, 308initializeAsRootClass . . . . . . . . . . . . . . . . . . . . . . . 58initMonthNameDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96initUntilNanoseconds: . . . . . . . . . . . . . . . . . . . . . . 104inject:into: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152, 163insetBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240insetOriginBy:corner: . . . . . . . . . . . . . . . . . . . . . . 240inspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204instanceClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182instanceCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20instanceVariableNames: . . . . . . . . . . . . . . . . . . . . . . 24instanceVariableString . . . . . . . . . . . . . . . . . . . . . . 64instSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 298
332 GNU Smalltalk Library Reference
instVarAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201instVarAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201instVarNamed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205instVarNamed:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . 205instVarNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20intAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178intAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 178integerPart . . . . . . . . . . . . . . . . . . . 141, 151, 199, 248intern: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274internCharacter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274intersect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240intersects: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241intervalAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243invalidate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126ip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83ip: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83isAbsolute . . . . . . . . . . . . 67, 103, 123, 135, 308, 310isAbsolute: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130isAbstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82isAccessible . . . . . . . . . . . . . 123, 135, 305, 308, 310isAccessible: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121isActive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104isAlive: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313isAllowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222isAlphaNumeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isAnnotated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76, 80isArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13, 207isBehavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 207isBinary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128isBits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28isBitSet: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158isBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 83, 184isCharacter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52, 207isCharacterArray . . . . . . . . . . . . . . . . . . . . . . . . 56, 207isClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61, 207isCObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68, 207isDefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304isDigit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isDigit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isDirectory . . . . . . . . . . . . . . . 121, 135, 305, 308, 310isDisabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 84, 184isEmpty . . . . . . . . . . . 72, 129, 156, 161, 173, 228, 258isEnvironment . . . . . . . . . . . . . . . . . . . . . . . . 35, 84, 184isExact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 162, 198isExecutable . . . . . . . . . . . . . . . . . . 123, 135, 308, 309isExecutable: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121isExternalStream . . . . . . . . . . . . . . . . . . 128, 227, 268isFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135isFileScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191isFileSystemPath . . . . . . . . . . . . . . . . . . . . . . . 123, 135isFinite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 198isFixed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28isFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 208isFragmentOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191isFunction: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48isIdentity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 36, 259isImmediate . . . . . . . . . . . . . . . . . . . 28, 31, 36, 50, 193isInfinite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 198
isInPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219isInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160, 208
isInternalExceptionHandlingContext . . . . 36, 85,184
isKindOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208isLeapYear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98isLetter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
isLiteralObject . . . . 12, 37, 41, 52, 142, 159, 249,271, 300, 304
isLowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isMemberOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208isMeta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208isMetaclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184, 208isMetaClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208isNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11, 208isNaN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 198isNested . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117isNil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208, 300isNull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68, 300isNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198, 208isNumeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54isOldSyntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79isOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126isOwnerProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241isPathSeparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isPeerAlive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126isPipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126isPointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28isPositionable . . . . . . . . . . . . . . . . . . . . . 129, 228, 267isProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84isPunctuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isRational . . . . . . . . . . . . . . . . . . . . . . . . . 151, 160, 198isReadable . . . . . . . . . . . . . . . . . . . . . 123, 135, 308, 309isReadable: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121isReadOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201isRelative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135isResumable . . . . . . 12, 115, 117, 154, 181, 192, 287isSeparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isSequenceable . . . . . . . . . . . . . . . . . . . . . . 72, 257, 268isSimpleSymbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276isSmall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170isSmallInteger . . . . . . . . . . . . . . . . . . . . . . . . . 208, 261isSmalltalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11, 280isSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121isString . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208, 274, 277isSymbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208, 277isSymbolicLink . . . . . . . . . . . . . . . . 121, 135, 308, 310isSymbolString: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275isText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128isTimeoutProgrammed . . . . . . . . . . . . . . . . . . . . . . . . 234isUnicode . . . . . . . . . . . 53, 55, 69, 162, 266, 269, 301isUntrusted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201isUnwind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 84, 184isUppercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52isValid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44isValidCCall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81isVariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28isVowel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Method index 333
isWriteable . . . . . . . . . . . . . . . . . . . 123, 135, 308, 309isWriteable: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121isZero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Jjoin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70join: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13, 69, 253join:separatedBy: . . . . . . . . . . . . . . . . . . . . . . . 13, 251jumpDestinationAt:forward: . . . . . . . . . . . . . . . . . . 78
Kkernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174key: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174, 234key:class:defaultDictionary: . . . . . . . . . . . . . . 102key:value: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16key:value:environment: . . . . . . . . . . . . . . . . . . . . . 156keyAtValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106keyAtValue:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . 106keys . . . . . . . . . . . . . . . . . . . . . . . . . . . 106, 177, 231, 256keysAndValuesDo: . . . . . . . . . 106, 175, 177, 187, 256keysDo: . . . . . . . . . . . . . . . . . . . . . . . . 106, 175, 177, 187keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275kindOfSubclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
LlargeNegated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167largest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259last . . . . . . . . . . . . . . . . . . 161, 173, 215, 246, 253, 262last: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253lastAccessTime . . . . . . . . . . . . . . . . 121, 131, 306, 309lastAccessTime: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131lastAccessTime:lastModifyTime: . . 122, 131, 309lastChangeTime . . . . . . . . . . . . . . . . 121, 131, 306, 309lastDayOfMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98lastModifyTime . . . . . . . . . . . . . . . . 121, 131, 306, 310lastModifyTime: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131lcm: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239left: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239left:right:top:bottom: . . . . . . . . . . . . . . . . . . . . . 238left:top:right:bottom: . . . . . . . . . . . . . . . . 238, 239leftCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239lf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50libexec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218librariesFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220libraryList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112lineDelimiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56, 267linesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56, 266link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45, 49literalAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76literalAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76literalEquals: . . . . . . . . . . . . . 14, 70, 142, 204, 303
literalHash . . . . . . . . . . . . . . . . . 14, 70, 142, 204, 303literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
literals:numArgs:numTemps:attributes:
bytecodes:depth: . . . . . . . . . . . . . . . . . . . . . . . . . . . 79literalsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196ln10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 146, 148load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210loadFrom: . . . . . . . . . . . . . . . . . . . . . . 113, 192, 209, 304localKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 196log: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 196log10Base2 . . . . . . . . . . . . . . . . . . . . . . . . . 140, 146, 148longAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 179longAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 179longDoubleAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 179longDoubleAt:put: . . . . . . . . . . . . . . . . . . . . . . . 39, 179lookupAllSelectors: . . . . . . . . . . . . . . . . . . . . . . . . . . 20lookupSelector: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281low: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281lowBit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158, 166, 259lowerPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229lowestPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233lowIOPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
MmakeEphemeron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201makeFixed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201makeReadOnly: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201makeUntrusted: . . . . . . . . . . . . . . . . . . . . . . . . . 201, 229makeWeak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184mark: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201match . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243match: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53match:ignoreCase: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54matched . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244matchInterval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243matchRegex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273matchRegex:from:to: . . . . . . . . . . . . . . . . . . . . . . . . 273max: . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 176, 194, 225member:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305member:mode: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305, 312merge: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240meridianAbbreviation . . . . . . . . . . . . . . . . . . . . . . . 101message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181, 293message: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292, 293messageText . . . . . . . . . . . . . . . 116, 283, 284, 285, 291messageText: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116metaclassFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298method . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 73, 76, 79, 84methodCategory . . . . . . . . . . . . . . . . . . . . . . . . 74, 77, 79methodCategory: . . . . . . . . . . . . . . . . . . . . . . . 74, 77, 79methodClass . . . . . . . . . . . . . . . . . . . 73, 76, 79, 84, 185
334 GNU Smalltalk Library Reference
methodClass: . . . . . . . . . . . . . . . . . . . . . . 73, 76, 79, 185methodDictionary . . . . . . . . . . . . . . . . . . . . . . . . 25, 298methodDictionary: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26methodFormattedSourceString . . . . . . . . . . . . . . . . 81methodParseNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81methodRecompilationSourceString . . . . . . . . . . . . 82methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22methodsFor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22methodsFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23methodsFor:ifFeatures: . . . . . . . . . . . . . . . . . . . . . . 22methodsFor:ifTrue: . . . . . . . . . . . . . . . . . . . . . . . . . . . 21methodsFor:stamp: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22methodSourceCode . . . . . . . . . . . . . . . . . . . . . . 74, 77, 82methodSourceFile . . . . . . . . . . . . . . . . . . . . . . 74, 77, 82methodSourcePos . . . . . . . . . . . . . . . . . . . . . . . 74, 77, 82methodSourceString . . . . . . . . . . . . . . . . . . . 74, 77, 82midnight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293millisecondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294millisecondClockValue . . . . . . . . . . . . . . . . . . . . . . 294milliseconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113millisecondsPerDay . . . . . . . . . . . . . . . . . . . . . . . . . . 294millisecondsToRun: . . . . . . . . . . . . . . . . . . . . . . . . . . 294min: . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 176, 194, 225minute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 295minute: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295minutes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295minutes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 121, 131, 308, 310mode: . . . . . . . . . . . . . . . . . . . . . . . . . . 122, 131, 308, 310module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111moduleList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218modulesFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98monthAbbreviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98monthIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98monthName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98mourn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 156, 205mourn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71moveBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241moveTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241multiBecome: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12multiply: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170mustBeBoolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Nname . . . . 10, 27, 30, 49, 58, 122, 126, 133, 183, 222,
227, 228, 241, 250, 263, 306, 309name: . . . . . . . . . . 10, 49, 120, 222, 229, 241, 250, 306name:environment:subclassOf: . . . . . . . . . . . . . . 182
name:environment:subclassOf:
instanceVariableArray:shape:classPool:
poolDictionaries:category: . . . . . . . . . . . . . . 182
name:environment:subclassOf:
instanceVariableNames:shape:
classVariableNames:poolDictionaries:
category: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
name:target:action: . . . . . . . . . . . . . . . . . . . . . . . . 222name:target:actions: . . . . . . . . . . . . . . . . . . . . . . . 222nameAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132, 305nameIn: . . . . . . . . . 10, 27, 30, 64, 183, 187, 245, 280nameOfDay: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96nameOfMonth: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96namesDo: . . . . . . . . . . . . . . . . . . 122, 133, 305, 307, 310namesMatching:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . 133namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218namespace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218nan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148nanosecondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294nanosecondClockValue . . . . . . . . . . . . . . . . . . . . . . . 294narrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67, 299negated . . . . . . . . . . . . . . . . . . . 114, 141, 151, 166, 196negative . . . . . . . . . . . . . . . . . . 114, 143, 168, 170, 198negativeInfinity . . . . . . . . . . . . . . . . . . 144, 146, 148
new . . . 8, 18, 22, 46, 66, 93, 105, 116, 118, 154, 174,177, 186, 189, 193, 209, 215, 224, 230, 232, 235,236, 238, 241, 242, 245, 250, 258, 262, 274, 285,
292, 295, 302, 303, 313, 317
new: . . . 18, 22, 66, 92, 154, 164, 186, 215, 244, 245,262, 274, 313
new:header:literals: . . . . . . . . . . . . . . . . . . . . . . . . 75new:header:method: . . . . . . . . . . . . . . . . . . . . . . . . . . . 73new:header:numLiterals: . . . . . . . . . . . . . . . . . . . . . 75new:withAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13newBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139newCollection: . . . . . . . . . . . . . . . . . . . . . 164, 165, 170newDay:month:year: . . . . . . . . . . . . . . . . . . . . . . . . . . . 97newDay:monthIndex:year: . . . . . . . . . . . . . . . . . . . . . 97newDay:year: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97newFromNumber:scale: . . . . . . . . . . . . . . . . . . . . . . . 247newInFixedSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24newInFixedSpace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
newMeta:environment:subclassOf:
instanceVariableArray:shape:classPool:
poolDictionaries:category: . . . . . . . . . . . . . . 182newPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50newProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 110newProcessWith: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34newsGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190newStruct:declaration: . . . . . . . . . . . . . . . . . . . . . . 47next . . . . . . . . 126, 138, 152, 210, 227, 236, 258, 263next: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264next:bufferAll:startingAt: . . . . . . . . . . . . . . . . 139next:into:startingAt: . . . . . . . . . . . . . . . . . . . . . . 265next:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265, 292next:putAll:startingAt: . . 129, 140, 265, 292, 317next:putAllOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265nextAvailable: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
nextAvailable:into:startingAt: . . 129, 139, 227,264
nextAvailable:putAllOn: . . . . . . . . . . 139, 227, 264nextAvailablePutAllOn: . . . . . . . . . . . . . . . . . . . . . 268nextByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126nextByteArray: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Method index 335
nextFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201nextLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 264nextLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172nextLink: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172nextLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextLongLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextMatchFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264nextPut: . . . . 126, 138, 210, 236, 258, 265, 292, 317nextPutAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265nextPutAllFlush: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265nextPutAllOn: . . . . . . . . 129, 140, 164, 228, 257, 268nextPutByte: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126nextPutByteArray: . . . . . . . . . . . . . . . . . . . . . . . . . . . 126nextPutDouble: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextPutFloat: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextPutInt64: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextPutLong: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextPutShort: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextShort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextSignedByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextUint64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextUlong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nextUshort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128nextValidOop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260nl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 266nlTab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266noMask: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158noneSatisfy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163nonVersionedInstSize . . . . . . . . . . . . . . . . . . . . . . . . 61normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225noRunnableProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . 208not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296notEmpty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73, 173noteOldSyntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79notify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250notifyAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250notNil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208, 300notYetImplemented . . . . . . . . . . . . . . . . . . . . . . . . . . . 201now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99, 295nthOuterContext: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35nul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50null . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235, 303numArgs . . . . . . . . . . . . . . . . . . . . 32, 73, 76, 79, 84, 276numArgs: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
numArgs:numTemps:bytecodes:
depth:literals: . . . . . . . . . . . . . . . . . . . . . . . . 31, 73numberOfCharacters . . . . . . . . . . . . . . . . . . . . . . 55, 302numberOfElements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43numCompactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150, 157numerator:denominator: . . . . . . . . . . . . . . . . . . . . . 149numFixedOOPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numFreeOTEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numGlobalGCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numGrowths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numLiterals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73, 76numOldOOPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
numOTEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numScavenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213numTemps . . . . . . . . . . . . . . . . . . . . . . . . 32, 73, 76, 79, 84numWeakOOPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Oobject . . . . . . . . . . . . . . . . . . . . . . . . . . 11, 113, 224, 259object: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11objectAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39objectAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39objectsAndRunLengthsDo: . . . . . . . . . . . . . . . . . . . . 246occurrencesOf: . . . . . . . . . . . . . 19, 73, 107, 156, 263occurrencesOfRegex: . . . . . . . . . . . . . . . . . . . . . . . . 273occurrencesOfRegex:from:to: . . . . . . . . . . . . . . . 273occurrencesOfRegex:startingAt: . . . . . . . . . . . . 273odd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 198offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 311offset: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 311oldSpaceSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213oldSpaceUsedBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
on: . . . . . 11, 113, 124, 152, 188, 209, 224, 226, 237,259, 309, 316
on:aspect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223on:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 152on:do:on:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33on:do:on:do:on:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . 33on:do:on:do:on:do:on:do: . . . . . . . . . . . . . . . . . . . . 33on:do:on:do:on:do:on:do:on:do: . . . . . . . . . . . . . 33on:from:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226, 237on:getSelector:putSelector: . . . . . . . . . . . . . . . 223on:index: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223on:key: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223on:startingAt:for: . . . . . . . . . . . . . . . . . . . . . . . . . . 136one . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249oneShotValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87oneShotValue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87onOccurrencesOfRegex:do: . . . . . . . . . . . . . . . . . . . 273onOccurrencesOfRegex:from:to:do: . . . . . . . . . 273open: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 134open:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134open:mode: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125open:mode:ifFail: . . . 122, 124, 134, 307, 310, 311openDescriptor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134openDescriptor:ifFail: . . . . . . . . . . . . . . . . . . . . . 134openOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188openOn:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188openStreamOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188openStreamOn:ifFail: . . . . . . . . . . . . . . . . . . . . . . . 188openTemporaryFile: . . . . . . . . . . . . . . . . . . . . . . . . . . 124or: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 119, 296origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239origin: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239origin:corner: . . . . . . . . . . . . . . . . . . . . . . . . . 238, 239origin:extent: . . . . . . . . . . . . . . . . . . . . . . . . . 238, 239originalException . . . . . . . . . . . . . . . . . . . . . . . . . . . 289originalException: . . . . . . . . . . . . . . . . . . . . . . . . . . 289outer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
336 GNU Smalltalk Library Reference
outerContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 35outerContext: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32owner: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131, 249owner:group: . . . . . . . . . . . . . . . . . . . . . . . 122, 131, 309
PpackageAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221packageAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . 221parent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133parentContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84parentContext: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84parse: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217parse:with:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153parse:with:do:ifError: . . . . . . . . . . . . . . . . . . . . . 153parseAttributes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219parseInstanceVariableString: . . . . . . . . . . . . . . . 26parseNodeAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27parserClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 81parseTreeFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21parseVariableString: . . . . . . . . . . . . . . . . . . . . . . . . 26parseVersion: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220pass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190password: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190pastEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129, 267path . . . . . . . . . . . . . . . . . . . . . . . 102, 133, 190, 219, 303path: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120, 190, 220path:class:defaultDictionary: . . . . . . . . . . . . . 102pathFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130pathFor:ifNone: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130pathFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . 122, 134, 310pathFrom:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130pathSeparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110pathSeparatorString . . . . . . . . . . . . . . . . . . . . . . . . 110pathTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122, 131, 309pause: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233peek . . . . . . . . . . . . . . . . . . 126, 139, 153, 227, 258, 267peekFor: . . . . . . . . . . . . . . . . . . . . . . . 127, 153, 227, 267pendingWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139perform: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201perform:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202perform:with:with: . . . . . . . . . . . . . . . . . . . . . . . . . . 202perform:with:with:with: . . . . . . . . . . . . . . . . . . . . 202perform:with:with:with:with: . . . . . . . . . . . . . . 202perform:withArguments: . . . . . . . . . . . . . . . . . . . . . 202pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 146, 148poolResolution . . . . . . . . . . . . . . . . . . . . . . . . . . . 23, 182popen:dir: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125popen:dir:ifFail: . . . . . . . . . . . . . . . . . . . . . . . . . . . 125port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190port: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190position . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 139, 228position: . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 139, 228positive . . . . . . . . . . . . . . . . . . 114, 143, 168, 170, 198positiveDifference: . . . . . . . . . . . . . . . . . . . . . . . . 196postCopy . . . . . . . . . . . . . . . . . . . . . . . 104, 116, 191, 204postData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
postData: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190postLoad . . . . . . . . . . . . . . . . . . 155, 206, 263, 314, 315postStore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155, 206pragmaHandlerFor: . . . . . . . . . . . . . . . . . . . . . . . 60, 183precision . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 146, 148predecessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218prerequisitesFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . 221preStore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206, 263primaryInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182primAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155primAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155primCompile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21primCompile:ifError: . . . . . . . . . . . . . . . . . . . . . . . . 21primDefineExternFunc: . . . . . . . . . . . . . . . . . . . . . . 112primDivide: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170primFileIn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219primHash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141primitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76, 79primitiveAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . 80primitiveFailed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203primNanosecondClock . . . . . . . . . . . . . . . . . . . . . . . . 293primNew: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316primNew:name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8primObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11primReplaceFrom:to:with:startingAt: . . 167, 216primSecondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293primSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155primTerminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206print: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268, 293printAsAttributeOn: . . . . . . . . . . . . . . . . . . . . . . . . 181printedFileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137printFullHierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . 27printHierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27printNl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
printOn: . . . . . 10, 12, 16, 18, 36, 49, 51, 60, 67, 71,74, 81, 99, 101, 102, 108, 109, 114, 119, 129, 135,142, 151, 159, 161, 174, 181, 183, 185, 191, 206,226, 230, 233, 236, 240, 242, 243, 249, 251, 271,
276, 277, 293, 296, 297, 300, 302, 303printOn:base: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160printOn:in: . . . . 27, 31, 64, 183, 187, 245, 280, 300printOn:paddedWith:to: . . . . . . . . . . . . . . . . . . . . . 160printOn:paddedWith:to:base: . . . . . . . . . . . . . . . 160printPaddedWith:to: . . . . . . . . . . . . . . . . . . . . . . . . 160printPaddedWith:to:base: . . . . . . . . . . . . . . . . . . . 160printString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160, 206printString: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160printStringRadix: . . . . . . . . . . . . . . . . . . . . . . . . . . . 160priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229priority: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229priorityName: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233privateMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22processEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . 232processesAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232proxyClassFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Method index 337
proxyFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209ptrType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92publicMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22push: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84putenv: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Qquery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190query: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190queueInterrupt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211quit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211quo: . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 171, 194, 260
RradiansToDegrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195radix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140radix: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160raisedTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196raisedToInteger: . . . . . . . . . . . . . . 141, 151, 165, 196raisePriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229rawProfile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125readFrom: . . . . . . . . . . . . . . . . . . . 97, 99, 113, 193, 295readFrom:radix: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193reads: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78, 82
readStream . . 71, 129, 134, 164, 191, 227, 256, 269,317
readWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125readWriteStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256rebuildTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275receiver . . . . . . . . . . . . . . . . . . . . . . . . . 32, 84, 109, 181receiver: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 109receiver:selector: . . . . . . . . . . . . . . . . . . . . . . . . . . 109receiver:selector:argument: . . . . . . . . . . . . . . . 109receiver:selector:arguments: . . . . . . . . . . . . . . 109reciprocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151, 194reclaimedBytesPerGlobalGC . . . . . . . . . . . . . . . . . . 213reclaimedBytesPerScavenge . . . . . . . . . . . . . . . . . . 213reclaimedPercentPerScavenge . . . . . . . . . . . . . . . 213recompile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81recompile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26recompile:notifying: . . . . . . . . . . . . . . . . . . . . . . . . 26recompileNotifying: . . . . . . . . . . . . . . . . . . . . . . . . . . 81reconstructOriginalObject . . . . . . . . . . . . . 110, 206record: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138refersTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78refresh . . . . . . . . . . . . . . . . . . . 122, 131, 221, 305, 306registerHandler:forPragma: . . . . . . . . . . . . . . . . . . 60registerProxyClass:for: . . . . . . . . . . . . . . . . . . . . 209rehash . . . . . . . . . . . . . . . . . . . . 108, 155, 175, 185, 316reinvokeFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181reject: . . . . . . . . . . . . 15, 71, 106, 133, 163, 177, 267relativeDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . 219relativeDirectory: . . . . . . . . . . . . . . . . . . . . . . . . . . 219release . . . . . . . . . . . . . . . . . . . . . . . . 204, 299, 305, 311
relocate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136relocateFrom:map: . . . . . . . . . . . . . . . . . . . . . . . . . . . 136rem: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166, 171, 194remainingCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286remainingCount: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286remove . . . . . . . . . . . . . . . . . . . . . . . . . 122, 134, 307, 310remove: . . . . . . . . . . . . . . . . 72, 107, 120, 175, 185, 231
remove:ifAbsent: . . . . . . 18, 72, 107, 155, 173, 175,217, 231
removeAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72removeAll:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . . 72removeAllKeys: . . . . . . . . . . . . . . . . . . . . . . . . . 107, 231removeAllKeys:ifAbsent: . . . . . . . . . . . . . . . 107, 231removeAllKeysSuchThat: . . . . . . . . . . . . . . . . . . . . . 109removeAllSuchThat: . . . . . . . . . . . . . . . . . . . . . . . . . . . 72removeAtIndex: . . . . . . . . . . . . . . . . . . . . . . . . . 217, 247removeCategory: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63removeClassVarName: . . . . . . . . . . . . . . . . . . . . . 58, 183removeDependent: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205removeFeature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280removeFirst . . . . . . . . . . . . . . . . . . . . . . . . 173, 217, 247removeInstVarName: . . . . . . . . . . . . . . . . . . . . . . . . . . . 24removeKey: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107, 231removeKey:ifAbsent: . . . . . . . . . . 107, 175, 185, 231removeLast . . . . . . . . . . . . . . . . . . . . . 173, 217, 247, 262removeMember: . . . . . . . . . . . . . . . . . . . . . . . . . . . 305, 312removePermission: . . . . . . . . . . . . . . . . . . . . . . . . . . . 249removeSelector: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26removeSelector:ifAbsent: . . . . . . . . . . . . . . . . . . . . 26removeSharedPool: . . . . . . . . . . . . . . . . . . . . . 8, 58, 183removeSubclass: . . . . . . . . . . . . . . . . . . . . . . . . . 23, 298removeSubspace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9removeToBeFinalized . . . . . . . . . . . . . . . . . . . . 129, 205rename:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120renameTo: . . . . . . . . . . . . . . . . . . . . . . 122, 134, 307, 310repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33replace:withStringBase: . . . . . . . . . . . . . . . 169, 172replaceAll:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256replaceFrom:to:with: . . . . . . . . . . . . . . . . . . . . . . . 256
replaceFrom:to:with:startingAt: . . . 12, 38, 256,270
replaceFrom:to:
withByteArray:startingAt: . . . . . . . . . . . . . . . 270replaceFrom:to:withObject: . . . . . . . . . . . . . . . . 256replaceFrom:to:withString:startingAt: . . . . . 38replacingAllRegex:with: . . . . . . . . . . . . . . . . . . . . 273replacingRegex:with: . . . . . . . . . . . . . . . . . . . . . . . 273requestString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190require: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 228resignalAs: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117resignalAsUnhandled: . . . . . . . . . . . . . . . . . . . . . . . 116respondsTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117, 230resume: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117resumptionTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117retry:coercing: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
338 GNU Smalltalk Library Reference
retryDifferenceCoercing: . . . . . . . . . . . . . . . . . . . 197retryDivisionCoercing: . . . . . . . . . . . . . . . . . . . . . 197retryEqualityCoercing: . . . . . . . . . . . . . . . . . . . . . 197retryError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197retryInequalityCoercing: . . . . . . . . . . . . . . . . . . . 197retryMultiplicationCoercing: . . . . . . . . . . . . . . 197retryRelationalOp:coercing: . . . . . . . . . . . . . . . 197retrySumCoercing: . . . . . . . . . . . . . . . . . . . . . . . . . . . 197retryUsing: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117return: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117returnType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 161, 256reverseContents . . . . . . . . . . . . . . . . . . . . 129, 227, 317reverseDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256rewriteAsAsyncCCall:args: . . . . . . . . . . . . . . . . . . . 81rewriteAsCCall:for: . . . . . . . . . . . . . . . . . . . . . . . . . . 81rewriteAsCCall:returning:args: . . . . . . . . . . . . . 81right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239right: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239rightCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239rounded . . . . . . . . . . . . . . . . . . . 143, 159, 199, 226, 241roundTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199runDelayProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
SsameAs: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54scaleBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241scanBacktraceFor:do: . . . . . . . . . . . . . . . . . . . . . . . . 85scanBacktraceForAttribute:do: . . . . . . . . . . . . . . 85scavenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211scavengesBeforeTenuring . . . . . . . . . . . . . . . . . . . . 214scheduleDelay: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190scheme: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190scheme:host:path: . . . . . . . . . . . . . . . . . . . . . . . . . . . 189scheme:host:port:path: . . . . . . . . . . . . . . . . . . . . . 189scheme:path: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
scheme:username:password:
host:port:path: . . . . . . . . . . . . . . . . . . . . . . . . . . . 189scopeDictionary . . . . . . . . . . . . . . . . . . . . . . . . . 22, 106scopeHas:ifTrue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29scramble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261searchRegex: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273searchRegex:from:to: . . . . . . . . . . . . . . . . . . . . . . . 273searchRegex:startingAt: . . . . . . . . . . . . . . . . . . . . 274second . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 253, 295second: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295secondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294seconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295seconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295securityCheckForName: . . . . . . . . . . . . . . . . . . . . . . . 86securityCheckForName:action: . . . . . . . . . . . . . . . 86securityCheckForName:actions:target: . . . . . . 86securityCheckForName:target: . . . . . . . . . . . . . . . 86securityPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 61securityPolicy: . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 61
seed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236segmentFrom:to: . . . . . . . . . . . . . . . . . . . . 139, 227, 266select: . . . . . . . . . . . . 15, 71, 107, 133, 163, 177, 267selector . . . . . . . . . . . . . 73, 76, 80, 84, 180, 185, 291selector: . . . . . . . . . . . . . . . . 73, 76, 80, 180, 186, 292selector:argument: . . . . . . . . . . . . . . . . . . . . . . . . . . 180selector:arguments: . . . . . . . . . . . . . . . . . . . . 109, 180selector:arguments:receiver: . . . . . . . . . . . . . . 109selectorAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21selectorsAndMethodsDo: . . . . . . . . . . . . . . . . . . . . . . 26selectSubclasses: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23selectSubspaces: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9selectSuperclasses: . . . . . . . . . . . . . . . . . . . . . . . . . . 23selectSuperspaces: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9semaphore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288semaphore: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109sender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184sendsToSuper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78, 82sendTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181set:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10set:to:ifAbsent: . . . . . . . . . . . . . . . . . . . . 10, 187, 245setBit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158setToEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129, 228setTraceFlag:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
shallowCopy . . 30, 37, 155, 195, 203, 246, 276, 297,313, 315
shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28shape: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28sharedPoolDictionaries . . . . . . . . . . . . . . . . . . . . . . . 8sharedPools . . . . . . . . . . . . . . . . . . . . . . . . . . 20, 58, 183sharedVariableString . . . . . . . . . . . . . . . . . . . . . . . . 64shortAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179shortAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179shortMonthName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97shortNameOfMonth: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96shouldNotImplement . . . . . . . . . . . . . . . . . . . . . . . . . . 203show: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292showCr: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292showOnNewLine: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127siblings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 187, 245siblingsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 187, 245sign . . . . . . . . . . . . . . . . . . . . . . . 143, 168, 170, 171, 198signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116, 118, 250signal: . . . . . . . . . . . . . . . . . . . . . . . . 116, 118, 287, 288signal:atNanosecondClockValue: . . . . . . . . . . . . 234signal:onInterrupt: . . . . . . . . . . . . . . . . . . . . . . . . 234signal:reason: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287signalingContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118signalOn: . . . . . . . . . . . . . . . . . . . . . . . . . . 282, 284, 285signalOn:mustBe: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291signalOn:mustBeBetween:and: . . . . . . . . . . . . . . . 281signalOn:reason: . . . . . . . . . . . . . . . . . . . . . . . 284, 286signalOn:useInstead: . . . . . . . . . . . . . . . . . . . . . . . 291signalOn:what: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286signalOn:withIndex: . . . . . . . . . . . . . . . . . . . . . . . . 283
Method index 339
signByte . . . . . . . . . . . . . . . . . . . . . . . 140, 144, 145, 147similarityTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196singleStep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229singleStepWaitingOn: . . . . . . . . . . . . . . . . . . . . . . . 230sinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
size . . . 14, 19, 73, 84, 122, 127, 132, 136, 139, 156,161, 164, 167, 171, 172, 173, 178, 187, 203, 215,
228, 244, 246, 257, 270, 306, 310, 313size:stCtime:stMtime:stAtime:mode: . . . . . . . 307size:stMtime:mode: . . . . . . . . . . . . . . . . . . . . . . . . . . 307
sizeof . . . . 42, 43, 46, 47, 48, 57, 64, 65, 87, 89, 90,92, 93, 94, 95
skip: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129, 228, 267skipSeparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267skipTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267skipToAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268smallest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259smoothingFactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211smoothingFactor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212snapshot: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212soleInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182someInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257, 263sort: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257, 263sortBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262sortBlock: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258, 262sorted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 72, 257sorted: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 72, 257sortedByCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236sourceCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186sourceCodeAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21sourceCodeAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . 21sourceCodeLinesDelta . . . . . . . . . . . . . . . . . 74, 76, 80sourceCodeMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74, 78sourceFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186sourceMethodAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21sourcePos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186sourceString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186sp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84sp: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 266space: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266spaceGrowRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212spaceGrowRate: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212specialSelectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75specialSelectorsNumArgs . . . . . . . . . . . . . . . . . . . . . 75species . . . . . . 31, 161, 204, 227, 243, 265, 276, 313splitAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 151, 196squared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151, 196stackDepth . . . . . . . . . . . . . . . . . . . . . . . . . 32, 74, 76, 80startDelayLoop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103startFinalizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233startScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219startScript: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
startsWith: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253stderr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138stdin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138stdout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138stopScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219stopScript: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67storage: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207store: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268, 293
storeLiteralOn: . . . . 13, 37, 41, 51, 142, 160, 207,249, 271, 276, 300, 304
storeNl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
storeOn: . . . . . 10, 13, 15, 16, 18, 37, 41, 43, 52, 60,72, 81, 88, 89, 93, 99, 101, 102, 109, 114, 143, 151,156, 157, 160, 162, 174, 175, 183, 187, 207, 226,234, 240, 245, 249, 271, 276, 280, 293, 300, 304
storeOn:base: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160storeString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160, 207stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210, 282stream: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210, 282streamContents: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13strictlyPositive . . . . . . . . . 143, 168, 170, 171, 198stringAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179stringAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179stringError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120stripExtension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133stripExtensionFrom: . . . . . . . . . . . . . . . . . . . . . . . . 130stripFileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133stripFileNameFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . 130stripPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133stripPathFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130stripSourceCode . . . . . . . . . . . . . . . . . . . . . . . . . 79, 186subclass: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 298
subclass:classInstanceVariableNames:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . 59, 297
subclass:declaration:classVariableNames:
poolDictionaries:category: . . . . . . . . . . . . . . . 47
subclass:instanceVariableNames:
classVariableNames:poolDictionaries:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 297
subclass:instanceVariableNames:
classVariableNames:poolDictionaries:
category: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 298subclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19subclassesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23subclassInstVarNames . . . . . . . . . . . . . . . . . . . . . . . . 20subclassOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182subclassResponsibility . . . . . . . . . . . . . . . . . . . . . 203subject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244subspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9subspacesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10subStrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56substrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56subStrings: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56substrings: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56subtractDate: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
340 GNU Smalltalk Library Reference
subtractDays: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97subtractTime: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296successor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142suggestedSelector . . . . . . . . . . . . . . . . . . . . . . . . . . . 292suggestedSelector: . . . . . . . . . . . . . . . . . . . . . . . . . . 292sunitScriptFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221sunitScripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219superclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19superclass: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23, 58superspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10, 108superspace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10survSpaceSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214survSpaceUsedBytes . . . . . . . . . . . . . . . . . . . . . . . . . . 214suspend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230suspendedContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229suspendedContext: . . . . . . . . . . . . . . . . . . . . . . . . . . . 229swap:with: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277symbol: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277symbol:nextLink: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277symlink:as: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120symlink:from: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120symlinkAs: . . . . . . . . . . . . . . . . . . . . . . . . . 122, 134, 310symlinkFrom: . . . . . . . . . . . . . . . . . . . . . . . 122, 134, 310system: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278system:withArguments: . . . . . . . . . . . . . . . . . . . . . . 279systemBackgroundPriority . . . . . . . . . . . . . . . . . . . 234systemKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Ttab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 266tab: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116tag: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141, 196tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222target: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222temporary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111tenure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203tenuredBytesPerScavenge . . . . . . . . . . . . . . . . . . . . 214terminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229terminateActive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232terminateOnQuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219test: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219third . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253thisContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83timeBetweenGlobalGCs . . . . . . . . . . . . . . . . . . . . . . . 214timeBetweenGrowths . . . . . . . . . . . . . . . . . . . . . . . . . . 214timeBetweenScavenges . . . . . . . . . . . . . . . . . . . . . . . 214timedWaitOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104timeSlice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232timeSlice: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232timesRepeat: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159timesTwoPower: . . . . . . . . . . . . . . . . . . . . . 145, 147, 149
timeToCollect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214timeToCompact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214timeToScavenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214timezone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293timeZoneAbbreviation . . . . . . . . . . . . . . . . . . . . . . . 101timezoneBias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294timezoneBias: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294timeZoneName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102timingPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197to:by: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197to:by:collect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197to:by:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197to:collect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198to:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198toAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244today . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97, 99tokenize: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274tokenize:from:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . 274top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239top: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239topCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239topLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239topLeft: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239topRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239topRight: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134touch: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120translateBy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241translatedToBeWithin: . . . . . . . . . . . . . . . . . . . . . . 240transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105trimSeparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54truncate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 139, 228truncated . . . 141, 145, 147, 149, 150, 159, 199, 248truncatedGrid: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226truncateTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199, 226type . . . . . . . . . . . . . . . . . . . . . . . . . 43, 44, 66, 67, 88, 90type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
UucharAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40ucharAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179uintAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40uintAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179ulongAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40ulongAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179uniqueInstance . . . . . . . . . . . . . . . . . . . . . . . . . 193, 230unity . . . . . . . . . . . . 145, 147, 149, 150, 167, 195, 261unpreemptedPriority . . . . . . . . . . . . . . . . . . . . . . . . 234unscheduleDelay: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103unsignedCharAt: . . . . . . . . . . . . . . . . . . . . . . . . . 40, 179unsignedCharAt:put: . . . . . . . . . . . . . . . . . . . . . 41, 179unsignedIntAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . 41, 179unsignedIntAt:put: . . . . . . . . . . . . . . . . . . . . . . 41, 179unsignedLongAt: . . . . . . . . . . . . . . . . . . . . . . . . . 41, 180
Method index 341
unsignedLongAt:put: . . . . . . . . . . . . . . . . . . . . . 41, 180unsignedShortAt: . . . . . . . . . . . . . . . . . . . . . . . . 41, 180unsignedShortAt:put: . . . . . . . . . . . . . . . . . . . . 41, 180untilMilliseconds: . . . . . . . . . . . . . . . . . . . . . . . . . . 103untilNanoseconds: . . . . . . . . . . . . . . . . . . . . . . . . . . . 103update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214update: . . 103, 112, 123, 199, 203, 233, 294, 307, 308updateInstanceVars:shape: . . . . . . . . . . . . . . . . . . . 27updateMember: . . . . . . . . . . . . . . . . . . . . . . . . . . . 305, 312upTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 227, 264upToAll: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264upToEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227, 264url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219url: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219use:during: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115, 235userBackgroundPriority . . . . . . . . . . . . . . . . . . . . . 234userBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111userInterrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208userInterruptPriority . . . . . . . . . . . . . . . . . . . . . . 234username . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190username: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190userSchedulingPriority . . . . . . . . . . . . . . . . . . . . . 234ushortAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41ushortAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41, 180utcDateAndTimeNow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97utcNow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293utcSecondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293utcToday . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
VvalidClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291validClasses: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291validClassesString . . . . . . . . . . . . . . . . . . . . . . . . . . 291validSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84, 204
value . . 16, 32, 43, 44, 50, 87, 88, 91, 102, 105, 109,115, 193, 223, 235, 284, 302, 303
value: . . 16, 32, 43, 44, 49, 87, 88, 90, 91, 102, 105,110, 193, 223, 235, 284, 301, 302, 303
value:onTimeoutDo: . . . . . . . . . . . . . . . . . . . . . . . . . . 104value:value: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 110value:value:value: . . . . . . . . . . . . . . . . . . . . . . . . . . . 32valueAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53valueAt:ifAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53valueAt:put: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53valueIfAbsent: . . . . . . . . . . . . . . . . . . . . . . . . . 115, 235values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10, 106valueType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89, 92valueWithArguments: . . . . . . . . . . . . . . . . . 32, 87, 110valueWithoutInterrupts . . . . . . . . . . . . . . . . . . . . . . 34valueWithoutInterrupts: . . . . . . . . . . . . . . . . . . . . 229valueWithoutPreemption . . . . . . . . . . . . . . . . . . . . . . 34valueWithReceiver:withArguments: . . . . . . . . . . . 81valueWithUnwind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
variable:subclass:instanceVariableNames:
classVariableNames:poolDictionaries:
category: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 298
variableByteSubclass:
classInstanceVariableNames:
classVariableNames:poolDictionaries: . . . . 60
variableByteSubclass:
classInstanceVariableNames:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . . . . 297
variableByteSubclass:
classVariableNames:poolDictionaries: . . . . 60
variableByteSubclass:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . . . . 297
variableByteSubclass:
instanceVariableNames:classVariableNames:
poolDictionaries:category: . . . . . . . . . . . 59, 299
variableLongSubclass:
classInstanceVariableNames:
classVariableNames:poolDictionaries: . . . . 60
variableLongSubclass:
classInstanceVariableNames:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . . . . 297
variableLongSubclass:
classVariableNames:poolDictionaries: . . . . 60
variableLongSubclass:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . . . . 298
variableSubclass:
classInstanceVariableNames:
instanceVariableNames:classVariableNames:
poolDictionaries: . . . . . . . . . . . . . . . . . . . . . 60, 298
variableSubclass:instanceVariableNames:
classVariableNames:poolDictionaries:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60, 298
variableSubclass:instanceVariableNames:
classVariableNames:poolDictionaries:
category: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 299
variableWordSubclass:
instanceVariableNames:classVariableNames:
poolDictionaries:category: . . . . . . . . . . . 59, 299
verbose: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
verboseTrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
verboseTrace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
verify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219, 280version: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
342 GNU Smalltalk Library Reference
Wwait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104, 114, 250waitAfterSignalling: . . . . . . . . . . . . . . . . . . . . . . . 250waitForException . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126waitingProcesses . . . . . . . . . . . . . . . . . . . . . . . 242, 250weeks: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113whichCategoryIncludesSelector: . . . . . . . . . . . . . 63whichClassIncludesSelector: . . . . . . . . . . . . . . . . 29whichSelectorsAccess: . . . . . . . . . . . . . . . . . . . . . . . 29whichSelectorsAssign: . . . . . . . . . . . . . . . . . . . . . . . 29whichSelectorsRead: . . . . . . . . . . . . . . . . . . . . . . . . . . 29whichSelectorsReferTo: . . . . . . . . . . . . . . . . . . . . . . 29whichSelectorsReferToByteCode: . . . . . . . . . . . . . 29whileCurrentDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9whileFalse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33whileFalse: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33whileTrue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33whileTrue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239width: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239with: . . . . . . . . . . 13, 69, 237, 253, 266, 274, 303, 316with:collect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 256with:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256with:from:to: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316with:with: . . . . . . . . . . . . . . . . . . 13, 69, 253, 266, 275with:with:with: . . . . . . . . . . . . 13, 69, 254, 266, 275with:with:with:with: . . . . . . . . . . . . . . . . 13, 69, 275with:with:with:with:with: . . . . . . . . . . 13, 69, 275withAll: . . . . . . . . . . . . . . . . . . . . . . . . . 14, 69, 154, 161withAllBlocksDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80withAllSubclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19withAllSubclassesDo: . . . . . . . . . . . . . . . . . . . . . . . . 23withAllSubspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10withAllSubspacesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . 10withAllSuperclasses . . . . . . . . . . . . . . . . . . . . . . . . . . 19withAllSuperclassesDo: . . . . . . . . . . . . . . . . . . . . . . 23withAllSuperspaces . . . . . . . . . . . . . . . . . . . . . . . . . . 108withAllSuperspacesDo: . . . . . . . . . . . . . . . . . . . . . . 108withFileDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136withNewMethodClass: . . . . . . . . . . . . . . . . . . . . . . . . . . 80withNewMethodClass:selector: . . . . . . . . . . . . . . . 80
withOwner: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249withReadStreamDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . 134withShellEscapes . . . . . . . . . . . . . . . . . . . . . . . . 56, 135withSignOf: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 196withUnixShellEscapes . . . . . . . . . . . . . . . . . . . . . . . . 55withWindowsShellEscapes . . . . . . . . . . . . . . . . . . . . . 55withWriteStreamDo: . . . . . . . . . . . . . . . . . . . . . . . . . . 134working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111working: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111wouldBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242, 250write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125writeStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 134
Xx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224x: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224x:y: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224xor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 119, 297
Yy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224y: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224year . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98year:day:hour:minute:second: . . . . . . . . . . . . 96, 99year:day:hour:minute:second:offset: . . . . . . . 99year:month:day:hour:minute:second: . . . . . 96, 99
year:month:day:hour:minute:
second:offset: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100yield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230, 232yield: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Zzero . . . . 113, 145, 147, 149, 150, 167, 195, 249, 261zeroDivide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195zip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
343
Selector cross-reference
#
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272, 273
** . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197, 275, 276
–- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
/
/ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
<<= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 72, 257
== . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17, 197, 264=~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
~~= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Aadd: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71addSubspace: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186addToBeFinalized . . . . . . . . . . . . . . . . . . 46, 67, 88, 90allFilesMatching:do: . . . . . . . . . . . . . . . . . . . . . . . 111allLiteralsDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77AM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125arguments:do:ifError: . . . . . . . . . . . . . . . . . . . . . . 279array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92asciiValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50asInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50associationAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232asString . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139, 227, 266asyncCallFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45asyncCCall:args: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78at: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223, 303at:/#at:put: . . . . . . . . . . . . . . . . . . . . . . . . 72, 257, 268at:put: . . . . . . . . . . . . . . . . . . . . . . . . 29, 88, 90, 91, 223autoload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
BbasicNew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21basicNew: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21basicPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116become: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200binaryRepresentationObject . . . . . . . . . . . . 206, 224binaryRepresentationVersion . . . . . . . . . . . . . . . 304blockAt: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298
CcallFrom:into: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45cCall:returning:args: . . . . . . . . . . . . . . . . . . . . . . . 78changed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203changed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298checkError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125cObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67codePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50codePoint: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301collect: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14, 30, 251collection:map: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177compile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21compile:ifError: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21continue: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 84, 184
convertFromVersion:withFixedVariables:
instanceVariables:for: . . . . . . . . . . . . . . . . . . . 304copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
344 GNU Smalltalk Library Reference
copyEmpty: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204, 313create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125
Dday . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98debuggingPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26directoryFor: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220disableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 233display: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268displayString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195do: . . . . . . . . . . . . . . . . . . . . . . . . . . 70, 71, 246, 257, 263doesNotUnderstand: . . . . . . . . . . . . . . . . . . . . . . . . . . 181double . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298dumpTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11, 113
EenableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233ensure: . . . . . . . . . . . . . . . . . . . 34, 35, 84, 85, 184, 229error: . . . . . . . . . . . . . . . . . . . . . . . . . . 24, 25, 26, 33, 81examine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204examineOn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47exceptionHandlingInternal: . . . . . . . . . . . . . . . . 184
FfileIn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265finalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67from:to:keysAndValuesDo: . . . . . . . . . . . . . . . . . . . 255fullName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
GgenerateMakefileOnto: . . . . . . . . . . . . . . . . . . . . . . 138
Hhalt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154hash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
IidentityHash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30ifCurtailed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85, 229ifTrue:ifFalse: . . . . . . . . . . . . . . . . . . . . . . . . 275, 276includes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157, 314includesClassNamed: . . . . . . . . . . . . . . . . . . . . . . . . . . . 9includesGlobalNamed: . . . . . . . . . . . . . . . . . . . . . . . . . . 9includesKey: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9inherit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 92, 298int64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298int8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298integerPart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Jjoin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Kkey:class:defaultDictionary: . . . . . . . . . . . . . . 102keysAndValuesDo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Lline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
loadFrom: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113lowerPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Mmark: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
match: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132, 133mourn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Nname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133, 306
new . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 24
new: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
newProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
next . . . . . . . . . . . . . . . . . . . . . . . . . . . 152, 153, 258, 267
nonVersionedInstSize . . . . . . . . . . . . . . . . . . . . . . . 304
not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275, 276
notify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250notifyAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Oon: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
on:do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 117
on:index: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223outer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Selector cross-reference 345
Pparse:with:do:ifError: . . . . . . . . . . . . . . . . . . . . . 153parseVariableString: . . . . . . . . . . . . . . . . . . . . . . . . 26pass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117peek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153PM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226postLoad . . . . . . . . . . . . . . . . . . . . . . . 155, 206, 224, 259postStore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224preStore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224primCompile: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21primDefineExternFunc: . . . . . . . . . . . . . . . . . . . . . . 112print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205printHierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27printNl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206printOn: . . . . . 51, 116, 206, 243, 271, 275, 276, 300printString . . . . . . . . . . . . . . . 206, 243, 249, 271, 276printStringRadix: . . . . . . . . . . . . . . . . . . . . . . . . . . . 160ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Qquit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
RraisePriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125readWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125reconstructOriginalObject . . . . . . . . . . . . . 224, 259removeToBeFinalized . . . . . . . . . . . . . . . . . . . . 124, 125resolveBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102return: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
SsecondClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293select: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227self . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44, 45selfSmalltalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44, 45short . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117signal:atMilliseconds: . . . . . . . . . . . . . . . . . . . . . 234singleStepWaitingOn: . . . . . . . . . . . . . . . . . . . . . . . 229size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
size:stCtime:stMtime:
stAtime:isDirectory: . . . . . . . . . . . . . . . . . . . . . 305skip: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129, 228, 267skipSeparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267specialSelectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75species . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66subclass:declaration: . . . . . . . . . . . . . . . . . . . . . . . 47subclassResponsibility . . . . . . . . . . . . . . . . . 81, 198
TtimeZoneAbbreviation . . . . . . . . . . . . . . . . . . . . . . . 102trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Uuint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298uint64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298upTo: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227ushort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298utf32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 59, 298
Vvalue . . . . . . . . . . . . . . . . . . . . . . . . 50, 87, 223, 235, 236value: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 223, 301valueWithoutPreemption . . . . . . . . . . . . . . . . . . . . . 234valueWithReceiver:withArguments: . . . . . . . . . . . 79valueWithUnwind . . . . . . . . . . . . . . . . . . . . . . . . . 34, 184Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Wwait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124, 125
Yyield: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
i
Table of Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 Base classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1 Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 AbstractNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1 AbstractNamespace class: instance creation . . . . . . . . . . . . . . . . 81.2.2 AbstractNamespace: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.3 AbstractNamespace: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.4 AbstractNamespace: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.5 AbstractNamespace: namespace hierarchy . . . . . . . . . . . . . . . . . . 91.2.6 AbstractNamespace: overrides for superspaces . . . . . . . . . . . . . 101.2.7 AbstractNamespace: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2.8 AbstractNamespace: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 AlternativeObjectProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.1 AlternativeObjectProxy class: instance creation . . . . . . . . . . . 111.3.2 AlternativeObjectProxy: accessing . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 ArithmeticError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.4.1 ArithmeticError: description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5.1 Array class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5.2 Array: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5.3 Array: mutating objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5.4 Array: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5.5 Array: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.6 ArrayedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.6.1 ArrayedCollection class: instance creation . . . . . . . . . . . . . . . . . 131.6.2 ArrayedCollection: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6.3 ArrayedCollection: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6.4 ArrayedCollection: compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6.5 ArrayedCollection: copying Collections . . . . . . . . . . . . . . . . . . . . 141.6.6 ArrayedCollection: enumerating the elements of a collection . . 151.6.7 ArrayedCollection: sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.6.8 ArrayedCollection: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.6.9 ArrayedCollection: streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.7 Association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.1 Association class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.2 Association: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.3 Association: finalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.4 Association: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.5 Association: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.6 Association: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.8 Autoload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171.8.1 Autoload class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ii GNU Smalltalk Library Reference
1.8.2 Autoload: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171.9 Bag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.9.1 Bag class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.2 Bag: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.3 Bag: enumerating the elements of a collection . . . . . . . . . . . . . 181.9.4 Bag: extracting items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.5 Bag: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.6 Bag: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.7 Bag: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.9.8 Bag: testing collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.10 Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.10.1 Behavior: accessing class hierarchy . . . . . . . . . . . . . . . . . . . . . . . 191.10.2 Behavior: accessing instances and variables . . . . . . . . . . . . . . 191.10.3 Behavior: accessing the method dictionary . . . . . . . . . . . . . . . 201.10.4 Behavior: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.10.5 Behavior: builtin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221.10.6 Behavior: compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221.10.7 Behavior: compilation (alternative) . . . . . . . . . . . . . . . . . . . . . . 221.10.8 Behavior: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221.10.9 Behavior: compiling methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.10.10 Behavior: creating a class hierarchy . . . . . . . . . . . . . . . . . . . . . 231.10.11 Behavior: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.10.12 Behavior: evaluating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.10.13 Behavior: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.10.14 Behavior: instance variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.10.15 Behavior: method dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.10.16 Behavior: parsing class declarations . . . . . . . . . . . . . . . . . . . . . 261.10.17 Behavior: pluggable behavior (not yet implemented) . . . . 261.10.18 Behavior: printing hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271.10.19 Behavior: source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271.10.20 Behavior: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271.10.21 Behavior: support for lightweight classes . . . . . . . . . . . . . . . . 271.10.22 Behavior: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 281.10.23 Behavior: testing the class hierarchy . . . . . . . . . . . . . . . . . . . . 281.10.24 Behavior: testing the form of the instances . . . . . . . . . . . . . . 281.10.25 Behavior: testing the method dictionary . . . . . . . . . . . . . . . . 28
1.11 BindingDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291.11.1 BindingDictionary: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291.11.2 BindingDictionary: basic & copying . . . . . . . . . . . . . . . . . . . . . . 301.11.3 BindingDictionary: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301.11.4 BindingDictionary: forward declarations . . . . . . . . . . . . . . . . . 301.11.5 BindingDictionary: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311.11.6 BindingDictionary: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.12 BlockClosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311.12.1 BlockClosure class: instance creation . . . . . . . . . . . . . . . . . . . . . 311.12.2 BlockClosure class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311.12.3 BlockClosure: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311.12.4 BlockClosure: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
iii
1.12.5 BlockClosure: control structures . . . . . . . . . . . . . . . . . . . . . . . . . 331.12.6 BlockClosure: exception handling . . . . . . . . . . . . . . . . . . . . . . . . 331.12.7 BlockClosure: multiple process . . . . . . . . . . . . . . . . . . . . . . . . . . . 341.12.8 BlockClosure: overriding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341.12.9 BlockClosure: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341.12.10 BlockClosure: unwind protection . . . . . . . . . . . . . . . . . . . . . . . 34
1.13 BlockContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351.13.1 BlockContext: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351.13.2 BlockContext: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361.13.3 BlockContext: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.14 Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361.14.1 Boolean class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361.14.2 Boolean: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361.14.3 Boolean: C hacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371.14.4 Boolean: overriding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371.14.5 Boolean: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.15 ByteArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371.15.1 ByteArray class: instance creation . . . . . . . . . . . . . . . . . . . . . . . 371.15.2 ByteArray: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371.15.3 ByteArray: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.15.4 ByteArray: CObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.15.5 ByteArray: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.15.6 ByteArray: more advanced accessing . . . . . . . . . . . . . . . . . . . . . 381.15.7 ByteArray: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.16 CAggregate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.16.1 CAggregate class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.16.2 CAggregate: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.17 CallinProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.17.1 CallinProcess: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.18 CArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.18.1 CArray: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.19 CArrayCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.19.1 CArrayCType class: instance creation . . . . . . . . . . . . . . . . . . . 431.19.2 CArrayCType: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431.19.3 CArrayCType: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431.19.4 CArrayCType: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.20 CBoolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431.20.1 CBoolean class: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431.20.2 CBoolean: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.21 CByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.21.1 CByte class: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.21.2 CByte: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.22 CCallable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.22.1 CCallable class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 441.22.2 CCallable: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.22.3 CCallable: calling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.22.4 CCallable: restoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.23 CCallbackDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
iv GNU Smalltalk Library Reference
1.23.1 CCallbackDescriptor class: instance creation . . . . . . . . . . . . . 451.23.2 CCallbackDescriptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 451.23.3 CCallbackDescriptor: restoring . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.24 CChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.24.1 CChar class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.24.2 CChar: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.24.3 CChar: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.25 CCompound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.25.1 CCompound class: instance creation . . . . . . . . . . . . . . . . . . . . . 461.25.2 CCompound class: subclass creation . . . . . . . . . . . . . . . . . . . . . 461.25.3 CCompound: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.26 CDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471.26.1 CDouble class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471.26.2 CDouble: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.27 CFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481.27.1 CFloat class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481.27.2 CFloat: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.28 CFunctionDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481.28.1 CFunctionDescriptor class: instance creation . . . . . . . . . . . . . 481.28.2 CFunctionDescriptor class: testing . . . . . . . . . . . . . . . . . . . . . . . 481.28.3 CFunctionDescriptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 491.28.4 CFunctionDescriptor: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . 491.28.5 CFunctionDescriptor: restoring . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.29 Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491.29.1 Character class: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491.29.2 Character class: constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491.29.3 Character class: initializing lookup tables . . . . . . . . . . . . . . . . 501.29.4 Character class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 501.29.5 Character class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501.29.6 Character: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501.29.7 Character: coercion methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501.29.8 Character: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511.29.9 Character: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511.29.10 Character: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511.29.11 Character: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521.29.12 Character: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521.29.13 Character: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . 52
1.30 CharacterArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521.30.1 CharacterArray class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521.30.2 CharacterArray class: multibyte encodings . . . . . . . . . . . . . . . 531.30.3 CharacterArray: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.30.4 CharacterArray: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.30.5 CharacterArray: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.30.6 CharacterArray: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.30.7 CharacterArray: multibyte encodings . . . . . . . . . . . . . . . . . . . . 551.30.8 CharacterArray: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . 551.30.9 CharacterArray: string processing . . . . . . . . . . . . . . . . . . . . . . . 551.30.10 CharacterArray: testing functionality . . . . . . . . . . . . . . . . . . . 56
v
1.31 CInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561.31.1 CInt class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571.31.2 CInt: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.32 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571.32.1 Class class: initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571.32.2 Class: accessing instances and variables . . . . . . . . . . . . . . . . . . 571.32.3 Class: filing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581.32.4 Class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581.32.5 Class: instance creation - alternative . . . . . . . . . . . . . . . . . . . . . 591.32.6 Class: pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601.32.7 Class: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601.32.8 Class: saving and loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611.32.9 Class: security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611.32.10 Class: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611.32.11 Class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611.32.12 Class: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1.33 ClassDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621.33.1 ClassDescription: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621.33.2 ClassDescription: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621.33.3 ClassDescription: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621.33.4 ClassDescription: filing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631.33.5 ClassDescription: organization of messages and classes . . . 631.33.6 ClassDescription: parsing class declarations . . . . . . . . . . . . . . 641.33.7 ClassDescription: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641.33.8 ClassDescription: still unclassified . . . . . . . . . . . . . . . . . . . . . . . 64
1.34 CLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641.34.1 CLong class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641.34.2 CLong: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.35 CLongDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651.35.1 CLongDouble class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651.35.2 CLongDouble: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.36 CLongLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651.36.1 CLongLong class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651.36.2 CLongLong: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.37 CObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661.37.1 CObject class: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661.37.2 CObject class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 661.37.3 CObject class: primitive allocation . . . . . . . . . . . . . . . . . . . . . . . 661.37.4 CObject class: subclass creation . . . . . . . . . . . . . . . . . . . . . . . . . 661.37.5 CObject: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661.37.6 CObject: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671.37.7 CObject: C data access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671.37.8 CObject: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671.37.9 CObject: finalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671.37.10 CObject: pointer-like behavior . . . . . . . . . . . . . . . . . . . . . . . . . . 681.37.11 CObject: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681.37.12 CObject: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 68
1.38 Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
vi GNU Smalltalk Library Reference
1.38.1 Collection class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 691.38.2 Collection class: multibyte encodings . . . . . . . . . . . . . . . . . . . . 691.38.3 Collection: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691.38.4 Collection: compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701.38.5 Collection: concatenating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701.38.6 Collection: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701.38.7 Collection: copying Collections . . . . . . . . . . . . . . . . . . . . . . . . . . 701.38.8 Collection: copying SequenceableCollections . . . . . . . . . . . . . . 711.38.9 Collection: enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711.38.10 Collection: finalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711.38.11 Collection: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711.38.12 Collection: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721.38.13 Collection: sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721.38.14 Collection: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721.38.15 Collection: testing collections . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.39 CompiledBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731.39.1 CompiledBlock class: instance creation . . . . . . . . . . . . . . . . . . . 731.39.2 CompiledBlock: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731.39.3 CompiledBlock: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741.39.4 CompiledBlock: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741.39.5 CompiledBlock: saving and loading . . . . . . . . . . . . . . . . . . . . . . 74
1.40 CompiledCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751.40.1 CompiledCode class: cache flushing . . . . . . . . . . . . . . . . . . . . . . 751.40.2 CompiledCode class: instance creation . . . . . . . . . . . . . . . . . . . 751.40.3 CompiledCode class: tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751.40.4 CompiledCode: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751.40.5 CompiledCode: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771.40.6 CompiledCode: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771.40.7 CompiledCode: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771.40.8 CompiledCode: decoding bytecodes . . . . . . . . . . . . . . . . . . . . . . 771.40.9 CompiledCode: literals - iteration . . . . . . . . . . . . . . . . . . . . . . . . 771.40.10 CompiledCode: security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781.40.11 CompiledCode: testing accesses . . . . . . . . . . . . . . . . . . . . . . . . . 781.40.12 CompiledCode: translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.41 CompiledMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781.41.1 CompiledMethod class: c call-outs . . . . . . . . . . . . . . . . . . . . . . . 781.41.2 CompiledMethod class: instance creation . . . . . . . . . . . . . . . . 791.41.3 CompiledMethod class: lean images . . . . . . . . . . . . . . . . . . . . . . 791.41.4 CompiledMethod: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791.41.5 CompiledMethod: attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801.41.6 CompiledMethod: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801.41.7 CompiledMethod: c call-outs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811.41.8 CompiledMethod: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811.41.9 CompiledMethod: invoking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811.41.10 CompiledMethod: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811.41.11 CompiledMethod: saving and loading . . . . . . . . . . . . . . . . . . . 821.41.12 CompiledMethod: source code . . . . . . . . . . . . . . . . . . . . . . . . . . 821.41.13 CompiledMethod: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
vii
1.42 ContextPart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831.42.1 ContextPart class: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831.42.2 ContextPart class: exception handling . . . . . . . . . . . . . . . . . . . 831.42.3 ContextPart: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831.42.4 ContextPart: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851.42.5 ContextPart: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851.42.6 ContextPart: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851.42.7 ContextPart: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851.42.8 ContextPart: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861.42.9 ContextPart: security checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
1.43 Continuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861.43.1 Continuation class: instance creation . . . . . . . . . . . . . . . . . . . . . 861.43.2 Continuation: invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
1.44 CPtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871.44.1 CPtr: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
1.45 CPtrCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871.45.1 CPtrCType class: instance creation . . . . . . . . . . . . . . . . . . . . . . 881.45.2 CPtrCType: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881.45.3 CPtrCType: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881.45.4 CPtrCType: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.46 CScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881.46.1 CScalar class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . 881.46.2 CScalar: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.47 CScalarCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891.47.1 CScalarCType: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891.47.2 CScalarCType: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
1.48 CShort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891.48.1 CShort class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891.48.2 CShort: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
1.49 CSmalltalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891.49.1 CSmalltalk class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901.49.2 CSmalltalk: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
1.50 CString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901.50.1 CString class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901.50.2 CString class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . 901.50.3 CString: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
1.51 CStringCType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911.51.1 CStringCType: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
1.52 CStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911.52.1 CStruct class: subclass creation . . . . . . . . . . . . . . . . . . . . . . . . . . 91
1.53 CType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911.53.1 CType class: C instance creation . . . . . . . . . . . . . . . . . . . . . . . . 921.53.2 CType class: initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921.53.3 CType: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921.53.4 CType: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921.53.5 CType: C instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931.53.6 CType: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.54 CUChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
viii GNU Smalltalk Library Reference
1.54.1 CUChar class: getting info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931.54.2 CUChar: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.55 CUInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931.55.1 CUInt class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941.55.2 CUInt: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
1.56 CULong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941.56.1 CULong class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941.56.2 CULong: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
1.57 CULongLong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941.57.1 CULongLong class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941.57.2 CULongLong: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
1.58 CUnion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951.58.1 CUnion class: subclass creation . . . . . . . . . . . . . . . . . . . . . . . . . . 95
1.59 CUShort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951.59.1 CUShort class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951.59.2 CUShort: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
1.60 Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951.60.1 Date class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961.60.2 Date class: instance creation (ANSI) . . . . . . . . . . . . . . . . . . . . . 961.60.3 Date class: instance creation (Blue Book) . . . . . . . . . . . . . . . . 971.60.4 Date: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 971.60.5 Date: compatibility (non-ANSI) . . . . . . . . . . . . . . . . . . . . . . . . . 971.60.6 Date: date computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981.60.7 Date: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991.60.8 Date: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991.60.9 Date: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991.60.10 Date: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
1.61 DateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991.61.1 DateTime class: information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991.61.2 DateTime class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 991.61.3 DateTime class: instance creation (non-ANSI) . . . . . . . . . . 1001.61.4 DateTime: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001.61.5 DateTime: computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001.61.6 DateTime: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011.61.7 DateTime: splitting in dates & times . . . . . . . . . . . . . . . . . . . 1011.61.8 DateTime: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011.61.9 DateTime: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011.61.10 DateTime: time zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.62 DeferredVariableBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021.62.1 DeferredVariableBinding class: basic . . . . . . . . . . . . . . . . . . . . 1021.62.2 DeferredVariableBinding: basic . . . . . . . . . . . . . . . . . . . . . . . . . 1021.62.3 DeferredVariableBinding: storing . . . . . . . . . . . . . . . . . . . . . . . 102
1.63 Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021.63.1 Delay class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031.63.2 Delay class: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031.63.3 Delay class: timer process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031.63.4 Delay: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031.63.5 Delay: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
ix
1.63.6 Delay: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.63.7 Delay: delaying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.63.8 Delay: initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.63.9 Delay: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.63.10 Delay: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.63.11 Delay: timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
1.64 DelayedAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041.64.1 DelayedAdaptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
1.65 Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051.65.1 Dictionary class: instance creation . . . . . . . . . . . . . . . . . . . . . . 1051.65.2 Dictionary: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051.65.3 Dictionary: awful ST-80 compatibility hacks . . . . . . . . . . . . 1061.65.4 Dictionary: compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061.65.5 Dictionary: dictionary enumerating . . . . . . . . . . . . . . . . . . . . . 1061.65.6 Dictionary: dictionary removing . . . . . . . . . . . . . . . . . . . . . . . . 1071.65.7 Dictionary: dictionary testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 1071.65.8 Dictionary: namespace protocol . . . . . . . . . . . . . . . . . . . . . . . . . 1071.65.9 Dictionary: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1081.65.10 Dictionary: rehashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1081.65.11 Dictionary: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091.65.12 Dictionary: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091.65.13 Dictionary: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
1.66 DirectedMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091.66.1 DirectedMessage class: creating instances . . . . . . . . . . . . . . . 1091.66.2 DirectedMessage: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091.66.3 DirectedMessage: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091.66.4 DirectedMessage: multiple process . . . . . . . . . . . . . . . . . . . . . . 1101.66.5 DirectedMessage: saving and loading . . . . . . . . . . . . . . . . . . . 110
1.67 Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1101.67.1 Directory class: file name management . . . . . . . . . . . . . . . . . . 1101.67.2 Directory class: file operations . . . . . . . . . . . . . . . . . . . . . . . . . . 1111.67.3 Directory class: reading system defaults . . . . . . . . . . . . . . . . . 111
1.68 DLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1111.68.1 DLD class: C call-outs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121.68.2 DLD class: dynamic linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
1.69 DumperProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121.69.1 DumperProxy class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 1131.69.2 DumperProxy class: instance creation . . . . . . . . . . . . . . . . . . 1131.69.3 DumperProxy: saving and restoring . . . . . . . . . . . . . . . . . . . . 113
1.70 Duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1131.70.1 Duration class: instance creation . . . . . . . . . . . . . . . . . . . . . . . 1131.70.2 Duration class: instance creation (non ANSI) . . . . . . . . . . . 1131.70.3 Duration: arithmetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141.70.4 Duration: processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141.70.5 Duration: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.71 DynamicVariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141.71.1 DynamicVariable class: evaluating . . . . . . . . . . . . . . . . . . . . . . 115
1.72 Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
x GNU Smalltalk Library Reference
1.72.1 Error: exception description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1151.73 Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
1.73.1 Exception class: comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1151.73.2 Exception class: creating ExceptionCollections . . . . . . . . . . 1151.73.3 Exception class: instance creation . . . . . . . . . . . . . . . . . . . . . . 1161.73.4 Exception class: interoperability with TrappableEvents . . 1161.73.5 Exception: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1161.73.6 Exception: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1161.73.7 Exception: comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1161.73.8 Exception: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1161.73.9 Exception: exception description . . . . . . . . . . . . . . . . . . . . . . . . 1161.73.10 Exception: exception handling . . . . . . . . . . . . . . . . . . . . . . . . . 1171.73.11 Exception: exception signaling . . . . . . . . . . . . . . . . . . . . . . . . . 1181.73.12 Exception: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.74 ExceptionSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181.74.1 ExceptionSet class: instance creation . . . . . . . . . . . . . . . . . . . 1181.74.2 ExceptionSet: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181.74.3 ExceptionSet: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.75 False . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191.75.1 False: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191.75.2 False: C hacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191.75.3 False: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
1.76 File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1201.76.1 File class: C functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1201.76.2 File class: file operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1201.76.3 File class: initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1201.76.4 File class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1201.76.5 File class: reading system defaults . . . . . . . . . . . . . . . . . . . . . . 1211.76.6 File class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1211.76.7 File: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1211.76.8 File: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221.76.9 File: directory operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221.76.10 File: file name management . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221.76.11 File: file operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221.76.12 File: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231.76.13 File: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
1.77 FileDescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231.77.1 FileDescriptor class: initialization . . . . . . . . . . . . . . . . . . . . . . . 1231.77.2 FileDescriptor class: instance creation . . . . . . . . . . . . . . . . . . 1241.77.3 FileDescriptor class: still unclassified . . . . . . . . . . . . . . . . . . . 1251.77.4 FileDescriptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251.77.5 FileDescriptor: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1261.77.6 FileDescriptor: binary I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271.77.7 FileDescriptor: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1281.77.8 FileDescriptor: class type methods . . . . . . . . . . . . . . . . . . . . . . 1281.77.9 FileDescriptor: initialize-release . . . . . . . . . . . . . . . . . . . . . . . . . 1291.77.10 FileDescriptor: low-level access . . . . . . . . . . . . . . . . . . . . . . . . 1291.77.11 FileDescriptor: overriding inherited methods . . . . . . . . . . . 129
xi
1.77.12 FileDescriptor: polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . 1291.77.13 FileDescriptor: positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291.77.14 FileDescriptor: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291.77.15 FileDescriptor: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.78 FilePath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1301.78.1 FilePath class: file name management . . . . . . . . . . . . . . . . . . 1301.78.2 FilePath class: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . 1301.78.3 FilePath: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1311.78.4 FilePath: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321.78.5 FilePath: decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321.78.6 FilePath: directory operations . . . . . . . . . . . . . . . . . . . . . . . . . . 1321.78.7 FilePath: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321.78.8 FilePath: file name management . . . . . . . . . . . . . . . . . . . . . . . . 1331.78.9 FilePath: file operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1341.78.10 FilePath: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351.78.11 FilePath: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351.78.12 FilePath: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351.78.13 FilePath: virtual filesystems . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.79 FileSegment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361.79.1 FileSegment class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361.79.2 FileSegment class: installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361.79.3 FileSegment: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361.79.4 FileSegment: equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1371.79.5 FileSegment: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
1.80 FileStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1371.80.1 FileStream class: file-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1371.80.2 FileStream class: standard streams . . . . . . . . . . . . . . . . . . . . . 1381.80.3 FileStream: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1381.80.4 FileStream: buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1391.80.5 FileStream: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1391.80.6 FileStream: initialize-release . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1391.80.7 FileStream: overriding inherited methods . . . . . . . . . . . . . . . 1401.80.8 FileStream: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
1.81 Float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401.81.1 Float class: byte-order dependancies . . . . . . . . . . . . . . . . . . . . 1401.81.2 Float class: characterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401.81.3 Float: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1411.81.4 Float: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1411.81.5 Float: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1411.81.6 Float: coercing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1411.81.7 Float: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.8 Float: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.9 Float: compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.10 Float: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.11 Float: floating point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.12 Float: misc math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.13 Float: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421.81.14 Float: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
xii GNU Smalltalk Library Reference
1.81.15 Float: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1431.81.16 Float: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1431.81.17 Float: transcendental operations . . . . . . . . . . . . . . . . . . . . . . . 1431.81.18 Float: truncation and round off . . . . . . . . . . . . . . . . . . . . . . . . 143
1.82 FloatD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1441.82.1 FloatD class: byte-order dependencies . . . . . . . . . . . . . . . . . . 1441.82.2 FloatD class: characterization . . . . . . . . . . . . . . . . . . . . . . . . . . 1441.82.3 FloatD class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1441.82.4 FloatD: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1441.82.5 FloatD: coercing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1451.82.6 FloatD: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.83 FloatE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1451.83.1 FloatE class: byte-order dependancies . . . . . . . . . . . . . . . . . . 1451.83.2 FloatE class: byte-order dependencies . . . . . . . . . . . . . . . . . . . 1461.83.3 FloatE class: characterization . . . . . . . . . . . . . . . . . . . . . . . . . . . 1461.83.4 FloatE class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1461.83.5 FloatE: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1461.83.6 FloatE: coercing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1471.83.7 FloatE: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
1.84 FloatQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1471.84.1 FloatQ class: byte-order dependancies . . . . . . . . . . . . . . . . . . 1471.84.2 FloatQ class: characterization . . . . . . . . . . . . . . . . . . . . . . . . . . 1481.84.3 FloatQ class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1481.84.4 FloatQ: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1481.84.5 FloatQ: coercing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1491.84.6 FloatQ: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
1.85 Fraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1491.85.1 Fraction class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1491.85.2 Fraction class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 1491.85.3 Fraction: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1501.85.4 Fraction: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1501.85.5 Fraction: coercing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1501.85.6 Fraction: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1501.85.7 Fraction: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511.85.8 Fraction: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511.85.9 Fraction: optimized cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511.85.10 Fraction: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511.85.11 Fraction: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
1.86 Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1521.86.1 Generator class: instance creation . . . . . . . . . . . . . . . . . . . . . . 1521.86.2 Generator: stream protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
1.87 Getopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1531.87.1 Getopt class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.88 Halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1541.88.1 Halt: description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
1.89 HashedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1541.89.1 HashedCollection class: instance creation . . . . . . . . . . . . . . . 1541.89.2 HashedCollection: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
xiii
1.89.3 HashedCollection: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1551.89.4 HashedCollection: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1551.89.5 HashedCollection: enumerating the elements of a collection . . 1551.89.6 HashedCollection: rehashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1551.89.7 HashedCollection: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1551.89.8 HashedCollection: saving and loading . . . . . . . . . . . . . . . . . . . 1551.89.9 HashedCollection: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561.89.10 HashedCollection: testing collections . . . . . . . . . . . . . . . . . . . 156
1.90 HomedAssociation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561.90.1 HomedAssociation class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . 1561.90.2 HomedAssociation: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561.90.3 HomedAssociation: finalization . . . . . . . . . . . . . . . . . . . . . . . . . 1561.90.4 HomedAssociation: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.91 IdentityDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1571.92 IdentitySet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.92.1 IdentitySet: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1571.93 Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.93.1 Integer class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1571.93.2 Integer: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1571.93.3 Integer: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1571.93.4 Integer: bit operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581.93.5 Integer: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581.93.6 Integer: extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591.93.7 Integer: iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591.93.8 Integer: math methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591.93.9 Integer: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591.93.10 Integer: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1601.93.11 Integer: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.94 Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611.94.1 Interval class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 1611.94.2 Interval: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611.94.3 Interval: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611.94.4 Interval: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1621.94.5 Interval: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
1.95 Iterable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1621.95.1 Iterable class: multibyte encodings . . . . . . . . . . . . . . . . . . . . . . 1621.95.2 Iterable: enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1621.95.3 Iterable: iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1631.95.4 Iterable: streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
1.96 LargeArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1641.96.1 LargeArray: overridden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
1.97 LargeArrayedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1641.97.1 LargeArrayedCollection class: instance creation . . . . . . . . . 1641.97.2 LargeArrayedCollection: accessing . . . . . . . . . . . . . . . . . . . . . . 1641.97.3 LargeArrayedCollection: basic . . . . . . . . . . . . . . . . . . . . . . . . . . 164
1.98 LargeByteArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1651.98.1 LargeByteArray: overridden . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
1.99 LargeInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
xiv GNU Smalltalk Library Reference
1.99.1 LargeInteger: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1651.99.2 LargeInteger: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1651.99.3 LargeInteger: bit operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1661.99.4 LargeInteger: built-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1661.99.5 LargeInteger: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1671.99.6 LargeInteger: disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1671.99.7 LargeInteger: primitive operations . . . . . . . . . . . . . . . . . . . . . . 1671.99.8 LargeInteger: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
1.100 LargeNegativeInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1681.100.1 LargeNegativeInteger: converting . . . . . . . . . . . . . . . . . . . . . . 1681.100.2 LargeNegativeInteger: numeric testing . . . . . . . . . . . . . . . . . 1681.100.3 LargeNegativeInteger: reverting to LargePositiveInteger . . 168
1.101 LargePositiveInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1691.101.1 LargePositiveInteger: arithmetic . . . . . . . . . . . . . . . . . . . . . . . 1691.101.2 LargePositiveInteger: converting . . . . . . . . . . . . . . . . . . . . . . . 1691.101.3 LargePositiveInteger: helper byte-level methods . . . . . . . . 1691.101.4 LargePositiveInteger: numeric testing . . . . . . . . . . . . . . . . . . 1701.101.5 LargePositiveInteger: primitive operations . . . . . . . . . . . . . 170
1.102 LargeWordArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1701.102.1 LargeWordArray: overridden . . . . . . . . . . . . . . . . . . . . . . . . . . 170
1.103 LargeZeroInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711.103.1 LargeZeroInteger: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711.103.2 LargeZeroInteger: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . 1711.103.3 LargeZeroInteger: numeric testing . . . . . . . . . . . . . . . . . . . . . 1711.103.4 LargeZeroInteger: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
1.104 Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721.104.1 Link class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721.104.2 Link: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721.104.3 Link: iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
1.105 LinkedList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721.105.1 LinkedList: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721.105.2 LinkedList: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731.105.3 LinkedList: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731.105.4 LinkedList: iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731.105.5 LinkedList: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
1.106 LookupKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731.106.1 LookupKey class: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.106.2 LookupKey: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.106.3 LookupKey: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.106.4 LookupKey: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.106.5 LookupKey: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
1.107 LookupTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.107.1 LookupTable class: instance creation . . . . . . . . . . . . . . . . . . 1741.107.2 LookupTable: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741.107.3 LookupTable: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751.107.4 LookupTable: hashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751.107.5 LookupTable: rehashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751.107.6 LookupTable: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
xv
1.107.7 LookupTable: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751.108 Magnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
1.108.1 Magnitude: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1761.108.2 Magnitude: misc methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
1.109 MappedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1761.109.1 MappedCollection class: instance creation . . . . . . . . . . . . . 1771.109.2 MappedCollection: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
1.110 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1781.110.1 Memory class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
1.111 Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1801.111.1 Message class: creating instances . . . . . . . . . . . . . . . . . . . . . . 1801.111.2 Message: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1801.111.3 Message: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1811.111.4 Message: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
1.112 MessageNotUnderstood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1811.112.1 MessageNotUnderstood: accessing . . . . . . . . . . . . . . . . . . . . . 1811.112.2 MessageNotUnderstood: description . . . . . . . . . . . . . . . . . . . 181
1.113 Metaclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1811.113.1 Metaclass class: instance creation . . . . . . . . . . . . . . . . . . . . . . 1821.113.2 Metaclass: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1821.113.3 Metaclass: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1821.113.4 Metaclass: compiling methods . . . . . . . . . . . . . . . . . . . . . . . . . 1821.113.5 Metaclass: delegation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1821.113.6 Metaclass: filing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1831.113.7 Metaclass: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1831.113.8 Metaclass: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . 184
1.114 MethodContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1841.114.1 MethodContext: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1841.114.2 MethodContext: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1841.114.3 MethodContext: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
1.115 MethodDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851.115.1 MethodDictionary: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851.115.2 MethodDictionary: rehashing . . . . . . . . . . . . . . . . . . . . . . . . . . 1851.115.3 MethodDictionary: removing . . . . . . . . . . . . . . . . . . . . . . . . . . 185
1.116 MethodInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851.116.1 MethodInfo: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851.116.2 MethodInfo: equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
1.117 Namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861.117.1 Namespace class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861.117.2 Namespace class: disabling instance creation . . . . . . . . . . . 1861.117.3 Namespace class: initialization . . . . . . . . . . . . . . . . . . . . . . . . . 1861.117.4 Namespace: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861.117.5 Namespace: namespace hierarchy . . . . . . . . . . . . . . . . . . . . . . 1871.117.6 Namespace: overrides for superspaces . . . . . . . . . . . . . . . . . . 1871.117.7 Namespace: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
1.118 NetClients.URIResolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1881.118.1 NetClients.URIResolver class: api . . . . . . . . . . . . . . . . . . . . . 1881.118.2 NetClients.URIResolver class: instance creation . . . . . . . . 188
xvi GNU Smalltalk Library Reference
1.119 NetClients.URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1881.119.1 NetClients.URL class: encoding URLs . . . . . . . . . . . . . . . . . 1881.119.2 NetClients.URL class: instance creation . . . . . . . . . . . . . . . 1891.119.3 NetClients.URL: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891.119.4 NetClients.URL: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . 1901.119.5 NetClients.URL: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1911.119.6 NetClients.URL: initialize-release . . . . . . . . . . . . . . . . . . . . . . 1911.119.7 NetClients.URL: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1911.119.8 NetClients.URL: still unclassified . . . . . . . . . . . . . . . . . . . . . . 1911.119.9 NetClients.URL: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1911.119.10 NetClients.URL: utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
1.120 Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921.120.1 Notification: exception description . . . . . . . . . . . . . . . . . . . . . 192
1.121 NullProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921.121.1 NullProxy class: instance creation . . . . . . . . . . . . . . . . . . . . . 1921.121.2 NullProxy: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
1.122 NullValueHolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921.122.1 NullValueHolder class: creating instances . . . . . . . . . . . . . . 1931.122.2 NullValueHolder: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
1.123 Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931.123.1 Number class: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931.123.2 Number class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931.123.3 Number: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931.123.4 Number: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1941.123.5 Number: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1941.123.6 Number: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1941.123.7 Number: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1951.123.8 Number: error raising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1951.123.9 Number: misc math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1951.123.10 Number: point creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1971.123.11 Number: retrying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1971.123.12 Number: shortcuts and iterators . . . . . . . . . . . . . . . . . . . . . . 1971.123.13 Number: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1981.123.14 Number: truncation and round off . . . . . . . . . . . . . . . . . . . . 199
1.124 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1991.124.1 Object class: initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1991.124.2 Object: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1991.124.3 Object: change and update . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2031.124.4 Object: class type methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.5 Object: compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.6 Object: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.7 Object: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.8 Object: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.9 Object: dependents access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041.124.10 Object: error raising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2051.124.11 Object: finalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2051.124.12 Object: introspection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2051.124.13 Object: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
xvii
1.124.14 Object: relational operators . . . . . . . . . . . . . . . . . . . . . . . . . . 2061.124.15 Object: saving and loading . . . . . . . . . . . . . . . . . . . . . . . . . . . 2061.124.16 Object: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071.124.17 Object: syntax shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071.124.18 Object: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . 2071.124.19 Object: VM callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
1.125 ObjectDumper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2091.125.1 ObjectDumper class: establishing proxy classes . . . . . . . . 2091.125.2 ObjectDumper class: instance creation . . . . . . . . . . . . . . . . 2091.125.3 ObjectDumper class: shortcuts . . . . . . . . . . . . . . . . . . . . . . . . 2091.125.4 ObjectDumper class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . 2091.125.5 ObjectDumper: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2101.125.6 ObjectDumper: loading/dumping objects . . . . . . . . . . . . . . 2101.125.7 ObjectDumper: stream interface . . . . . . . . . . . . . . . . . . . . . . . 210
1.126 ObjectMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2101.126.1 ObjectMemory class: accessing . . . . . . . . . . . . . . . . . . . . . . . . 2101.126.2 ObjectMemory class: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . 2101.126.3 ObjectMemory class: initialization . . . . . . . . . . . . . . . . . . . . . 2121.126.4 ObjectMemory class: saving the image . . . . . . . . . . . . . . . . . 2121.126.5 ObjectMemory: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2121.126.6 ObjectMemory: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2141.126.7 ObjectMemory: derived information . . . . . . . . . . . . . . . . . . . 214
1.127 OrderedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2151.127.1 OrderedCollection class: instance creation . . . . . . . . . . . . . 2151.127.2 OrderedCollection: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 2151.127.3 OrderedCollection: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2151.127.4 OrderedCollection: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . 2161.127.5 OrderedCollection: enumerating . . . . . . . . . . . . . . . . . . . . . . . 2161.127.6 OrderedCollection: removing . . . . . . . . . . . . . . . . . . . . . . . . . . 216
1.128 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2171.128.1 Package class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2171.128.2 Package class: instance creation . . . . . . . . . . . . . . . . . . . . . . . 2171.128.3 Package: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2171.128.4 Package: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2191.128.5 Package: version parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
1.129 PackageLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2201.129.1 PackageLoader class: accessing . . . . . . . . . . . . . . . . . . . . . . . . 2201.129.2 PackageLoader class: loading . . . . . . . . . . . . . . . . . . . . . . . . . . 2211.129.3 PackageLoader class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
1.130 Permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2211.130.1 Permission class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2211.130.2 Permission: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2221.130.3 Permission: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
1.131 PluggableAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2231.131.1 PluggableAdaptor class: creating instances . . . . . . . . . . . . 2231.131.2 PluggableAdaptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 223
1.132 PluggableProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2231.132.1 PluggableProxy class: accessing . . . . . . . . . . . . . . . . . . . . . . . 224
xviii GNU Smalltalk Library Reference
1.132.2 PluggableProxy: saving and restoring . . . . . . . . . . . . . . . . . . 2241.133 Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
1.133.1 Point class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . 2241.133.2 Point: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2241.133.3 Point: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2241.133.4 Point: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2251.133.5 Point: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2251.133.6 Point: point functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2251.133.7 Point: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2261.133.8 Point: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2261.133.9 Point: truncation and round off . . . . . . . . . . . . . . . . . . . . . . . . 226
1.134 PositionableStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2261.134.1 PositionableStream class: instance creation . . . . . . . . . . . . 2261.134.2 PositionableStream: accessing-reading . . . . . . . . . . . . . . . . . 2261.134.3 PositionableStream: class type methods . . . . . . . . . . . . . . . 2271.134.4 PositionableStream: compiling . . . . . . . . . . . . . . . . . . . . . . . . . 2271.134.5 PositionableStream: positioning . . . . . . . . . . . . . . . . . . . . . . . 2281.134.6 PositionableStream: still unclassified . . . . . . . . . . . . . . . . . . . 2281.134.7 PositionableStream: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 2281.134.8 PositionableStream: truncating . . . . . . . . . . . . . . . . . . . . . . . . 228
1.135 Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2281.135.1 Process: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2281.135.2 Process: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2291.135.3 Process: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2301.135.4 Process: debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2301.135.5 Process: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
1.136 ProcessEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2301.136.1 ProcessEnvironment class: disabled . . . . . . . . . . . . . . . . . . . . 2301.136.2 ProcessEnvironment class: singleton . . . . . . . . . . . . . . . . . . . 2301.136.3 ProcessEnvironment: accessing . . . . . . . . . . . . . . . . . . . . . . . . 2311.136.4 ProcessEnvironment: dictionary removing . . . . . . . . . . . . . 2311.136.5 ProcessEnvironment: dictionary testing . . . . . . . . . . . . . . . . 231
1.137 ProcessorScheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2321.137.1 ProcessorScheduler class: instance creation . . . . . . . . . . . . 2321.137.2 ProcessorScheduler: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2321.137.3 ProcessorScheduler: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . 2331.137.4 ProcessorScheduler: idle tasks . . . . . . . . . . . . . . . . . . . . . . . . . 2331.137.5 ProcessorScheduler: printing . . . . . . . . . . . . . . . . . . . . . . . . . . 2331.137.6 ProcessorScheduler: priorities . . . . . . . . . . . . . . . . . . . . . . . . . . 2331.137.7 ProcessorScheduler: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2341.137.8 ProcessorScheduler: timed invocation . . . . . . . . . . . . . . . . . . 234
1.138 ProcessVariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2341.138.1 ProcessVariable class: accessing . . . . . . . . . . . . . . . . . . . . . . . 2341.138.2 ProcessVariable: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
1.139 Promise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2351.139.1 Promise class: creating instances . . . . . . . . . . . . . . . . . . . . . . 2351.139.2 Promise: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2351.139.3 Promise: initializing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
xix
1.139.4 Promise: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2361.139.5 Promise: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
1.140 Random . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2361.140.1 Random class: instance creation . . . . . . . . . . . . . . . . . . . . . . . 2361.140.2 Random class: shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2361.140.3 Random: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2361.140.4 Random: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
1.141 ReadStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2371.141.1 ReadStream class: instance creation . . . . . . . . . . . . . . . . . . . 237
1.142 ReadWriteStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2371.142.1 ReadWriteStream class: instance creation . . . . . . . . . . . . . . 2371.142.2 ReadWriteStream: positioning . . . . . . . . . . . . . . . . . . . . . . . . . 237
1.143 Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2381.143.1 Rectangle class: instance creation . . . . . . . . . . . . . . . . . . . . . . 2381.143.2 Rectangle: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2381.143.3 Rectangle: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2391.143.4 Rectangle: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2401.143.5 Rectangle: rectangle functions . . . . . . . . . . . . . . . . . . . . . . . . . 2401.143.6 Rectangle: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2401.143.7 Rectangle: transforming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2411.143.8 Rectangle: truncation and round off . . . . . . . . . . . . . . . . . . . 241
1.144 RecursionLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2411.144.1 RecursionLock class: instance creation . . . . . . . . . . . . . . . . . 2411.144.2 RecursionLock: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2411.144.3 RecursionLock: mutual exclusion . . . . . . . . . . . . . . . . . . . . . . 2421.144.4 RecursionLock: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
1.145 Regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2421.145.1 Regex class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 2421.145.2 Regex: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2421.145.3 Regex: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2431.145.4 Regex: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
1.146 RegexResults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2431.146.1 RegexResults: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2431.146.2 RegexResults: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
1.147 RootNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2441.147.1 RootNamespace class: instance creation . . . . . . . . . . . . . . . 2441.147.2 RootNamespace: namespace hierarchy . . . . . . . . . . . . . . . . . 2451.147.3 RootNamespace: overrides for superspaces . . . . . . . . . . . . . 2451.147.4 RootNamespace: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
1.148 RunArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2451.148.1 RunArray class: instance creation . . . . . . . . . . . . . . . . . . . . . 2451.148.2 RunArray: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2451.148.3 RunArray: adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461.148.4 RunArray: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461.148.5 RunArray: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461.148.6 RunArray: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461.148.7 RunArray: removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2471.148.8 RunArray: searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
xx GNU Smalltalk Library Reference
1.148.9 RunArray: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2471.149 ScaledDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
1.149.1 ScaledDecimal class: instance creation . . . . . . . . . . . . . . . . . 2471.149.2 ScaledDecimal: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2471.149.3 ScaledDecimal: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2481.149.4 ScaledDecimal: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2481.149.5 ScaledDecimal: constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2491.149.6 ScaledDecimal: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2491.149.7 ScaledDecimal: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
1.150 SecurityPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2491.150.1 SecurityPolicy: modifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2491.150.2 SecurityPolicy: querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
1.151 Semaphore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2501.151.1 Semaphore class: instance creation . . . . . . . . . . . . . . . . . . . . 2501.151.2 Semaphore: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2501.151.3 Semaphore: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2501.151.4 Semaphore: mutual exclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 2511.151.5 Semaphore: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
1.152 SequenceableCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2511.152.1 SequenceableCollection class: instance creation . . . . . . . . 2511.152.2 SequenceableCollection: basic . . . . . . . . . . . . . . . . . . . . . . . . . 2511.152.3 SequenceableCollection: comparing . . . . . . . . . . . . . . . . . . . . 2531.152.4 SequenceableCollection: concatenating . . . . . . . . . . . . . . . . . 2531.152.5 SequenceableCollection: copying SequenceableCollections . . 2541.152.6 SequenceableCollection: enumerating . . . . . . . . . . . . . . . . . . 2551.152.7 SequenceableCollection: manipulation . . . . . . . . . . . . . . . . . 2561.152.8 SequenceableCollection: replacing items . . . . . . . . . . . . . . . 2561.152.9 SequenceableCollection: sorting . . . . . . . . . . . . . . . . . . . . . . . . 2571.152.10 SequenceableCollection: still unclassified . . . . . . . . . . . . . . 2571.152.11 SequenceableCollection: testing . . . . . . . . . . . . . . . . . . . . . . . 2571.152.12 SequenceableCollection: testing collections . . . . . . . . . . . . 257
1.153 Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2571.153.1 Set: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2571.153.2 Set: awful ST-80 compatibility hacks . . . . . . . . . . . . . . . . . . 2581.153.3 Set: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
1.154 SharedQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2581.154.1 SharedQueue class: instance creation . . . . . . . . . . . . . . . . . . 2581.154.2 SharedQueue: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
1.155 SingletonProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2581.155.1 SingletonProxy class: accessing . . . . . . . . . . . . . . . . . . . . . . . . 2591.155.2 SingletonProxy class: instance creation . . . . . . . . . . . . . . . . 2591.155.3 SingletonProxy: saving and restoring . . . . . . . . . . . . . . . . . . 259
1.156 SmallInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2591.156.1 SmallInteger class: getting limits . . . . . . . . . . . . . . . . . . . . . . 2591.156.2 SmallInteger class: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2591.156.3 SmallInteger: bit arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . 2591.156.4 SmallInteger: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2591.156.5 SmallInteger: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
xxi
1.156.6 SmallInteger: coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2611.156.7 SmallInteger: coercion methods . . . . . . . . . . . . . . . . . . . . . . . . 2611.156.8 SmallInteger: testing functionality . . . . . . . . . . . . . . . . . . . . . 261
1.157 SortedCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2611.157.1 SortedCollection class: hacking . . . . . . . . . . . . . . . . . . . . . . . . 2621.157.2 SortedCollection class: instance creation . . . . . . . . . . . . . . . 2621.157.3 SortedCollection: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2621.157.4 SortedCollection: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2621.157.5 SortedCollection: disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2621.157.6 SortedCollection: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . 2631.157.7 SortedCollection: saving and loading . . . . . . . . . . . . . . . . . . 2631.157.8 SortedCollection: searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2631.157.9 SortedCollection: sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
1.158 Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2631.158.1 Stream: accessing-reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2631.158.2 Stream: accessing-writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2651.158.3 Stream: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2651.158.4 Stream: buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2651.158.5 Stream: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2651.158.6 Stream: character writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2661.158.7 Stream: compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2661.158.8 Stream: concatenating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2661.158.9 Stream: enumerating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2661.158.10 Stream: filing out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2661.158.11 Stream: filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2671.158.12 Stream: polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2671.158.13 Stream: positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2671.158.14 Stream: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681.158.15 Stream: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681.158.16 Stream: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681.158.17 Stream: streaming protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681.158.18 Stream: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
1.159 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691.159.1 String class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . 2691.159.2 String class: multibyte encodings . . . . . . . . . . . . . . . . . . . . . . 2691.159.3 String: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691.159.4 String: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691.159.5 String: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2701.159.6 String: CObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2701.159.7 String: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2711.159.8 String: filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2711.159.9 String: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2711.159.10 String: regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2711.159.11 String: still unclassified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2741.159.12 String: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 274
1.160 Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2741.160.1 Symbol class: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2741.160.2 Symbol class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . 274
xxii GNU Smalltalk Library Reference
1.160.3 Symbol class: symbol table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2751.160.4 Symbol: accessing the method dictionary . . . . . . . . . . . . . . 2751.160.5 Symbol: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2751.160.6 Symbol: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2761.160.7 Symbol: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2761.160.8 Symbol: misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2761.160.9 Symbol: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2761.160.10 Symbol: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2761.160.11 Symbol: testing functionality . . . . . . . . . . . . . . . . . . . . . . . . . 277
1.161 SymLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2771.161.1 SymLink class: instance creation . . . . . . . . . . . . . . . . . . . . . . 2771.161.2 SymLink: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2771.161.3 SymLink: iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2771.161.4 SymLink: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
1.162 SystemDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2771.162.1 SystemDictionary class: initialization . . . . . . . . . . . . . . . . . . 2771.162.2 SystemDictionary: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2781.162.3 SystemDictionary: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2781.162.4 SystemDictionary: c call-outs . . . . . . . . . . . . . . . . . . . . . . . . . . 2781.162.5 SystemDictionary: command-line . . . . . . . . . . . . . . . . . . . . . . 2791.162.6 SystemDictionary: miscellaneous . . . . . . . . . . . . . . . . . . . . . . 2791.162.7 SystemDictionary: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2801.162.8 SystemDictionary: profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2801.162.9 SystemDictionary: special accessing . . . . . . . . . . . . . . . . . . . 2801.162.10 SystemDictionary: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
1.163 SystemExceptions.AlreadyDefined . . . . . . . . . . . . . . . . . . . . . . . . . . 2801.163.1 SystemExceptions.AlreadyDefined: accessing . . . . . . . . . . . 280
1.164 SystemExceptions.ArgumentOutOfRange . . . . . . . . . . . . . . . . . . . 2811.164.1 SystemExceptions.ArgumentOutOfRange class: signaling . . 2811.164.2 SystemExceptions.ArgumentOutOfRange: accessing . . . 281
1.165 SystemExceptions.BadReturn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2811.165.1 SystemExceptions.BadReturn: accessing . . . . . . . . . . . . . . . 281
1.166 SystemExceptions.CInterfaceError . . . . . . . . . . . . . . . . . . . . . . . . . . 2811.166.1 SystemExceptions.CInterfaceError: accessing . . . . . . . . . . 281
1.167 SystemExceptions.EmptyCollection . . . . . . . . . . . . . . . . . . . . . . . . . 2821.167.1 SystemExceptions.EmptyCollection: accessing . . . . . . . . . 282
1.168 SystemExceptions.EndOfStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2821.168.1 SystemExceptions.EndOfStream class: signaling . . . . . . . 2821.168.2 SystemExceptions.EndOfStream: accessing . . . . . . . . . . . . 282
1.169 SystemExceptions.FileError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2821.169.1 SystemExceptions.FileError: accessing . . . . . . . . . . . . . . . . . 282
1.170 SystemExceptions.IndexOutOfRange . . . . . . . . . . . . . . . . . . . . . . . 2821.170.1 SystemExceptions.IndexOutOfRange class: signaling . . . 2831.170.2 SystemExceptions.IndexOutOfRange: accessing . . . . . . . . 283
1.171 SystemExceptions.InvalidArgument . . . . . . . . . . . . . . . . . . . . . . . . . 2831.171.1 SystemExceptions.InvalidArgument: accessing . . . . . . . . . 283
1.172 SystemExceptions.InvalidProcessState . . . . . . . . . . . . . . . . . . . . . . 2831.172.1 SystemExceptions.InvalidProcessState: accessing . . . . . . . 283
xxiii
1.173 SystemExceptions.InvalidSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2831.173.1 SystemExceptions.InvalidSize: accessing . . . . . . . . . . . . . . . 284
1.174 SystemExceptions.InvalidState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2841.174.1 SystemExceptions.InvalidState: accessing . . . . . . . . . . . . . . 284
1.175 SystemExceptions.InvalidValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2841.175.1 SystemExceptions.InvalidValue class: signaling . . . . . . . . . 2841.175.2 SystemExceptions.InvalidValue: accessing . . . . . . . . . . . . . . 284
1.176 SystemExceptions.MustBeBoolean . . . . . . . . . . . . . . . . . . . . . . . . . . 2841.176.1 SystemExceptions.MustBeBoolean class: signaling . . . . . 285
1.177 SystemExceptions.MutationError . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851.177.1 SystemExceptions.MutationError class: instance creation . . 2851.177.2 SystemExceptions.MutationError: accessing . . . . . . . . . . . 285
1.178 SystemExceptions.NoRunnableProcess . . . . . . . . . . . . . . . . . . . . . . 2851.178.1 SystemExceptions.NoRunnableProcess: accessing . . . . . . 285
1.179 SystemExceptions.NotEnoughElements . . . . . . . . . . . . . . . . . . . . . 2851.179.1 SystemExceptions.NotEnoughElements class: signaling . . 2851.179.2 SystemExceptions.NotEnoughElements: accessing . . . . . . 285
1.180 SystemExceptions.NotFound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2861.180.1 SystemExceptions.NotFound class: accessing . . . . . . . . . . . 2861.180.2 SystemExceptions.NotFound: accessing . . . . . . . . . . . . . . . . 286
1.181 SystemExceptions.NotImplemented . . . . . . . . . . . . . . . . . . . . . . . . . 2861.181.1 SystemExceptions.NotImplemented: accessing . . . . . . . . . 286
1.182 SystemExceptions.NotIndexable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2861.182.1 SystemExceptions.NotIndexable: accessing . . . . . . . . . . . . . 286
1.183 SystemExceptions.NotYetImplemented . . . . . . . . . . . . . . . . . . . . . 2871.183.1 SystemExceptions.NotYetImplemented: accessing . . . . . . 287
1.184 SystemExceptions.PackageNotAvailable . . . . . . . . . . . . . . . . . . . . 287
1.184.1SystemExceptions.PackageNotAvailable class: still unclassified . . 287
1.184.2 SystemExceptions.PackageNotAvailable: description . . . 2871.185 SystemExceptions.PrimitiveFailed . . . . . . . . . . . . . . . . . . . . . . . . . . 287
1.185.1 SystemExceptions.PrimitiveFailed: accessing . . . . . . . . . . . 2871.186 SystemExceptions.ProcessBeingTerminated . . . . . . . . . . . . . . . . . 287
1.186.1SystemExceptions.ProcessBeingTerminated class: still unclassified . .288
1.186.2 SystemExceptions.ProcessBeingTerminated: accessing . . 2881.187 SystemExceptions.ProcessTerminated . . . . . . . . . . . . . . . . . . . . . . 288
1.187.1 SystemExceptions.ProcessTerminated: accessing . . . . . . . 2881.188 SystemExceptions.ReadOnlyObject . . . . . . . . . . . . . . . . . . . . . . . . . 288
1.188.1 SystemExceptions.ReadOnlyObject: accessing . . . . . . . . . 2881.189 SystemExceptions.SecurityError . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
1.189.1 SystemExceptions.SecurityError class: accessing . . . . . . . 2881.189.2 SystemExceptions.SecurityError: accessing . . . . . . . . . . . . 289
1.190 SystemExceptions.ShouldNotImplement . . . . . . . . . . . . . . . . . . . . 2891.190.1 SystemExceptions.ShouldNotImplement: accessing . . . . . 289
1.191 SystemExceptions.SubclassResponsibility . . . . . . . . . . . . . . . . . . . 2891.191.1 SystemExceptions.SubclassResponsibility: accessing . . . . 289
1.192 SystemExceptions.UnhandledException . . . . . . . . . . . . . . . . . . . . . 289
xxiv GNU Smalltalk Library Reference
1.192.1 SystemExceptions.UnhandledException: accessing . . . . . 2891.193 SystemExceptions.UserInterrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
1.193.1 SystemExceptions.UserInterrupt: accessing . . . . . . . . . . . . 2901.194 SystemExceptions.VerificationError . . . . . . . . . . . . . . . . . . . . . . . . . 290
1.194.1 SystemExceptions.VerificationError: accessing . . . . . . . . . 2901.195 SystemExceptions.VMError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
1.195.1 SystemExceptions.VMError: accessing . . . . . . . . . . . . . . . . . 2901.196 SystemExceptions.WrongArgumentCount . . . . . . . . . . . . . . . . . . . 290
1.196.1 SystemExceptions.WrongArgumentCount: accessing . . . 2901.197 SystemExceptions.WrongClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
1.197.1 SystemExceptions.WrongClass class: signaling . . . . . . . . . 2911.197.2 SystemExceptions.WrongClass: accessing . . . . . . . . . . . . . . 291
1.198 SystemExceptions.WrongMessageSent . . . . . . . . . . . . . . . . . . . . . . 2911.198.1 SystemExceptions.WrongMessageSent class: signaling . . 2911.198.2 SystemExceptions.WrongMessageSent: accessing . . . . . . . 291
1.199 TextCollector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2921.199.1 TextCollector class: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . 2921.199.2 TextCollector: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2921.199.3 TextCollector: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2931.199.4 TextCollector: set up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2931.199.5 TextCollector: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
1.200 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2931.200.1 Time class: basic (UTC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2931.200.2 Time class: builtins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2931.200.3 Time class: clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2941.200.4 Time class: initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2941.200.5 Time class: instance creation . . . . . . . . . . . . . . . . . . . . . . . . . . 2941.200.6 Time: accessing (ANSI for DateAndTimes) . . . . . . . . . . . . 2951.200.7 Time: accessing (non ANSI & for Durations) . . . . . . . . . . 2951.200.8 Time: arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2961.200.9 Time: comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
1.201 True . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2961.201.1 True: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2961.201.2 True: C hacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2971.201.3 True: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
1.202 UndefinedObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2971.202.1 UndefinedObject: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2971.202.2 UndefinedObject: class creation - alternative . . . . . . . . . . . 2971.202.3 UndefinedObject: class polymorphism . . . . . . . . . . . . . . . . . 2981.202.4 UndefinedObject: CObject interoperability . . . . . . . . . . . . 2991.202.5 UndefinedObject: dependents access . . . . . . . . . . . . . . . . . . . 2991.202.6 UndefinedObject: iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2991.202.7 UndefinedObject: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3001.202.8 UndefinedObject: still unclassified . . . . . . . . . . . . . . . . . . . . . 3001.202.9 UndefinedObject: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3001.202.10 UndefinedObject: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
1.203 UnicodeCharacter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3001.203.1 UnicodeCharacter class: built ins . . . . . . . . . . . . . . . . . . . . . . 301
xxv
1.203.2 UnicodeCharacter: coercion methods . . . . . . . . . . . . . . . . . . 3011.204 UnicodeString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
1.204.1 UnicodeString class: converting . . . . . . . . . . . . . . . . . . . . . . . . 3011.204.2 UnicodeString class: multibyte encodings . . . . . . . . . . . . . . 3011.204.3 UnicodeString: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3011.204.4 UnicodeString: built-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3011.204.5 UnicodeString: converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3011.204.6 UnicodeString: multibyte encodings . . . . . . . . . . . . . . . . . . . 302
1.205 ValueAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3021.205.1 ValueAdaptor class: creating instances . . . . . . . . . . . . . . . . . 3021.205.2 ValueAdaptor: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3021.205.3 ValueAdaptor: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
1.206 ValueHolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3021.206.1 ValueHolder class: creating instances . . . . . . . . . . . . . . . . . . 3031.206.2 ValueHolder: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3031.206.3 ValueHolder: initializing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
1.207 VariableBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3031.207.1 VariableBinding: compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3031.207.2 VariableBinding: printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3031.207.3 VariableBinding: saving and loading . . . . . . . . . . . . . . . . . . . 3031.207.4 VariableBinding: storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3041.207.5 VariableBinding: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
1.208 VersionableObjectProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3041.208.1 VersionableObjectProxy class: saving and restoring . . . . 3041.208.2 VersionableObjectProxy: saving and restoring . . . . . . . . . 304
1.209 VFS.ArchiveFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3041.209.1 VFS.ArchiveFile: ArchiveMember protocol . . . . . . . . . . . . 3051.209.2 VFS.ArchiveFile: directory operations . . . . . . . . . . . . . . . . . 3051.209.3 VFS.ArchiveFile: querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3051.209.4 VFS.ArchiveFile: still unclassified . . . . . . . . . . . . . . . . . . . . . 3061.209.5 VFS.ArchiveFile: TmpFileArchiveMember protocol . . . . 306
1.210 VFS.ArchiveMember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3061.210.1 VFS.ArchiveMember: accessing . . . . . . . . . . . . . . . . . . . . . . . . 3061.210.2 VFS.ArchiveMember: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3071.210.3 VFS.ArchiveMember: delegation . . . . . . . . . . . . . . . . . . . . . . . 3071.210.4 VFS.ArchiveMember: directory operations . . . . . . . . . . . . . 3071.210.5 VFS.ArchiveMember: file operations . . . . . . . . . . . . . . . . . . . 3071.210.6 VFS.ArchiveMember: initializing . . . . . . . . . . . . . . . . . . . . . . 3071.210.7 VFS.ArchiveMember: still unclassified . . . . . . . . . . . . . . . . . 3081.210.8 VFS.ArchiveMember: testing . . . . . . . . . . . . . . . . . . . . . . . . . . 308
1.211 VFS.FileWrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3081.211.1 VFS.FileWrapper class: initializing . . . . . . . . . . . . . . . . . . . . 3081.211.2 VFS.FileWrapper class: instance creation . . . . . . . . . . . . . . 3091.211.3 VFS.FileWrapper: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . 3091.211.4 VFS.FileWrapper: basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3091.211.5 VFS.FileWrapper: delegation . . . . . . . . . . . . . . . . . . . . . . . . . . 3091.211.6 VFS.FileWrapper: enumerating . . . . . . . . . . . . . . . . . . . . . . . . 3101.211.7 VFS.FileWrapper: file operations . . . . . . . . . . . . . . . . . . . . . . 310
xxvi GNU Smalltalk Library Reference
1.211.8 VFS.FileWrapper: testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3101.212 VFS.StoredZipMember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
1.212.1 VFS.StoredZipMember: accessing . . . . . . . . . . . . . . . . . . . . . 3111.212.2 VFS.StoredZipMember: opening . . . . . . . . . . . . . . . . . . . . . . . 311
1.213 VFS.TmpFileArchiveMember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3111.213.1 VFS.TmpFileArchiveMember: directory operations . . . . 3111.213.2 VFS.TmpFileArchiveMember: finalization . . . . . . . . . . . . . 3111.213.3 VFS.TmpFileArchiveMember: still unclassified . . . . . . . . . 311
1.214 VFS.ZipFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3121.214.1 VFS.ZipFile: members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
1.215 Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3121.215.1 Warning: exception description . . . . . . . . . . . . . . . . . . . . . . . . 312
1.216 WeakArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3121.216.1 WeakArray class: instance creation . . . . . . . . . . . . . . . . . . . . 3131.216.2 WeakArray: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3131.216.3 WeakArray: conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3131.216.4 WeakArray: loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
1.217 WeakIdentitySet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3141.217.1 WeakIdentitySet: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
1.218 WeakKeyDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3141.218.1 WeakKeyDictionary class: hacks . . . . . . . . . . . . . . . . . . . . . . . 3141.218.2 WeakKeyDictionary: accessing . . . . . . . . . . . . . . . . . . . . . . . . 314
1.219 WeakKeyIdentityDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3141.220 WeakSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
1.220.1 WeakSet: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3151.220.2 WeakSet: copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3151.220.3 WeakSet: loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
1.221 WeakValueIdentityDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3151.222 WeakValueLookupTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
1.222.1 WeakValueLookupTable class: hacks . . . . . . . . . . . . . . . . . . . 3161.222.2 WeakValueLookupTable: hacks . . . . . . . . . . . . . . . . . . . . . . . . 3161.222.3 WeakValueLookupTable: rehashing . . . . . . . . . . . . . . . . . . . . 316
1.223 WordArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3161.223.1 WordArray: built ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
1.224 WriteStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3161.224.1 WriteStream class: instance creation . . . . . . . . . . . . . . . . . . . 3161.224.2 WriteStream: accessing-writing . . . . . . . . . . . . . . . . . . . . . . . . 3171.224.3 WriteStream: positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
1.225 ZeroDivide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3171.225.1 ZeroDivide class: instance creation . . . . . . . . . . . . . . . . . . . . 3171.225.2 ZeroDivide: accessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3171.225.3 ZeroDivide: description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Class index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Method index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Selector cross-reference . . . . . . . . . . . . . . . . . . . . . . . . . . 343