]> Top AbstractNamespace AbstractNamespace Defined in namespace SmalltalkSuperclass: BindingDictionaryCategory: Language-Implementation I am a special form of dictionary. Classes hold onan instance of me; it is called their `environment'. AbstractNamespace class: instance creation new newnew Disabled - use #new to create instances primNew:name: primNew: parent name: spaceName Private - Create a new namespace with the given name and parent, andadd to the parent a key that references it. AbstractNamespace: accessing allAssociationsallAssociations Answer a Dictionary with all of the associations in the receiverand each of its superspaces (duplicate keys are associated to theassociations that are deeper in the namespace hierarchy) allBehaviorsDo: allBehaviorsDo: aBlock Evaluate aBlock once for each class and metaclass in the namespace. allClassesDo: allClassesDo: aBlock Evaluate aBlock once for each class in the namespace. allClassObjectsDo: allClassObjectsDo: aBlock Evaluate aBlock once for each class and metaclass in the namespace. allMetaclassesDo: allMetaclassesDo: aBlock Evaluate aBlock once for each metaclass in the namespace. classAt: classAt: aKey Answer the value corrisponding to aKey if it is a class. Failif either aKey is not found or it is associated to something differentfrom a class. classAt:ifAbsent: classAt: aKey ifAbsent: aBlock Answer the value corrisponding to aKey if it is a class. EvaluateaBlock and answer its result if either aKey is not found or it isassociated to something different from a class. AbstractNamespace: basic & copying == arg Answer whether the receiver is equal to arg. The equality test isby default the same as that for equal objects. = must not fail;answer false if the receiver cannot be compared to arg hash identityHash hash Answer an hash value for the receiver. This is the same as theobject's #identityHash. AbstractNamespace: copying copyEmpty:copyEmpty: newSize Answer an empty copy of the receiver whose size is newSize whileCurrentDo: whileCurrentDo: aBlock Evaluate aBlock with the current namespace set to the receiver.Answer the result of the evaluation. AbstractNamespace: namespace hierarchy addSubspace:addSubspace: aSymbol Add aNamespace to the set of the receiver's subspaces allSubassociationsDo: allSubassociationsDo: aBlock Invokes aBlock once for every association in each of the receiver'ssubspaces. allSubspaces allSubspaces Answer the direct and indirect subspaces of the receiver in a Set allSubspacesDo: allSubspacesDo: aBlock Invokes aBlock for all subspaces, both direct and indirect. allSuperspaces allSuperspaces Answer all the receiver's superspaces in a collection allSuperspacesDo: allSuperspacesDo: aBlock Evaluate aBlock once for each of the receiver's superspaces includesClassNamed: includesKey: includesGlobalNamed: includesClassNamed: aString Answer whether the receiver or any of its superspaces include thegiven class – note that this method (unlike #includesKey:) does notrequire aString to be interned and (unlike #includesGlobalNamed:) onlyreturns true if the global is a class object. includesGlobalNamed: includesKey: includesClassNamed: includesGlobalNamed: aString Answer whether the receiver or any of its superspaces include thegiven key – note that this method (unlike #includesKey:) does notrequire aString to be interned but (unlike #includesClassNamed:)returns true even if the global is not a class object. inheritsFrom: inheritsFrom: aNamespace Answer whether aNamespace is one of the receiver's direct andindirect superspaces selectSubspaces: selectSubspaces: aBlock Return a Set of subspaces of the receiver satisfying aBlock. selectSuperspaces: selectSuperspaces: aBlock Return a Set of superspaces of the receiver satisfying aBlock. siblings siblings Answer all the other children of the same namespace as the receiver. siblingsDo: siblingsDo: aBlock Evaluate aBlock once for each of the other root namespaces,passing the namespace as a parameter. subspaces subspaces Answer the receiver's direct subspaces subspacesDo: subspacesDo: aBlock Invokes aBlock for all direct subspaces. superspace superspace Answer the receiver's superspace. superspace: superspace: aNamespace Set the superspace of the receiver to be 'aNamespace'. Alsoadds the receiver as a subspace of it. withAllSubspaces withAllSubspaces Answer a Set containing the receiver together with its direct andindirect subspaces withAllSubspacesDo: withAllSubspacesDo: aBlock Invokes aBlock for the receiver and all subclasses, both directand indirect. withAllSuperspaces withAllSuperspaces Answer the receiver and all of its superspaces in a collection withAllSuperspacesDo: withAllSuperspacesDo: aBlock Invokes aBlock for the receiver and all superspaces, both directand indirect. AbstractNamespace: overrides for superspaces definedKeysdefinedKeys Answer a kind of Set containing the keys of the receiver definesKey: definesKey: key Answer whether the receiver defines the given key. `Defines'means that the receiver's superspaces, if any, are not considered. hereAt: hereAt: key Return the value associated to the variable named as specifiedby `key' *in this namespace*. If the key is not found search will*not* be carried on in superspaces and the method will fail. hereAt:ifAbsent: hereAt: key ifAbsent: aBlock Return the value associated to the variable named as specifiedby `key' *in this namespace*. If the key is not found search will*not* be carried on in superspaces and aBlock will be immediatelyevaluated. inheritedKeys inheritedKeys Answer a Set of all the keys in the receiver and its superspaces set:to: set: key to: newValue Assign newValue to the variable named as specified by `key'.This method won't define a new variable; instead if the keyis not found it will search in superspaces and raising anerror if the variable cannot be found in any of the superspaces.Answer newValue. set:to:ifAbsent: set: key to: newValue ifAbsent: aBlock Assign newValue to the variable named as specified by `key'.This method won't define a new variable; instead if the keyis not found it will search in superspaces and evaluateaBlock if it is not found. Answer newValue. values values Answer a Bag containing the values of the receiver AbstractNamespace: printing namename Answer the receiver's name name: name: aSymbol Change the receiver's name to aSymbol nameIn: nameIn: aNamespace Answer Smalltalk code compiling to the receiver when the currentnamespace is aNamespace printOn: printOn: aStream Print a representation of the receiver storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver AbstractNamespace: testing isNamespaceisNamespace Answer `true'. isSmalltalk isSmalltalk Answer `false'. AlternativeObjectProxy AlternativeObjectProxy Defined in namespace SmalltalkSuperclass: DumperProxyCategory: Streams-Files I am a proxy that uses the same ObjectDumperto store an object which is not the object to be dumped, but from which thedumped object can be reconstructed. I am an abstract class, using me wouldresult in infinite loops because by default I try to store the same objectagain and again. See the method comments for more information AlternativeObjectProxy class: instance creation acceptUsageForClass:acceptUsageForClass: aClass The receiver was asked to be used as a proxy for the class aClass.Answer whether the registration is fine. By default, answer trueexcept if AlternativeObjectProxy itself is being used. on: on: dumpTo: on: anObject Answer a proxy to be used to save anObject. IMPORTANT: this methodMUST be overridden so that the overridden version sends #on: to superpassing an object that is NOT the same as anObject (alternatively,you can override #dumpTo:, which is what NullProxy does), because thatwould result in an infinite loop! This also means thatAlternativeObjectProxy must never be used directly – only asa superclass. AlternativeObjectProxy: accessing objectobject Reconstruct the object stored in the proxy and answer it. Asubclass will usually override this object: object: theObject Set the object to be dumped to theObject. This should not beoverridden. primObject primObject Reconstruct the object stored in the proxy and answer it. Thismethod must not be overridden ArithmeticError ArithmeticError Defined in namespace SmalltalkSuperclass: HaltCategory: Language-Exceptions An ArithmeticError exception is raised by numeric classes when a programtries to do something wrong, such as extracting the square root of anegative number. ArithmeticError: description descriptiondescription Answer a textual description of the exception. Array Array Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable My instances are objects that have array-like properties: they are directlyindexable by integers starting at 1, and they are fixed in size. I inheritobject creation behavior messages such as #with:, as well as iterationand general access behavior from SequenceableCollection. Array: mutating objects multiBecome:multiBecome: anArray Transform every object in the receiver in each correspondingobject in anArray. anArray and the receiver must have the samesize Array: printing printOn:printOn: aStream Print a representation for the receiver on aStream Array: testing isArrayisArray Answer `true'. ArrayedCollection ArrayedCollection Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable My instances are objects that are generally fixed size, and are accessedby an integer index. The ordering of my instance's elements is determinedexternally; I will not rearrange the order of the elements. ArrayedCollection class: instance creation new:withAll:new: size withAll: anObject Answer a collection with the given size, whose elements are all set toanObject with: with: element1 Answer a collection whose only element is element1 with:with: with: element1 with: element2 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with: with: element1 with: element2 with: element3 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with: with: element1 with: element2 with: element3 with: element4 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with:with: with: element1 with: element2 with: element3 with: element4 with: element5 Answer a collection whose only elements are the parameters in the orderthey were passed withAll: withAll: aCollection Answer a collection whose elements are the same as those in aCollection ArrayedCollection: basic ,, aSequenceableCollection Answer a new instance of an ArrayedCollection containing all the elementsin the receiver, followed by all the elements in aSequenceableCollection add: add: value This method should not be called for instances of this class. copyFrom:to: copyFrom: start to: stop Answer a new collection containing all the items in the receiver from thestart-th and to the stop-th copyWith: copyWith: anElement Answer a new instance of an ArrayedCollection containing all the elementsin the receiver, followed by the single item anElement copyWithout: copyWithout: oldElement Answer a copy of the receiver to which all occurrences of oldElement areremoved ArrayedCollection: built ins sizesize Answer the size of the receiver ArrayedCollection: copying Collections copyReplaceAll:with:copyReplaceAll: oldSubCollection with: newSubCollection Answer a new collection in which all the sequences matchingoldSubCollection are replaced with newSubCollection copyReplaceFrom:to:with: copyReplaceFrom: start to: stop with: replacementCollection Answer 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 thereplacementCollection. Instead, If start = (stop + 1), like in`copyReplaceFrom: 4 to: 3 with: anArray', then every element of the receiverwill be present in the answered copy; the operation will be an append ifstop is equal to the size of the receiver or, if it is not, an insert beforeindex `start'. copyReplaceFrom:to:withObject: copyReplaceFrom: start to: stop withObject: anObject Answer 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 receiverwill be present in the answered copy; the operation will be an append ifstop is equal to the size of the receiver or, if it is not, an insert beforeindex `start'. reverse reverse Answer the receivers' contents in reverse order ArrayedCollection: enumerating the elements of a collection collect:collect: aBlock Answer a new instance of an ArrayedCollection containing all the resultsof evaluating aBlock passing each of the receiver's elements reject: reject: aBlock Answer a new instance of an ArrayedCollection containing all the elementsin the receiver which, when passed to aBlock, answer false select: select: aBlock Answer a new instance of an ArrayedCollection containing all the elementsin the receiver which, when passed to aBlock, answer true with:collect: with: aSequenceableCollection collect: aBlock Evaluate aBlock for each pair of elements took respectively from the re-ceiver and from aSequenceableCollection; answer a collection of the samekind of the receiver, made with the block's return values. Fail if thereceiver has not the same size as aSequenceableCollection. ArrayedCollection: storing storeOn:storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Association 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 hasno conventions associated with it; it can be any object at all. Association class: basic key:value:key: aKey value: aValue Answer a new association with the given key and value Association: accessing environmentenvironment Answer nil. This is present to achieve polymorphism withinstances of VariableBinding. environment: environment: aNamespace Do nothing. This is present to achieve polymorphism withinstances of VariableBinding. key:value: key: aKey value: aValue Set the association's key to aKey, and its value to aValue value value Answer the association's value value: value: aValue Set the association's value to aValue Association: finalization mournmourn Finalize the receiver Association: printing printOn:printOn: aStream Put on aStream a representation of the receiver Association: storing storeOn:storeOn: aStream Put on aStream some Smalltalk code compiling to the receiver Association: testing == anAssociation Answer whether the association's key and value are the same asanAssociation's, or false if anAssociation is not an Association hash hash Answer an hash value for the receiver Autoload 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,you can define any class to be loaded when any message is sent tothe class itself (such as to create an instance) or to its metaclass (suchas #methodsFor: to extend it with class-side methods). Autoload class: instance creation class:from:class: nameSymbol from: fileNameString Make Smalltalk automatically load the class named nameSymbolfrom fileNameString when needed class:in:from: class: nameSymbol in: aNamespace from: fileNameString Make Smalltalk automatically load the class named nameSymboland residing in aNamespace from fileNameString when needed Autoload: accessing classclass We need it to access the metaclass instance, because that's whatwill load the file. doesNotUnderstand: doesNotUnderstand: aMessage Load the class and resend the message to it AutoloadClass AutoloadClass Defined in namespace SmalltalkSuperclass: noneCategory: Examples-Useful tools I represent the metaclass of an autoloaded class before it is autoloaded.Having a proxy for the metaclass as well allows one to send messages tothe metaclass (such as #methodsFor: to extend it with class-side methods)and have the class autoloaded. AutoloadClass: accessing doesNotUnderstand:doesNotUnderstand: aMessage Load the class and resend the message to its metaclass. environment environment Answer the namespace in which the class will be autoloaded environment: environment: aNamespace Set to aNamespace the namespace in which the class will be autoloaded fileName fileName Answer the name of the file from which the class will be autoloaded fileName: fileName: aString Set to aString the name of the file from which the class will be autoloaded loadedClass loadedClass File-in the file and answer the new value of the association whichheld the receiver loadedMetaclass loadedMetaclass File-in the file and answer the metaclass for the new value of theassociation which held the receiver name name Answer the name of the class to be autoloaded name: name: aSymbol Set to aSymbol the name of the class to be autoloaded Bag Bag Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Unordered My instances are unordered collections of objects. You can thinkof me as a set with a memory; that is, if the same object is added to metwice, then I will report that that element has been stored twice. Bag class: basic newnew Answer a new instance of the receiver new: new: size Answer a new instance of the receiver, with space for size distinctobjects Bag: adding add:add: newObject Add an occurrence of newObject to the receiver. Answer newObject.Fail if newObject is nil. add:withOccurrences: add: newObject withOccurrences: anInteger If anInteger > 0, add anInteger occurrences of newObject to thereceiver. If anInteger < 0, remove them. Answer newObject. Failif newObject is nil. Bag: enumerating the elements of a collection asSetasSet Answer a set with the elements of the receiver do: do: aBlock Evaluate the block for all members in the collection. Bag: extracting items sortedByCountsortedByCount Answer a collection of counts with elements, sorted by decreasing count. Bag: printing printOn:printOn: aStream Put on aStream a representation of the receiver Bag: removing remove:ifAbsent:remove: oldObject ifAbsent: anExceptionBlock Remove oldObject from the collection and return it. If can't befound, answer instead the result of evaluationg anExceptionBlock Bag: storing storeOn:storeOn: aStream Put on aStream some Smalltalk code compiling to the receiver Bag: testing collections == aBag Answer whether the receiver and aBag contain the same objects hash hash Answer an hash value for the receiver includes: includes: anObject Answer whether we include anObject occurrencesOf: occurrencesOf: anObject Answer the number of occurrences of anObject found in the receiver size size Answer the total number of objects found in the receiver Behavior Behavior Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I am the parent class of all "class" type methods. My instances knowabout the subclass/superclass relationships between classes, containthe description that instances are created from, and hold the methoddictionary that's associated with each class. I provide methods forcompiling methods, modifying the class inheritance hierarchy, examining themethod dictionary, and iterating over the class hierarchy. Behavior: accessing class hierarchy allSubclassesallSubclasses Answer the direct and indirect subclasses of the receiver in a Set allSuperclasses allSuperclasses Answer all the receiver's superclasses in a collection subclasses subclasses Answer the direct subclasses of the receiver in a Set superclass superclass Answer the receiver's superclass (if any, otherwise answer nil) withAllSubclasses withAllSubclasses Answer a Set containing the receiver together with its direct andindirect subclasses withAllSuperclasses withAllSuperclasses Answer the receiver and all of its superclasses in a collection Behavior: accessing instances and variables allClassVarNamesallClassVarNames Return all the class variables understood by the receiver allInstances allInstances Returns a set of all instances of the receiver allInstVarNames allInstVarNames Answer the names of every instance variables the receiver contained in thereceiver's instances allSharedPools allSharedPools Return the names of the shared pools defined by the class and any ofits superclasses classPool classPool Answer the class pool dictionary. Since Behavior does not supportclasses with class variables, we answer an empty one; addingvariables to it results in an error. classVarNames classVarNames Answer all the class variables for instances of the receiver instanceCount instanceCount Return a count of all the instances of the receiver instVarNames instVarNames Answer an Array containing the instance variables defined by the receiver sharedPools sharedPools Return the names of the shared pools defined by the class subclassInstVarNames subclassInstVarNames Answer the names of the instance variables the receiver inherited from itssuperclass Behavior: accessing the methodDictionary >>>> selector Return the compiled method associated with selector, from the localmethod dictionary. Error if not found. allSelectors allSelectors Answer a Set of all the selectors understood by the receiver compiledMethodAt: compiledMethodAt: selector Return the compiled method associated with selector, from the localmethod dictionary. Error if not found. compiledMethodAt:ifAbsent: compiledMethodAt: selector ifAbsent: aBlock Return the compiled method associated with selector, from the localmethod dictionary. Evaluate aBlock if not found. selectorAt: selectorAt: method Return selector for the given compiledMethod selectors selectors Answer a Set of the receiver's selectors sourceCodeAt: sourceCodeAt: selector Answer source code (if available) for the given compiledMethod sourceMethodAt: sourceMethodAt: selector This is too dependent on the original implementation Behavior: built ins basicNewbasicNew Create a new instance of a class with no indexed instance variables;this method must not be overridden. basicNew: basicNew: numInstanceVariables Create a new instance of a class with indexed instance variables. Theinstance has numInstanceVariables indexed instance variables;this method must not be overridden. basicNewInFixedSpace basicNew basicNewInFixedSpace Create a new instance of a class with no indexed instance variables.The instance is guaranteed not to move across garbage collections.Like #basicNew, this method should not be overridden. basicNewInFixedSpace: basicNew: basicNewInFixedSpace: numInstanceVariables Create a new instance of a class with indexed instance variables. Theinstance has numInstanceVariables indexed instance variables. Theinstance is guaranteed not to move across garbage collections. Like#basicNew:, this method should not be overridden. compileString: compileString: aString Compile the code in aString, with no category. Fail if the codedoes not obey Smalltalk syntax. Answer the generated CompiledMethodif it does compileString:ifError: compileString: aString ifError: aBlock Compile the code in aString, with no category. Evaluate aBlock(passing the file name, line number and description of the error) ifthe code does not obey Smalltalk syntax. Answer the generatedCompiledMethod if it does flushCache flushCache Invalidate the method cache kept by the virtual machine. Thismessage should not need to be called by user programs. methodsFor:ifTrue: methodsFor: category ifTrue: condition Compile the following code inside the receiver, with the givencategory, if condition is true; else ignore it new new Create a new instance of a class with no indexed instance variables new: new: numInstanceVariables Create a new instance of a class with indexed instance variables. Theinstance has numInstanceVariables indexed instance variables. someInstance someInstance Private - Answer the first instance of the receiver in the objecttable Behavior: compilation (alternative) methodsmethods Don't use this, it's only present to file in from Smalltalk/V methodsFor methodsFor Don't use this, it's only present to file in from Dolphin Smalltalk methodsFor:ifFeatures: methodsFor: category ifFeatures: features Start compiling methods in the receiver if this implementation ofSmalltalk has the given features, else skip the section methodsFor:stamp: methodsFor: category stamp: notUsed Don't use this, it's only present to file in from Squeak privateMethods privateMethods Don't use this, it's only present to file in from IBM Smalltalk publicMethods publicMethods Don't use this, it's only present to file in from IBM Smalltalk Behavior: compiling methods methodsFor:methodsFor: aCategoryString Calling this method prepares the parser to receive methods to be compiled and installed in the receiver's method dictionary. The methods are put in the category identified by the parameter. Behavior: creating a class hierarchy addSubclass:addSubclass: aClass Add aClass asone of the receiver's subclasses. removeSubclass: removeSubclass: aClass Remove aClass from the list of the receiver's subclasses superclass: superclass: aClass Set the receiver's superclass. Behavior: enumerating allInstancesDo:allInstancesDo: aBlock Invokes aBlock for all instances of the receiver allSubclassesDo: allSubclassesDo: aBlock Invokes aBlock for all subclasses, both direct and indirect. allSubinstancesDo: allSubinstancesDo: aBlock Invokes aBlock for all instances of each of the receiver's subclasses. allSuperclassesDo: allSuperclassesDo: aBlock Invokes aBlock for all superclasses, both direct and indirect. selectSubclasses: selectSubclasses: aBlock Return a Set of subclasses of the receiver satisfying aBlock. selectSuperclasses: selectSuperclasses: aBlock Return a Set of superclasses of the receiver satisfying aBlock. subclassesDo: subclassesDo: aBlock Invokes aBlock for all direct subclasses. withAllSubclassesDo: withAllSubclassesDo: aBlock Invokes aBlock for the receiver and all subclasses, both directand indirect. withAllSuperclassesDo: withAllSuperclassesDo: aBlock Invokes aBlock for the receiver and all superclasses, both directand indirect. Behavior: evaluating evalString:to:evalString: aString to: anObject Answer the stack top at the end of the evaluation of the code inaString. The code is executed as part of anObject evalString:to:ifError: evalString: aString to: anObject ifError: aBlock Answer the stack top at the end of the evaluation of the code inaString. If aString cannot be parsed, evaluate aBlock (seecompileString:ifError:). The code is executed as part of anObject evaluate: evaluate: code Evaluate Smalltalk expression in 'code' and return result. evaluate:ifError: evaluate: code ifError: block Evaluate 'code'. If a parsing error is detected, invoke 'block' evaluate:notifying: error: evaluate: code notifying: requestor Evaluate Smalltalk expression in 'code'. If a parsing error is encountered,send #error: to requestor evaluate:to: evaluate: code to: anObject Evaluate Smalltalk expression as part of anObject's method definition evaluate:to:ifError: evaluate: code to: anObject ifError: block Evaluate 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' Behavior: instance creation newInFixedSpace newnewInFixedSpace Create a new instance of a class without indexed instance variables.The instance is guaranteed not to move across garbage collections.If a subclass overrides #new, the changes will apply to this method too. newInFixedSpace: new: newInFixedSpace: numInstanceVariables Create a new instance of a class with indexed instance variables. Theinstance has numInstanceVariables indexed instance variables. Theinstance is guaranteed not to move across garbage collections. Ifa subclass overrides #new:, the changes will apply to this method too. Behavior: instance variables addInstVarName:addInstVarName: aString Add the given instance variable to instance of the receiver removeInstVarName: removeInstVarName: aString Remove the given instance variable from the receiver and recompileall of the receiver's subclasses Behavior: method dictionary addSelector:withMethod:addSelector: selector withMethod: compiledMethod Add the given compiledMethod to the method dictionary, giving itthe passed selector. Answer compiledMethod compile: compile: code Compile method source. If there are parsing errors, answer nil.Else, return a CompiledMethod result of compilation compile:ifError: compile: code ifError: block Compile method source. If there are parsing errors, invokeexception block, 'block' passing file name, line number and error.description. Return a CompiledMethod result of compilation compile:notifying: error:to compile: code notifying: requestor Compile method source. If there are parsing errors, send #error:to the requestor object, else return a CompiledMethod result ofcompilation compileAll compileAll Recompile all selectors in the receiver. Ignore errors. compileAll: error: compileAll: aNotifier Recompile all selectors in the receiver. Notify aNotifier by sen-ding #error: messages if something goes wrong. compileAllSubclasses error: compileAllSubclasses Recompile all selector of all subclasses. Notify aNotifier by sen-ding #error: messages if something goes wrong. compileAllSubclasses: error: compileAllSubclasses: aNotifier Recompile all selector of all subclasses. Notify aNotifier by sen-ding #error: messages if something goes wrong. createGetMethod: createGetMethod: what Create a method accessing the variable `what'. createGetMethod:default: createGetMethod: what default: value Create a method accessing the variable `what', with a default valueof `value', using lazy initialization createSetMethod: createSetMethod: what Create a method which sets the variable `what'. decompile: decompile: selector Decompile the bytecodes for the given selector. defineAsyncCFunc:withSelectorArgs:args: defineAsyncCFunc: cFuncNameString withSelectorArgs: selectorAndArgs args: argsArrayPlease lookup the part on the C interface in the manual. This methodis deprecated, you should use the asyncCCall:args: attribute. defineCFunc:withSelectorArgs:returning:args: defineCFunc: cFuncNameString withSelectorArgs: selectorAndArgs returning: returnTypeSymbol args: argsArrayPlease lookup the part on the C interface in the manual. This methodis deprecated, you should use the cCall:returning:args: attribute. edit: edit: selector Open Emacs to edit the method with the passed selector, then compile it methodDictionary methodDictionary Answer the receiver's method dictionary. Don't modify the methoddictionary unless you exactly know what you're doing methodDictionary: methodDictionary: aDictionary Set the receiver's method dictionary to aDictionary recompile: recompile: selector Recompile the given selector, answer nil if something goes wrong orthe new CompiledMethod if everything's ok. recompile:notifying: error:to recompile: selector notifying: aNotifier Recompile the given selector. If there are parsing errors, send #error:to the aNotifier object, else return a CompiledMethod result ofcompilation removeSelector: removeSelector: selector Remove the given selector from the method dictionary, answerthe CompiledMethod attached to that selector removeSelector:ifAbsent: removeSelector: selector ifAbsent: aBlock Remove the given selector from the method dictionary, answerthe CompiledMethod attached to that selector. If the selector cannotbe found, answer the result of evaluating aBlock. selectorsAndMethodsDo: selectorsAndMethodsDo: aBlock Evaluate aBlock, passing for each evaluation a selector that'sdefined in the receiver and the corresponding method. Behavior: pluggable behavior (not yet implemented) compilerClasscompilerClass Answer the class that can be used to compile parse trees,or nil if there is none (as is the case now). Notused for methods if parserClass answers nil, and fordoits if evaluatorClass answers nil. debuggerClass debuggingPriority debuggerClass Answer which class is to be used to debug a chain of contexts whichincludes the receiver. nil means 'do not debug'; other classes aresent #debuggingPriority and the one with the highest priority ispicked. decompilerClass decompilerClass Answer the class that can be used to decompile methods,or nil if there is none (as is the case now). evaluatorClass evaluatorClass Answer the class that can be used to evaluate doits,or nil if there is none (as is the case now). parserClass parserClass Answer the class that can be used to parse methods,or nil if there is none (as is the case now). Behavior: printing hierarchy hierarchyIndent printHierarchyhierarchyIndent Answer the indent to be used by #printHierarchy - 4 by default printHierarchy printHierarchy Print my entire subclass hierarchy on the terminal. printSubclasses:using: printSubclasses: level using: aBlock I print my name, and then all my subclasses, each indented accordingto its position in the hierarchy. I pass aBlock a class name and a level Behavior: support for lightweight classes articlearticle Answer an article (`a' or `an') which is ok for the receiver's name asClass asClass Answer the first superclass that is a full-fledged Class object environment environment Answer the namespace that this class belongs to - the same as thesuperclass, since Behavior does not support namespaces yet. name name Answer the class name; this prints to the name of the superclassenclosed in braces. This class name is used, for example, to printthe receiver. nameIn: nameIn: aNamespace Answer the class name when the class is referenced from aNamespace- a dummy one, since Behavior does not support names. printOn:in: printOn: aStream in: aNamespace Answer the class name when the class is referenced from aNamespace- a dummy one, since Behavior does not support names. securityPolicy securityPolicy Not commented. securityPolicy: securityPolicy: aSecurityPolicy This method should not be called for instances of this class. Behavior: testing functionality isBehaviorisBehavior Answer `true'. Behavior: testing the class hierarchy includesBehavior:includesBehavior: aClass Returns true if aClass is the receiver or a superclass of the receiver. inheritsFrom: inheritsFrom: aClass Returns true if aClass is a superclass of the receiver kindOfSubclass kindOfSubclass Return a string indicating the type of class the receiver is shape shape Not commented. shapes shapes Not commented. Behavior: testing the form of the instances instSizeinstSize Answer how many fixed instance variables are reserved to each of thereceiver's instances isFixed isFixed Answer whether the receiver's instances have no indexedinstance variables isIdentity isIdentity Answer whether x = y implies x == y for instances of the receiver isImmediate isImmediate Answer whether, if x is an instance of the receiver, x copy == x isPointers isPointers Answer whether the instance variables of the receiver's instancesare objects isVariable isVariable Answer whether the receiver's instances have indexed instance variables Behavior: testing the method dictionary canUnderstand:canUnderstand: selector Returns true if the instances of the receiver understandthe given selector hasMethods hasMethods Return whether the receiver has any methods defined includesSelector: includesSelector: selector Returns true if the local method dictionary contains the given selector scopeHas:ifTrue: scopeHas: name ifTrue: aBlock If methods understood by the receiver's instances have access to asymbol named 'name', evaluate aBlock whichClassIncludesSelector: whichClassIncludesSelector: selector Answer which class in the receiver's hierarchy contains the implementationof selector used by instances of the class (nil if none does) whichSelectorsAccess: whichSelectorsAccess: instVarName Answer a Set of selectors which access the given instance variable whichSelectorsAssign: whichSelectorsAssign: instVarName Answer a Set of selectors which read the given instance variable whichSelectorsRead: whichSelectorsRead: instVarName Answer a Set of selectors which read the given instance variable whichSelectorsReferTo: whichSelectorsReferTo: anObject Returns a Set of selectors that refer to anObject whichSelectorsReferToByteCode: whichSelectorsReferToByteCode: aByteCode Return the collection of selectors in the class whichreference the byte code, aByteCode BindingDictionary BindingDictionary Defined in namespace SmalltalkSuperclass: DictionaryCategory: Language-Implementation I am a special form of dictionary that provides special ways to access mykeys, which typically begin with an uppercase letter; also, my associationsare actually VariableBinding instances.My keys are (expected to be) symbols, so I use == to match searched keysto those in the dictionary – this is done expecting that it brings a bitmore speed. BindingDictionary: accessing define: at:put:define: aSymbol Define aSymbol as equal to nil inside the receiver. Fail if sucha variable already exists (use #at:put: if you don't want to fail) doesNotUnderstand: Variable Variable doesNotUnderstand: aMessage Try to map unary selectors to read accesses to the Namespace,and one-argument keyword selectors to write accesses.Note that: a) this works only if the selector has anuppercase first letter; and b) `aNamespace Variable: value' isthe same as `aNamespace set: #Variable to: value', not the same as`aNamespace at: #Variable put: value' — the latter alwaysrefers to the current namespace, while the former won'tdefine a new variable, instead searching in superspaces (andraising an error if the variable cannot be found). environment environment Answer the environment to which the receiver is connected. Thiscan be the class for a dictionary that holds class variables,or the super-namespace. In general it is used to compute thereceiver's name. environment: environment: anObject Set the environment to which the receiver is connected. Thiscan be the class for a dictionary that holds class variables,or the super-namespace. In general it is used to compute thereceiver's name. import:from: import: aSymbol from: aNamespace Add to the receiver the symbol aSymbol, associated to thesame value as in aNamespace. Fail if aNamespace does notcontain the given key. name name Answer the receiver's name, which by default is the same as thename of the receiver's environment. nameIn: nameIn: aNamespace Answer the receiver's name when referred to from aNamespace; bydefault the computation is deferred to the receiver's environment. BindingDictionary: copying copycopy Answer the receiver. copyEmpty: copyEmpty: newSize Answer an empty copy of the receiver whose size is newSize copyEmptyForCollect collect: copyEmptyForCollect Answer an empty copy of the receiver which is filled in tocompute the result of #collect: copyEmptyForCollect: collect: copyEmptyForCollect: size Answer an empty copy of the receiver which is filled in tocompute the result of #collect: deepCopy deepCopy Answer the receiver. shallowCopy shallowCopy Answer the receiver. BindingDictionary: forward declarations at:put:at: key put: value Store value as associated to the given key. If any, recycle Associationstemporarily stored by the compiler inside the `Undeclared' dictionary. BindingDictionary: printing printOn:in:printOn: aStream in: aNamespace Print the receiver's name when referred to from aNamespace; bydefault the computation is deferred to the receiver's environment. BindingDictionary: testing speciesspecies Answer `IdentityDictionary'. BlockClosure BlockClosure Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I am a factotum class. My instances represent Smalltalk blocks, portionsof executeable code that have access to the environment that they weredeclared in, take parameters, and can be passed around as objects to beexecuted by methods outside the current class.Block closures are sent a message to compute their value and create a newexecution context; this property can be used in the construction ofcontrol flow methods. They also provide some methods that are used in thecreation of Processes from blocks. BlockClosure class: instance creation block:block: aCompiledBlock Answer a BlockClosure that activates the passed CompiledBlock. block:receiver: block: aCompiledBlock receiver: anObject Answer a BlockClosure that activates the passed CompiledBlockwith the given receiver. block:receiver:outerContext: block: aCompiledBlock receiver: anObject outerContext: aContext Answer a BlockClosure that activates the passed CompiledBlockwith the given receiver. exceptionHandlerResetBlock exceptionHandlerResetBlock Not commented. exceptionHandlerSearchBlock exceptionHandlerSearchBlock Not commented. numArgs:numTemps:bytecodes:depth:literals: numArgs: args numTemps: temps bytecodes: bytecodes depth: depth literals: literalArray Answer a BlockClosure for a new CompiledBlock that is created usingthe passed parameters. To make it work, you must put the BlockClosureinto a CompiledMethod's literals. BlockClosure class: testing isImmediateisImmediate Answer whether, if x is an instance of the receiver, x copy == x BlockClosure: accessing argumentCountargumentCount Answer the number of arguments passed to the receiver block block Answer the CompiledBlock which contains the receiver's bytecodes block: block: aCompiledBlock Set the CompiledBlock which contains the receiver's bytecodes finalIP finalIP Answer the last instruction that can be executed by the receiver fixTemps fixTemps This should fix the values of the temporary variables used in theblock that are ordinarily shared with the method in which the blockis defined. Not defined yet, but it is not harmful that it isn't.Answer the receiver. initialIP initialIP Answer the initial instruction pointer into the receiver. method method Answer the CompiledMethod in which the receiver lies numArgs numArgs Answer the number of arguments passed to the receiver numTemps numTemps Answer the number of temporary variables used by the receiver outerContext outerContext Answer the method/block context which is the immediate outer ofthe receiver outerContext: outerContext: containingContext Set the method/block context which is the immediate outer ofthe receiver receiver receiver Answer the object that is used as `self' when executing the receiver(if nil, it might mean that the receiver is not valid though...) receiver: receiver: anObject Set the object that is used as `self' when executing the receiver stackDepth stackDepth Answer the number of stack slots needed for the receiver BlockClosure: built ins valuevalue Evaluate the receiver passing no parameters value: value: arg1 Evaluate the receiver passing arg1 as the only parameter value:value: value: arg1 value: arg2 Evaluate the receiver passing arg1 and arg2 as the parameters value:value:value: value: arg1 value: arg2 value: arg3 Evaluate the receiver passing arg1, arg2 and arg3 as the parameters valueWithArguments: valueWithArguments: argumentsArray Evaluate the receiver passing argArray's elements as the parameters BlockClosure: control structures repeatrepeat Evaluate the receiver 'forever' (actually until a return is executedor the process is terminated). whileFalse whileFalse Evaluate the receiver until it returns true whileFalse: whileFalse: aBlock Evaluate the receiver. If it returns false, evaluate aBlock and re-start whileTrue whileTrue Evaluate the receiver until it returns false whileTrue: whileTrue: aBlock Evaluate the receiver. If it returns true, evaluate aBlock and re-start BlockClosure: exception handling ifError: error:ifError: aBlock Evaluate the receiver; when #error: is called, pass to aBlock the receiverand the parameter, and answer the result of evaluating aBlock. If anotherexception is raised, it is passed to an outer handler; if no exception israised, the result of evaluating the receiver is returned. on:do: return: on: anException do: aBlock Evaluate the receiver; when anException is signaled, evaluate aBlockpassing a Signal describing the exception. Answer either the result ofevaluating the receiver or the parameter of a Signal>>#return: on:do:on:do: return: on: e1 do: b1 on: e2 do: b2 Evaluate the receiver; when e1 or e2 are signaled, evaluate respectivelyb1 or b2, passing a Signal describing the exception. Answer either theresult of evaluating the receiver or the argument of a Signal>>#return: on:do:on:do:on:do: return: on: e1 do: b1 on: e2 do: b2 on: e3 do: b3 Evaluate the receiver; when e1, e2 or e3 are signaled, evaluaterespectively b1, b2 or b3, passing a Signal describing the exception.Answer either the result of evaluating the receiver or the parameter of aSignal>>#return: on:do:on:do:on:do:on:do: return: on: e1 do: b1 on: e2 do: b2 on: e3 do: b3 on: e4 do: b4 Evaluate the receiver; when e1, e2, e3 or e4 are signaled, evaluaterespectively b1, b2, b3 or b4, passing a Signal describing the exception.Answer either the result of evaluating the receiver or the parameter of aSignal>>#return: on:do:on:do:on:do:on:do:on:do: return: on: e1 do: b1 on: e2 do: b2 on: e3 do: b3 on: e4 do: b4 on: e5 do: b5 Evaluate the receiver; when e1, e2, e3, e4 or e5 are signaled, evaluaterespectively b1, b2, b3, b4 or b5, passing a Signal describing the exception.Answer either the result of evaluating the receiver or the parameter of aSignal>>#return: BlockClosure: multiple process forkfork Create a new process executing the receiver and start it forkAt: forkAt: priority Create a new process executing the receiver with given priorityand start it forkWithoutPreemption forkWithoutPreemption Evaluate the receiver in a process that cannot be preempted.If the receiver expect a parameter, pass the current process(can be useful for queuing interrupts from within theuninterruptible process). newProcess newProcess Create a new process executing the receiver in suspended state.The priority is the same as for the calling process. The receivermust not contain returns newProcessWith: newProcessWith: anArray Create a new process executing the receiver with the passedarguments, and leave it in suspended state. The priority isthe same as for the calling process. The receiver must notcontain returns valueWithoutInterrupts valueWithoutInterrupts Evaluate aBlock and delay all interrupts that are requested to theactive process during its execution to after aBlock returns. valueWithoutPreemption valueWithoutPreemption Evaluate the receiver with external interrupts disabled. Thiseffectively disables preemption as long as the block does notexplicitly yield control, wait on semaphores, and the like. BlockClosure: overriding deepCopydeepCopy Answer the receiver. shallowCopy shallowCopy Answer the receiver. BlockClosure: testing hasMethodReturnhasMethodReturn Answer whether the block contains a method return BlockClosure: unwind protection ensure:ensure: aBlock Evaluate the receiver; when any exception is signaled exit returning theresult of evaluating aBlock; if no exception is raised, return the resultof evaluating aBlock when the receiver has ended ifCurtailed: ifCurtailed: aBlock Evaluate the receiver; if its execution triggers an unwind which truncatesthe execution of the block (`curtails' the block), evaluate aBlock. Thethree cases which can curtail the execution of the receiver are: a non-localreturn in the receiver, a non-local return in a block evaluated by thereceiver which returns past the receiver itself, and an exception raisedand not resumed during the execution of the receiver. valueWithUnwind valueWithUnwind ensure: on:do: valueWithUnwind Evaluate the receiver. Any errors caused by the block will cause abacktrace, but execution will continue in the method that sent#valueWithUnwind, after that call. Example:[ 1 / 0 ] valueWithUnwind.'unwind works!' printNl.Important: this method is public, but it is intended to be used invery special cases (as a rule of thumb, use it only when thecorresponding C code uses the _gst_prepare_execution_environment and_gst_finish_execution_environment functions). You should usuallyrely on #ensure: and #on:do:. BlockContext BlockContext Defined in namespace SmalltalkSuperclass: ContextPartCategory: Language-Implementation My instances represent executing Smalltalk blocks, which are portions ofexecuteable code that have access to the environment that they were declaredin, take parameters, and result from BlockClosure objects created to beexecuted by methods outside the current class. Block contexts arecreated by messages sent to compute a closure's value. They contain a stackand also provide some methods that can be used in inspection or debugging. BlockContext: accessing callercaller Answer the context that called the receiver home home Answer the MethodContext to which the receiver refers, ornil if it has been optimized away isBlock isBlock Answer whether the receiver is a block context isDisabled ensure:block isDisabled Answers false, because contexts that are skipped when doing a returnare always MethodContexts. BlockContexts are removed from the chainwhenever a non-local return is done, while MethodContexts need tostay there in case there is a non-local return from the #ensure:block. isEnvironment isEnvironment To create a valid execution environment for the interpreter even beforeit starts, GST creates a fake context whose selector is nil and whichcan be used as a marker for the current execution environment. Answerwhether the receiver is that kind of context (always false, sincethose contexts are always MethodContexts). isUnwind continue: ensure: isUnwind Answers whether the context must continue execution even after anon-local return (a return from the enclosing method of a block, ora call to the #continue: method of ContextPart). Such contexts arecreated only by #ensure: and are always MethodContexts. nthOuterContext: nthOuterContext: n Answer the n-th outer block/method context for the receiver outerContext outerContext Answer the outer block/method context for the receiver BlockContext: debugging isInternalExceptionHandlingContextisInternalExceptionHandlingContext Answer whether the receiver is a context that should be hidden to the userwhen presenting a backtrace. Such contexts are never blocks, but checkthe rest of the chain. BlockContext: printing printOn:printOn: aStream Print a representation for the receiver on aStream Boolean Boolean Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types I have two instances in the Smalltalk system: true and false. I providemethods that are conditional on boolean values, such as conditionalexecution and loops, and conditional testing, such as conditional and andconditional or. I should say that I appear to provide those operations;my subclasses True and False actually provide those operations. Boolean class: testing isIdentityisIdentity Answer whether x = y implies x == y for instances of the receiver isImmediate isImmediate Answer whether, if x is an instance of the receiver, x copy == x Boolean: basic && aBoolean This method's functionality should be implemented by subclasses of Boolean and: and: aBlock This method's functionality should be implemented by subclasses of Boolean eqv: eqv: aBoolean This method's functionality should be implemented by subclasses of Boolean ifFalse: ifFalse: falseBlock This method's functionality should be implemented by subclasses of Boolean ifFalse:ifTrue: ifFalse: falseBlock ifTrue: trueBlock This method's functionality should be implemented by subclasses of Boolean ifTrue: ifTrue: trueBlock This method's functionality should be implemented by subclasses of Boolean ifTrue:ifFalse: ifTrue: trueBlock ifFalse: falseBlock This method's functionality should be implemented by subclasses of Boolean not not This method's functionality should be implemented by subclasses of Boolean or: or: aBlock This method's functionality should be implemented by subclasses of Boolean xor: xor: aBoolean This method's functionality should be implemented by subclasses of Boolean | | aBoolean This method's functionality should be implemented by subclasses of Boolean Boolean: C hacks asCBooleanValueasCBooleanValue This method's functionality should be implemented by subclasses of Boolean Boolean: overriding deepCopydeepCopy Answer the receiver. shallowCopy shallowCopy Answer the receiver. Boolean: storing storeOn:storeOn: aStream Store on aStream some Smalltalk code which compiles to the receiver ByteArray ByteArray Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable My instances are similar to strings in that they are both represented asa sequence of bytes, but my individual elements are integers, where asa String's elements are characters. ByteArray class: instance creation fromCData:size:fromCData: aCObject size: anInteger Answer a ByteArray containing anInteger bytes starting at the location pointedto by aCObject ByteArray: built ins asCData:asCData: aCType Convert the receiver to a CObject with the given type byteAt: byteAt: index Answer the index-th indexed instance variable of the receiver byteAt:put: byteAt: index put: value Store the `value' byte in the index-th indexed instance variableof the receiver hash hash Answer an hash value for the receiver primReplaceFrom:to:with:startingAt: primReplaceFrom: start to: stop with: aByteArray startingAt: srcIndex Private - Replace the characters from start to stop with theASCII codes contained in aString (which, actually, can beany variable byte class), starting at the srcIndex location ofaString replaceFrom:to:with:startingAt: replaceFrom: start to: stop with: aByteArray startingAt: replaceStart Replace the characters from start to stop with thebytes contained in aByteArray (which, actually, can beany variable byte class), starting at the replaceStartlocation of aByteArray replaceFrom:to:withString:startingAt: replaceFrom: start to: stop withString: aString startingAt: replaceStart Replace the characters from start to stop with theASCII codes contained in aString (which, actually, can beany variable byte class), starting at the replaceStartlocation of aString ByteArray: converting asStringasString Answer a String whose character's ASCII codes are the receiver's contents asUnicodeString asUnicodeString Answer a UnicodeString whose character's codes are the receiver's contents.This is not implemented unless you load the I18N package. ByteArray: more advanced accessing charAt:charAt: index Access the C char at the given index in the receiver. The value isreturned as a Smalltalk Character.Indices are 1-based just like for other Smalltalk access. charAt:put: charAt: index put: value Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given index in the receiver, usingsizeof(char) bytes - i.e. 1 byte.Indices are 1-based just like for other Smalltalk access. doubleAt: doubleAt: index Access the C double at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. doubleAt:put: doubleAt: index put: value Store the Smalltalk Float object identified by `value', at thegiven index in the receiver, writing it like a C double.Indices are 1-based just like for other Smalltalk access. floatAt: floatAt: index Access the C float at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. floatAt:put: floatAt: index put: value Store the Smalltalk Float object identified by `value', at thegiven index in the receiver, writing it like a C float.Indices are 1-based just like for other Smalltalk access. intAt: intAt: index Access the C int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. intAt:put: intAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(int) bytes.Indices are 1-based just like for other Smalltalk access. longAt: longAt: index Access the C long int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. longAt:put: longAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(long) bytes.Indices are 1-based just like for other Smalltalk access. longDoubleAt: longDoubleAt: index Access the C long double at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. longDoubleAt:put: longDoubleAt: index put: value Store the Smalltalk Float object identified by `value', at thegiven index in the receiver, writing it like a C double.Indices are 1-based just like for other Smalltalk access. objectAt: "Note that Not commented. objectAt:put: "Storing methods objectAt: index put: value shortAt: shortAt: index Access the C short int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. shortAt:put: shortAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(short) bytes.Indices are 1-based just like for other Smalltalk access. stringAt: stringAt: index Access the string pointed by the C `char *' at the given index in thereceiver. Indices are 1-based just like for other Smalltalk access. stringAt:put: stringAt: index put: value Store the Smalltalk String object identified by `value', at thegiven index in the receiver, writing it like a *FRESHLYALLOCATED* C string. It is the caller's responsibility to freeit if necessary.Indices are 1-based just like for other Smalltalk access. ucharAt: ucharAt: index Access the C unsigned char at the given index in the receiver.The value is returned as a Smalltalk Character.Indices are 1-based just like for other Smalltalk access. ucharAt:put: ucharAt: index put: value Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given index in the receiver, usingsizeof(char) bytes - i.e. 1 byte.Indices are 1-based just like for other Smalltalk access. uintAt: uintAt: index Access the C unsigned int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. uintAt:put: uintAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(int) bytes.Indices are 1-based just like for other Smalltalk access. ulongAt: ulongAt: index Access the C unsigned long int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. ulongAt:put: ulongAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(long) bytes.Indices are 1-based just like for other Smalltalk access. unsignedCharAt: unsignedCharAt: index Access the C unsigned char at the given index in the receiver.The value is returned as a Smalltalk Character.Indices are 1-based just like for other Smalltalk access. unsignedCharAt:put: unsignedCharAt: index put: value Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given index in the receiver, usingsizeof(char) bytes - i.e. 1 byte.Indices are 1-based just like for other Smalltalk access. unsignedIntAt: unsignedIntAt: index Access the C unsigned int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. unsignedIntAt:put: unsignedIntAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(int) bytes.Indices are 1-based just like for other Smalltalk access. unsignedLongAt: unsignedLongAt: index Access the C unsigned long int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. unsignedLongAt:put: unsignedLongAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(long) bytes.Indices are 1-based just like for other Smalltalk access. unsignedShortAt: unsignedShortAt: index Access the C unsigned short int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. unsignedShortAt:put: unsignedShortAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(short) bytes.Indices are 1-based just like for other Smalltalk access. ushortAt: ushortAt: index Access the C unsigned short int at the given index in the receiver.Indices are 1-based just like for other Smalltalk access. ushortAt:put: ushortAt: index put: value Store the Smalltalk Integer object identified by `value', at thegiven index in the receiver, using sizeof(short) bytes.Indices are 1-based just like for other Smalltalk access. ByteStream ByteStream Defined in namespace SmalltalkSuperclass: ReadWriteStreamCategory: Streams-Collections My instances are read/write streams specially crafted for ByteArrays.They are able to write binary data to them. ByteStream: basic nextnext Return the next *character* in the ByteArray nextByte nextByte Return the next byte in the byte array nextByteArray: nextByteArray: numBytes Return the next numBytes bytes in the byte array nextDouble nextDouble Return the next 64-bit float in the byte array nextFloat nextFloat Return the next 32-bit float in the byte array nextLong nextLong Return the next 4 bytes in the byte array, interpreted as a 32 bit signed int nextLongLong nextLongLong Return the next 8 bytes in the byte array, interpreted as a 64 bit signed int nextPut: nextPut: aChar Store aChar on the byte array nextPutAll: nextPutAll: aCollection Write all the objects in aCollection to the receiver nextPutByte: nextPutByte: anInteger Store anInteger (range: -128..255) on the byte array nextPutByteArray: nextPutByteArray: aByteArray Store aByteArray on the byte array nextPutDouble: nextPutDouble: aDouble Store aDouble as a 64-bit float in the byte array nextPutFloat: nextPutFloat: aFloat Return the next 32-bit float in the byte array nextPutInt64: nextPutInt64: anInteger Store anInteger (range: -2^63..2^64-1) on the byte array as 4 bytes nextPutLong: nextPutLong: anInteger Store anInteger (range: -2^31..2^32-1) on the byte array as 4 bytes nextPutShort: nextPutShort: anInteger Store anInteger (range: -32768..65535) on the byte array as 2 bytes nextShort nextShort Return the next 2 bytes in the byte array, interpreted as a 16 bit signed int nextSignedByte nextSignedByte Return the next byte in the byte array, interpreted as a 8 bit signed number nextUint64 nextUint64 Return the next 8 bytes in the byte array, interpreted as a 64 bit unsigned int nextUlong nextUlong Return the next 4 bytes in the byte array, interpreted as a 32 bit unsigned int nextUshort nextUshort Return the next 2 bytes in the byte array, interpreted as a 16 bit unsigned int CAggregate CAggregate Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface CAggregate class: accessing alignofalignof Answer the receiver's instances required aligment sizeof sizeof Answer the receiver's instances size CAggregate: accessing elementTypeelementType Answer the type over which the receiver is constructed. CallinProcess CallinProcess Defined in namespace SmalltalkSuperclass: ProcessCategory: Language-Processes I represent a unit of computation for which external C code requestedexecution, so I must store the returned value once my computationterminates and I must not survive across image saves (since those whoinvoked me no longer exist). I am otherwise equivalent to a Process. CArray CArray Defined in namespace SmalltalkSuperclass: CAggregateCategory: Language-C interface CArray: accessing alignofalignof Answer the receiver's required aligment sizeof sizeof Answer the receiver's size CArrayCType CArrayCType Defined in namespace SmalltalkSuperclass: CPtrCTypeCategory: Language-C interface CArrayCType class: instance creation elementType:elementType: aCType This method should not be called for instances of this class. elementType:numberOfElements: elementType: aCType numberOfElements: anInteger Answer a new instance of CPtrCType that maps an array whose elementsare of the given CType, and whose size is exactly anInteger elements(of course, anInteger only matters for allocation, not for access, sinceno out-of-bounds protection is provided for C objects). CArrayCType: accessing alignofalignof Answer the alignment of the receiver's instances numberOfElements numberOfElements Answer the number of elements in the receiver's instances sizeof sizeof Answer the size of the receiver's instances CBoolean CBoolean Defined in namespace SmalltalkSuperclass: CByteCategory: Language-C interface I return true if a byte is not zero, false otherwise. CBoolean: accessing valuevalue Get the receiver's value - answer true if it is != 0, false if it is 0. value: value: aBoolean Set the receiver's value - it's the same as for CBytes, but weget a Boolean, not a Character CByte CByte Defined in namespace SmalltalkSuperclass: CUCharCategory: Language-C interface You're a marine.You adapt – you improvise – you overcome - Gunnery Sgt. Thomas Highway Heartbreak Ridge CByte class: conversion scalarIndexscalarIndex Nothing special in the default case - answer a CType for the receiver type type Nothing special in the default case - answer a CType for the receiver CByte: accessing scalarIndexscalarIndex Nothing special in the default case - answer the receiver's CType type type Answer a CType for the receiver value value Answer the value the receiver is pointing to. The returned valueis a SmallInteger value: value: aValue Set the receiver to point to the value, aValue (a SmallInteger). CChar CChar Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CChar class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CChar: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CChar: conversion asByteArray:asByteArray: size Convert size bytes pointed to by the receiver to a String asString asString Convert the data pointed to by the receiver, up to the first NULL byte,to a String asString: asString: size Convert size bytes pointed to by the receiver to a String CCompound CCompound Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface CCompound class: instance creation new addToBeFinalizednew Allocate a new instance of the receiver. To free the memory afterGC, remember to call #addToBeFinalized. type type Answer a CType for the receiver CCompound class: subclass creation alignofalignof Answer 1, the alignment of an empty struct compileDeclaration: compileDeclaration: array This method's functionality should be implemented by subclasses of CCompound compileDeclaration:inject:into: compileDeclaration: array inject: startOffset into: aBlock Compile methods that implement the declaration in array. Tocompute the offset after each field, the value of theold offset plus the new field's size is passed to aBlock,together with the new field's alignment requirements. compileSize:align: compileSize: size align: alignment Private - Compile sizeof and alignof methods computeAggregateType:block: computeAggregateType: type block: aBlock Private - Called by computeTypeString:block: for pointers/arrays.Format of type:(array int 3) or(ptr FooStruct) computeArrayType:block: computeArrayType: type block: aBlock Private - Called by computeAggregateType:block: for arrays computePtrType:block: computePtrType: type block: aBlock Private - Called by computeAggregateType:block: for pointers computeTypeString:block: computeTypeString: type block: aBlock Private - Pass the size, alignment, and description of CType for aBlock,given the field description in `type' (the second element of each pair). emitInspectTo:for: emitInspectTo: str for: name Private - Emit onto the given stream the code for adding thegiven selector to the CCompound's inspector. initialize initialize Initialize the receiver's TypeMap newStruct:declaration: subclass:declaration: newStruct: structName declaration: array The old way to create a CStruct. Superseded by #subclass:declaration:... sizeof sizeof Answer 0, the size of an empty struct subclass:declaration:classVariableNames:poolDictionaries:category: subclass: structName declaration: array classVariableNames: cvn poolDictionaries: pd category: categoryCreate a new class with the given name that contains codeto implement the given C struct. All the parameters except`array' are the same as for a standard class creation message;see documentation for more information CCompound: instance creation inspectinspect Inspect the contents of the receiver inspectSelectorList inspect inspectSelectorList Answer a list of selectors whose return values should be inspectedby #inspect. CDouble CDouble Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CDouble class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CDouble: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CFloat CFloat Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CFloat class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CFloat: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CFunctionDescriptor CFunctionDescriptor Defined in namespace SmalltalkSuperclass: ObjectCategory: 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. CFunctionDescriptor class: instance creation for:returning:withArgs:for: funcNameString returning: returnTypeSymbol withArgs: argsArray Private - Answer a CFunctionDescriptor CFunctionDescriptor class: testing addressOf:addressOf: function Answer whether a function is registered (on the C side) with thegiven name or is dynamically loadable. isFunction: isFunction: function Answer whether a function is registered (on the C side) with thegiven name. CFunctionDescriptor: accessing addressaddress Answer the address (CObject) of the function represented bythe receiver address: address: aCObject Set to aCObject the address of the function represented bythe receiver isValid isValid Answer whether the function represented by the receiver is actuallya registered one name name Answer the name of the function (on the C side) represented by thereceiver CFunctionDescriptor: calling asyncCall self selfSmalltalkasyncCall 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 taken from the parent context.Asynchronous call-outs don't return a value, but if thefunction calls back into Smalltalk the process that started thecall-out is not suspended. asyncCallNoRetryFrom: self selfSmalltalk asyncCallFrom: asyncCallNoRetryFrom: aContext 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 taken from the base of the stack ofaContext. Asynchronous call-outs don't return a value, but if thefunction calls back into Smalltalk the process that started thecall-out is not suspended. Unlike #asyncCallFrom:, this methoddoes not attempt to find functions in shared objects. callInto: self selfSmalltalk callInto: aValueHolder Perform the call-out for the function represented by the receiver. Thearguments (and the receiver if one of the arguments has type#self or #selfSmalltalk) are taken from the parent context, and thethe result is stored into aValueHolder. aValueHolder is also returned. callNoRetryFrom:into: self selfSmalltalk callFrom:into: callNoRetryFrom: aContext into: aValueHolder Perform the call-out for the function represented by the receiver. Thearguments (and the receiver if one of the arguments has type#self or #selfSmalltalk) are taken from the base of the stack ofaContext, and the result is stored into aValueHolder. aValueHolderis also returned. Unlike #callFrom:into:, this method does notattempt to find functions in shared objects. CFunctionDescriptor: printing printOn:printOn: aStream Print a representation of the receiver onto aStream Character Character Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types My instances represent the 256 characters of the character set. I providemessages to translate between integers and character objects, and providenames for some of the common unprintable characters.Character is always used (mostly for performance reasons) when referringto characters whose code point is between 0 and 127. Above 127, instead,more care is needed: Character refers to bytes that are used as part ofencoding of a character, while UnicodeCharacter refers to the characteritself. Character class: built ins asciiValue:asciiValue: anInteger Returns the character object corresponding to anInteger. Error ifanInteger is not an integer, or not in 0..127. codePoint: codePoint: anInteger Returns the character object, possibly an UnicodeCharacter, correspondingto anInteger. Error if anInteger is not an integer, or not in 0..16r10FFFF. value: value: anInteger Returns the character object corresponding to anInteger. Error ifanInteger is not an integer, or not in 0..255. Character class: constants backspacebackspace Returns the character 'backspace' bell bell Returns the character 'bel' cr cr Returns the character 'cr' eof eof Returns the character 'eof', also known as 'sub' eot eot Returns the character 'eot', also known as 'Ctrl-D' esc esc Returns the character 'esc' lf lf Returns the character 'lf', also known as 'nl' newPage newPage Returns the character 'newPage', also known as 'ff' nl nl Returns the character 'nl', also known as 'lf' nul nul Returns the character 'nul' space space Returns the character 'space' tab tab Returns the character 'tab' Character class: initializing lookup tables initializeinitialize Initialize the lookup table which is used to make case and digit-to-charconversions faster.Indices in Table are ASCII values incremented by one. Indices 1-256classify chars (0 = nothing special, 2 = separator, 48 = digit,55 = uppercase, 3 = lowercase), indices 257-512 map to lowercase chars,indices 513-768 map to uppercase chars. Character class: instance creation digitValue:digitValue: anInteger Returns a character that corresponds to anInteger. 0-9 map to $0-$9,10-35 map to $A-$Z Character class: testing isImmediateisImmediate Answer whether, if x is an instance of the receiver, x copy == x Character: built ins == char Boolean return value; true if the characters are equal asciiValue codePoint asciiValue value asInteger asciiValue Returns the integer value corresponding to self. #codePoint,#asciiValue, #value, and #asInteger are synonyms. asInteger codePoint asciiValue value asInteger asInteger Returns the integer value corresponding to self. #codePoint,#asciiValue, #value, and #asInteger are synonyms. codePoint codePoint asciiValue value asInteger codePoint Returns the integer value corresponding to self. #codePoint,#asciiValue, #value, and #asInteger are synonyms. value codePoint asciiValue value asInteger value Returns the integer value corresponding to self. #codePoint,#asciiValue, #value, and #asInteger are synonyms. Character: coercion methods asLowercaseasLowercase Returns self as a lowercase character if it's an uppercase letter,otherwise returns the character unchanged. asString asString Returns the character self as a string. Only valid if the characteris between 0 and 255. asSymbol asSymbol Returns the character self as a symbol. asUnicodeString asUnicodeString Returns the character self as a Unicode string. asUppercase asUppercase Returns self as a uppercase character if it's an lowercase letter,otherwise returns the character unchanged. Character: comparing << aCharacter Compare the character's ASCII value. Answer whether the receiver'sis the least. <= <= aCharacter Compare the character's ASCII value. Answer whether the receiver'sis the least or their equal. > > aCharacter Compare the character's ASCII value. Answer whether the receiver'sis the greatest. >= >= aCharacter Compare the character's ASCII value. Answer whether the receiver'sis the greatest or their equal. Character: converting asCharacterasCharacter Return the receiver, since it is already a character. digitValue digitValue Returns the value of self interpreted as a digit. Here, 'digit' meanseither 0-9, or A-Z, which maps to 10-35. Character: printing displayOn: printOn:displayOn: aStream Print a representation of the receiver on aStream. Unlike#printOn:, this method strips the leading dollar. printOn: printOn: aStream Print a representation of the receiver on aStream Character: storing storeOn:storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Character: testing isAlphaNumericisAlphaNumeric True if self is a letter or a digit isDigit isDigit True if self is a 0-9 digit isDigit: isDigit: radix Answer whether the receiver is a valid character in the given radix. isLetter isLetter True if self is an upper- or lowercase letter isLowercase isLowercase True if self is a lowercase letter isPunctuation isPunctuation Returns true if self is one of '.,:;!?' isSeparator isSeparator Returns true if self is a space, cr, tab, nl, or newPage isUppercase isUppercase True if self is uppercase isVowel isVowel Returns true if self is a, e, i, o, or u; case insensitive Character: testing functionality isCharacterisCharacter Answer True. We're definitely characters CharacterArray CharacterArray Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Text My instances represent a generic textual (string) data type. I provideaccessing and manipulation methods for strings. CharacterArray class: basic fromString:fromString: aCharacterArray Make up an instance of the receiver containing the same charactersas aCharacterArray, and answer it. lineDelimiter lineDelimiter Answer a CharacterArray which one can use as a line delimiter.This is meant to be used on subclasses of CharacterArray. CharacterArray: built ins valueAt:valueAt: index Answer the ascii value of index-th character variable of the receiver valueAt:put: valueAt: index put: value Store (Character value: value) in the index-th indexed instance variableof the receiver CharacterArray: comparing << aCharacterArray Return true if the receiver is less than aCharacterArray, ignoring casedifferences. <= <= aCharacterArray Returns true if the receiver is less than or equal to aCharacterArray,ignoring case differences. If is receiver is an initial substring ofaCharacterArray, it is considered to be less than aCharacterArray. = = aString Answer whether the receiver's items match those in aCollection > > aCharacterArray Return true if the receiver is greater than aCharacterArray, ignoring casedifferences. >= >= aCharacterArray Returns true if the receiver is greater than or equal to aCharacterArray,ignoring case differences. If is aCharacterArray is an initial substring ofthe receiver, it is considered to be less than the receiver. indexOf:matchCase:startingAt: indexOf: aCharacterArray matchCase: aBoolean startingAt: anIndex Answer an Interval of indices in the receiver which match the aCharacterArraypattern. # in aCharacterArray means 'match any character', * in aCharacterArray means'match any sequence of characters'. The first item of the returned in-terval is >= anIndex. If aBoolean is false, the search is case-insen-sitive, else it is case-sensitive.If no Interval matches the pattern, answer nil. match: match: aCharacterArray Answer whether aCharacterArray matches the pattern contained in thereceiver. # in the receiver means 'match any character', * inreceiver means 'match any sequence of characters'. match:ignoreCase: match: aCharacterArray ignoreCase: aBoolean Answer whether aCharacterArray matches the pattern contained in thereceiver. # in the receiver means 'match any character', * inreceiver means 'match any sequence of characters'. The case ofalphabetic characters is ignored if aBoolean is true. sameAs: sameAs: aCharacterArray Returns true if the receiver is the same CharacterArray as aCharacterArray, ignoringcase differences. startsWith: startsWith: aCharacterArray Returns true if the receiver starts with the same characters as aCharacterArray. CharacterArray: converting asByteArrayasByteArray Return the receiver, converted to a ByteArray of ASCII values asClassPoolKey asClassPoolKey Return the receiver, ready to be put in a class pool dictionary asGlobalKey asGlobalKey Return the receiver, ready to be put in the Smalltalk dictionary asInteger asInteger Parse an Integer number from the receiver until the input characteris invalid and answer the result at this point asLowercase asLowercase Returns a copy of self as a lowercase CharacterArray asNumber asNumber Parse a Number from the receiver until the input character is invalidand answer the result at this point asPoolKey asPoolKey Return the receiver, ready to be put in a pool dictionary asString asString But I already am a String! Really! asSymbol asSymbol Returns the symbol corresponding to the CharacterArray asUnicodeString asUnicodeString Answer a UnicodeString whose character's codes are the receiver's contentsThis is not implemented unless you load the I18N package. asUppercase asUppercase Returns a copy of self as an uppercase CharacterArray fileName fileName But I don't HAVE a file name! filePos filePos But I don't HAVE a file position! isNumeric isNumeric Answer whether the receiver denotes a number trimSeparators trimSeparators Return a copy of the reciever without any spaces on front or back.The implementation is protected against the `all blanks' case. CharacterArray: multibyte encodings encodingencoding Answer the encoding used by the receiver. numberOfCharacters numberOfCharacters Answer the number of Unicode characters in the receiver.This is not implemented unless you load the I18N package. CharacterArray: string processing bindWith:bindWith: s1 Answer the receiver with every %1 replaced by the displayString of s1 bindWith:with: bindWith: s1 with: s2 Answer the receiver with every %1 or %2 replaced by s1 or s2,respectively. s1 and s2 are `displayed' (i.e. theirdisplayString is used) upon replacement. bindWith:with:with: bindWith: s1 with: s2 with: s3 Answer the receiver with every %1, %2 or %3 replaced by s1, s2 or s3,respectively. s1, s2 and s3 are `displayed' (i.e. theirdisplayString is used) upon replacement. bindWith:with:with:with: bindWith: s1 with: s2 with: s3 with: s4 Answer the receiver with every %1, %2, %3 or %4 replaced by s1, s2, s3or s4, respectively. s1, s2, s3 and s4 are `displayed' (i.e. theirdisplayString is used) upon replacement. bindWithArguments: bindWithArguments: anArray Answer the receiver with every %n (1<=n<=9) replaced by the n-th elementof anArray. The replaced elements are `displayed' (i.e. theirdisplayString is used). In addition, the special pattern%<trueString|falseString>n is replaced with one of the twostrings depending on the n-th element of anArray being true or false. contractTo: contractTo: smallSize Either return myself, or a copy shortened to smallSize charactersby inserting an ellipsis (three dots: ...) subStrings subStrings Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of white spacecharacters substrings substrings Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of white spacecharacters. This message is preserved for backwards compatibility;the ANSI standard mandates `subStrings', with an uppercase s. subStrings: subStrings: aCharacter Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of charactersmatching aCharacter substrings: substrings: aCharacter Answer an OrderedCollection of substrings of the receiver. A new substringstart at the start of the receiver, or after every sequence of charactersmatching aCharacter. This message is preserved for backwards compatibility;the ANSI standard mandates `subStrings:', with an uppercase s. CharacterArray: testing functionality isCharacterArrayisCharacterArray Answer `true'. CInt CInt Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CInt class: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's size CInt: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's instances size Class Class Defined in namespace SmalltalkSuperclass: ClassDescriptionCategory: Language-Implementation I am THE class object. My instances are the classes of the system.I provide information commonly attributed to classes: namely, theclass name, class comment (you wouldn't be reading this if itweren't for me), a list of the instance variables of the class, andthe class category. Class class: initialize initializeinitialize Perform the special initialization of root classes. Class: accessing instances and variables addClassVarName:addClassVarName: aString Add a class variable with the given name to the class pool dictionary addSharedPool: addSharedPool: aDictionary Add the given shared pool to the list of the class' pool dictionaries allClassVarNames allClassVarNames Answer the names of the variables in the receiver's class pool dictionaryand in each of the superclasses' class pool dictionaries bindingFor: bindingFor: aString Answer the variable binding for the class variable with thegiven name category category Answer the class category category: category: aString Change the class category to aString classPool classPool Answer the class pool dictionary classVarNames classVarNames Answer the names of the variables in the class pool dictionary comment comment Answer the class comment comment: comment: aString Change the class name environment environment Answer `environment'. environment: environment: aNamespace Set the receiver's environment to aNamespace and recompile everything initialize initialize redefined in children (?) initializeAsRootClass initializeAsRootClass Perform special initialization reserved to root classes. name name Answer the class name removeClassVarName: removeClassVarName: aString Removes the class variable from the class, error if not present, orstill in use. removeSharedPool: removeSharedPool: aDictionary Remove the given dictionary to the list of the class' pool dictionaries sharedPools sharedPools Return the names of the shared pools defined by the class superclass: superclass: aClass Not commented. Class: filing fileOutDeclarationOn:fileOutDeclarationOn: aFileStream File out class definition to aFileStream fileOutInitializeOn: fileOutInitializeOn: aFileStream Not commented. fileOutMethodsOn: fileOutMethodsOn: aFileStream File out instance methods of the receiver. fileOutOn: fileOutOn: aFileStream File out complete class description: class definition, class andinstance methods Class: instance creation extendextend Redefine a version of the receiver in the current namespace. Note:this method can bite you in various ways when sent to system classes;read the section on namespaces in the manual for some examples of theproblems you can encounter. subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a fixed subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If theclass is already defined, if necessary, recompile everything needed. variable:subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: byte int8 character#short ushort int uint int64 uint64 utf32 float double pointer variable: shape subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a variable pointer subclass of the receiver with the givenname, instance variables, class variables, pool dictionaries andcategory. If the class is already defined, if necessary, recompileeverything needed. The shape can be one of #byte #int8 #character#short #ushort #int #uint #int64 #uint64 #utf32 #float #double or#pointer. variableByteSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableByteSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a byte variable subclass of the receiver with the givenname, instance variables (must be ”), class variables, pooldictionaries and category. If the class is already defined, ifnecessary, recompile everything needed. variableSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a variable pointer subclass of the receiver with the givenname, instance variables, class variables, pool dictionaries andcategory. If the class is already defined, if necessary, recompileeverything needed. variableWordSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableWordSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a word variable subclass of the receiver with the givenname, instance variables (must be ”), class variables, pooldictionaries and category. If the class is already defined, ifnecessary, recompile everything needed. Class: instance creation - alternative categoriesFor:are:categoriesFor: method are: categories Don't use this, it is only present to file in from IBM Smalltalk subclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries: subclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk subclass:instanceVariableNames:classVariableNames:poolDictionaries: subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableByteSubclass:classInstanceVariableNames:classVariableNames:poolDictionaries: variableByteSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableByteSubclass:classVariableNames:poolDictionaries: variableByteSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableLongSubclass:classInstanceVariableNames:classVariableNames:poolDictionaries: variableLongSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableLongSubclass:classVariableNames:poolDictionaries: variableLongSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableSubclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries: variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableSubclass:instanceVariableNames:classVariableNames:poolDictionaries: variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk Class: pragmas pragmaHandlerFor:pragmaHandlerFor: aSymbol Not commented. registerHandler:forPragma: registerHandler: aBlock forPragma: pragma Not commented. Class: printing articlearticle Answer an article (`a' or `an') which is ok for the receiver's name printOn: printOn: aStream Print a representation of the receiver on aStream storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Class: saving and loading binaryRepresentationVersionbinaryRepresentationVersion Answer a number >= 0 which represents the current version of theobject's representation. The default implementation answerszero. convertFromVersion:withFixedVariables:indexedVariables:for: convertFromVersion: version withFixedVariables: fixed indexedVariables: indexed for: anObjectDumperThis method is called if a VersionableObjectProxy is attached toa class. It receives the version number that was stored for theobject (or nil if the object did not use a VersionableObjectProxy),the fixed instance variables, the indexed instance variables,and the ObjectDumper that has read the object.The default implementation ignores the version and simply fillsin an instance of the receiver with the given fixed and indexedinstance variables (nil if the class instances are 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. nonVersionedInstSize nonVersionedInstSize Answer the number of instance variables that the class used to havewhen objects were stored without using a VersionableObjectProxy.The default implementation answers the current instSize. Class: security check:check: aPermission Not commented. policy policy Answer `securityPolicy'. policy: policy: aSecurityPolicy Not commented. Class: testing == aClass Returns true if the two class objects are to be considered equal. Class: testing functionality asClassasClass Answer the receiver. isClass isClass Answer `true'. ClassDescription ClassDescription Defined in namespace SmalltalkSuperclass: BehaviorCategory: Language-Implementation My instances provide methods that access classes by category, andallow whole categories of classes to be filed out to external diskfiles. ClassDescription: compiling compile:classified:compile: code classified: categoryName Compile code in the receiver, assigning the method to the given category.Answer the newly created CompiledMethod, or nil if an error was found. compile:classified:ifError: compile: code classified: categoryName ifError: block Compile method source and install in method category, categoryName. Ifthere are parsing errors, invoke exception block, 'block' (seecompile:ifError:). Return the method compile:classified:notifying: compile: code classified: categoryName notifying: requestor Compile method source and install in method category, categoryName. Ifthere are parsing errors, send an error message to requestor ClassDescription: conversion asClassasClass This method's functionality should be implemented by subclasses of ClassDescription asMetaclass asMetaclass Answer the metaclass associated to the receiver binding binding Answer a VariableBinding object whose value is the receiver ClassDescription: copying copy:from:copy: selector from: aClass Copy the given selector from aClass, assigning it the same category copy:from:classified: copy: selector from: aClass classified: categoryName Copy the given selector from aClass, assigning it the given category copyAll:from: copyAll: arrayOfSelectors from: class Copy all the selectors in arrayOfSelectors from class, assigning them thesame category they have in class copyAll:from:classified: copyAll: arrayOfSelectors from: class classified: categoryName Copy all the selectors in arrayOfSelectors from aClass, assigning themthe given category copyAllCategoriesFrom: copyAllCategoriesFrom: aClass Copy all the selectors in aClass, assigning them the original category copyCategory:from: copyCategory: categoryName from: aClass Copy all the selectors in from aClass that belong to the given category copyCategory:from:classified: copyCategory: categoryName from: aClass classified: newCategoryName Copy all the selectors in from aClass that belong to the given category,reclassifying them as belonging to the given category ClassDescription: filing fileOut:fileOut: fileName Open the given file and to file out a complete class description to it fileOutCategory:to: fileOutCategory: categoryName to: fileName File out all the methods belonging to the method category, categoryName,to the fileName file fileOutCategory:toStream: fileOutCategory: category toStream: aFileStream File out all the methods belonging to the method category, categoryName,to aFileStream fileOutHeaderOn: fileOutHeaderOn: aFileStream Write date and time stamp to aFileStream fileOutOn: fileOutOn: aFileStream File out complete class description: class definition, class andinstance methods fileOutSelector:to: fileOutSelector: selector to: fileName File out the given selector to fileName ClassDescription: organization of messages and classes classify:under:classify: aSelector under: aString Put the method identified by the selector aSelectorunder the category given by aString. createGetMethod: createGetMethod: what Create a method accessing the variable `what'. createGetMethod:default: createGetMethod: what default: value Create a method accessing the variable `what', with a default valueof `value', using lazy initialization createSetMethod: createSetMethod: what Create a method which sets the variable `what'. defineAsyncCFunc:withSelectorArgs:args: defineAsyncCFunc: cFuncNameString withSelectorArgs: selectorAndArgs args: argsArraySee documentation. This function is deprecated, you should usethe <asyncCCall: ... > special syntax instead. defineCFunc:withSelectorArgs:returning:args: defineCFunc: cFuncNameString withSelectorArgs: selectorAndArgs returning: returnTypeSymbol args: argsArraySee documentation. This function is deprecated, you should usethe <asyncCCall: ... > special syntax instead. removeCategory: removeCategory: aString Remove from the receiver every method belonging to the given category whichCategoryIncludesSelector: whichCategoryIncludesSelector: selector Answer the category for the given selector, or nil if the selector isnot found ClassDescription: printing classVariableStringclassVariableString This method's functionality should be implemented by subclasses of ClassDescription instanceVariableString instanceVariableString Answer a string containing the name of the receiver's instance variables. nameIn: nameIn: aNamespace Answer the class name when the class is referenced from aNamespace printOn:in: printOn: aStream in: aNamespace Print on aStream the class name when the class is referenced fromaNamespace sharedVariableString sharedVariableString This method's functionality should be implemented by subclasses of ClassDescription CLong CLong Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CLong class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CLong: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CLongDouble CLongDouble Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CLongDouble class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CLongDouble: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CObject CObject Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface I am not part of the standard Smalltalk kernel class hierarchy.My instances contain values that are not interpreted by the Smalltalksystem; they frequently hold "pointers" to data outside of the Smalltalkenvironment. The C callout mechanism allows my instances to be transformedinto their corresponding C values for use in external routines. CObject class: conversion scalarIndexscalarIndex Nothing special in the default case - answer a CType for the receiver type type Nothing special in the default case - answer a CType for the receiver CObject class: instance creation address:address: anInteger Answer a new object pointing to the passed address, anInteger alloc: alloc: nBytes Allocate nBytes bytes and return an instance of the receiver alloc:type: alloc: nBytes type: cTypeObject Allocate nBytes bytes and return a CObject of the given type new new Answer a new object pointing to NULL. new: new: nBytes Allocate nBytes bytes and return an instance of the receiver CObject: accessing addressaddress Answer the address the receiver is pointing to. address: address: anInteger Set the receiver to point to the passed address, anInteger printOn: printOn: aStream Print a representation of the receiver type: type: aCType Set the receiver's type to aCType. CObject: C data access at:put:type:at: byteOffset put: aValue type: aType Store aValue as data of the given type from byteOffset bytes afterthe pointer stored in the receiver at:type: at: byteOffset type: aType Answer some data of the given type from byteOffset bytes afterthe pointer stored in the receiver free free Free the receiver's pointer and set it to null. Big trouble hitsyou if the receiver doesn't point to the base of a malloc-ed area. CObject: conversion castTo:castTo: aType Answer another CObject, pointing to the same address as the receiver,but belonging to the aType CType. narrow cObject narrow This method is called on CObjects returned by a C call-out whosereturn type is specified as a CType; it mostly allows one tochange the class of the returned CObject. By default it doesnothing, and that's why it is not called when #cObject is usedto specify the return type. scalarIndex scalarIndex Nothing special in the default case - answer the receiver's CType type type Answer a CType for the receiver CObject: finalization finalize addToBeFinalized freefinalize To make the VM call this, use #addToBeFinalized. It freesautomatically any memory pointed to by the CObject. It is notautomatically enabled because big trouble hits you if you use#free and the receiver doesn't point to the base of a malloc-edarea. CObject: pointer-like behavior ++ anInteger Return another instance of the receiver's class which points at&receiver[anInteger] (or, if you prefer, what `receiver +anInteger' does in C). - - intOrPtr If intOrPtr is an integer, return another instance of the receiver'sclass pointing at &receiver[-anInteger] (or, if you prefer, what`receiver - anInteger' does in C).If it is the same class as the receiver, return the difference inchars, i.e. in bytes, between the two pointed addresses (or, ifyou prefer, what `receiver - anotherCharPtr' does in C) addressAt: addressAt: anIndex Return a new CObject of the element type,corresponding to an object that is anIndex places pastthe receiver (remember that CObjects represent pointersand that C pointers behave like arrays).anIndex is zero-based, just like with all other C-style accessing. at: at: anIndex Dereference a pointer that is anIndex places pastthe receiver (remember that CObjects represent pointersand that C pointers behave like arrays). anIndex iszero-based, just like with all other C-style accessing. at:put: at: anIndex put: aValue Store anIndex places past the receiver the passed Smalltalkobject or CObject `aValue'; if it is a CObject is dereferenced:that is, this method is equivalent either to cobj[anIndex]=aValueor cobj[anIndex]=*aValue. anIndex is zero-based, just like withall other C-style accessing.In both cases, aValue should be of the element type or of thecorresponding Smalltalk type (that is, a String is ok for anarray of CStrings) to avoid typing problems which however willnot be signaled because C is untyped. decr decr Adjust the pointer by sizeof(dereferencedType) bytes down (i.e. –receiver) decrBy: decrBy: anInteger Adjust the pointer by anInteger elements down (i.e. receiver -= anInteger) incr incr Adjust the pointer by sizeof(dereferencedType) bytes up (i.e. ++receiver) incrBy: incrBy: anInteger Adjust the pointer by anInteger elements up (i.e. receiver += anInteger) Collection Collection Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections I am an abstract class. My instances are collections of objects. Mysubclasses may place some restrictions or add some definitions to howthe objects are stored or organized; I say nothing about this. I merelyprovide some object creation and access routines for general collectionsof objects. Collection class: instance creation with:with: anObject Answer a collection whose only element is anObject with:with: with: firstObject with: secondObject Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with: with: firstObject with: secondObject with: thirdObject Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with: with: firstObject with: secondObject with: thirdObject with: fourthObject Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with:with: with: firstObject with: secondObject with: thirdObject with: fourthObject with: fifthObject Answer a collection whose only elements are the parameters in the orderthey were passed withAll: withAll: aCollection Answer a collection whose elements are all those in aCollection Collection: adding add:add: newObject Add newObject to the receiver, answer it addAll: addAll: aCollection Adds all the elements of 'aCollection' to the receiver, answeraCollection Collection: converting asArrayasArray Answer an Array containing all the elements in the receiver asBag asBag Answer a Bag containing all the elements in the receiver asByteArray asByteArray Answer a ByteArray containing all the elements in the receiver asOrderedCollection asOrderedCollection Answer an OrderedCollection containing all the elements in the receiver asRunArray do:order asRunArray Answer the receiver converted to a RunArray. If the receiver is notordered the order of the elements in the RunArray might not be the #do:order. asSet asSet Answer a Set containing all the elements in the receiver with noduplicates asSortedCollection asSortedCollection Answer a SortedCollection containing all the elements in the receiverwith the default sort block - [ :a :b | a <= b ] asSortedCollection: asSortedCollection: aBlock Answer a SortedCollection whose elements are the elements of the receiver,sorted according to the sort block aBlock asString asString Answer a String containing all the elements in the receiver asUnicodeString asUnicodeString Answer a UnicodeString containing all the elements in the receiver Collection: copying Collections copyReplacing:withObject:copyReplacing: targetObject withObject: newObject Copy replacing each object which is = to targetObjectwith newObject copyWith: copyWith: newElement Answer a copy of the receiver to which newElement is added copyWithout: copyWithout: oldElement Answer a copy of the receiver to which all occurrences of oldElement areremoved Collection: enumeration allSatisfy:allSatisfy: aBlock Search the receiver for an element for which aBlock returns false.Answer true if none does, false otherwise. anyOne anyOne Answer an unspecified element of the collection. anySatisfy: anySatisfy: aBlock Search the receiver for an element for which aBlock returns true.Answer true if some does, false otherwise. beConsistent do: beConsistent This method is private, but it is quite interesting so it isdocumented. It ensures that a collection is in a consistentstate before attempting to iterate on it; its presence reducesthe number of overrides needed by collections who try toamortize their execution times. The default implementationdoes nothing, so it is optimized out by the virtual machineand so it loses very little on the performance side. Notethat descendants of Collection have to call it explicitlysince #do: is abstract in Collection. collect: collect: aBlock Answer a new instance of a Collection containing all the resultsof evaluating aBlock passing each of the receiver's elements conform: conform: aBlock Search the receiver for an element for which aBlock returns false.Answer true if none does, false otherwise. contains: contains: aBlock Search the receiver for an element for which aBlock returns true.Answer true if some does, false otherwise. detect: detect: aBlock Search the receiver for an element for which aBlock returns true.If some does, answer it. If none does, fail detect:ifNone: detect: aBlock ifNone: exceptionBlock Search the receiver for an element for which aBlock returns true.If some does, answer it. If none does, answer the result of evaluatingaBlock do: do: aBlock Enumerate each object of the receiver, passing them to aBlock do:separatedBy: do: aBlock separatedBy: separatorBlock Enumerate each object of the receiver, passing them to aBlock.Between every two invocations of aBlock, invoke separatorBlock fold: fold: binaryBlock First, pass to binaryBlock the first and second elements of thereceiver; for each subsequent element, pass the result of the previousevaluation and an element. Answer the result of the last invocation,or the first element if the collection has size 1. Fail if the collectionis empty. inject:into: inject: thisValue into: binaryBlock First, pass to binaryBlock thisValue and the first element of thereceiver; for each subsequent element, pass the result of the previousevaluation and an element. Answer the result of the last invocation. reject: reject: aBlock Answer a new instance of a Collection containing all the elementsin the receiver which, when passed to aBlock, don't answer true select: select: aBlock Answer a new instance of a Collection containing all the elementsin the receiver which, when passed to aBlock, answer true Collection: finalization mourn:mourn: anObject Private - anObject has been found to have a weak key, remove itand possibly finalize the key. Collection: printing inspectinspect Print all the instance variables and objects in the receiver on theTranscript printOn: printOn: aStream Print a representation of the receiver on aStream Collection: removing emptyempty Remove everything from the receiver. remove: remove: oldObject Remove oldObject from the receiver. If absent, fail, elseanswer oldObject. remove:ifAbsent: remove: oldObject ifAbsent: anExceptionBlock Remove oldObject from the receiver. If absent, evaluate anExceptionBlockand answer the result, else answer oldObject. removeAll: removeAll: aCollection Remove each object in aCollection, answer aCollection, fail if someof them is absent. Warning: this could leave the collection in asemi-updated state. removeAll:ifAbsent: removeAll: aCollection ifAbsent: aBlock Remove each object in aCollection, answer aCollection; if someelement is absent, pass it to aBlock. Collection: storing storeOn:storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Collection: testing collections capacitycapacity Answer how many elements the receiver can hold before having to grow. identityIncludes: identityIncludes: anObject Answer whether we include the anObject object includes: includes: anObject Answer whether we include anObject isEmpty isEmpty Answer whether we are (still) empty isSequenceable at:/#at:put: isSequenceable Answer whether the receiver can be accessed by a numeric index with#at:/#at:put:. notEmpty notEmpty Answer whether we include at least one object occurrencesOf: occurrencesOf: anObject Answer how many occurrences of anObject we include size size Answer how many objects we include CompiledBlock CompiledBlock Defined in namespace SmalltalkSuperclass: CompiledCodeCategory: Language-Implementation I represent a block that has been compiled. CompiledBlock class: instance creation new:header:method:new: numBytecodes header: anInteger method: outerMethod Answer a new instance of the receiver with room for the givennumber of bytecodes and the given header. numArgs:numTemps:bytecodes:depth:literals: numArgs: args numTemps: temps bytecodes: bytecodes depth: depth literals: literalArray Answer an (almost) full fledged CompiledBlock. To make it complete,you must either set the new object's `method' variable, or put itinto a BlockClosure and put the BlockClosure into a CompiledMethod'sliterals. The clean-ness of the block is automatically computed. CompiledBlock: accessing flagsflags Answer the `cleanness' of the block.0 = clean;1 = access to receiver variables and/or self;2-30 = access to variables that are 1-29 contexts away;31 = return from method or push thisContext method method Answer the CompiledMethod in which the receiver lies methodClass methodClass Answer the class in which the receiver is installed. methodClass: methodClass: methodClass Set the receiver's class instance variable numArgs numArgs Answer the number of arguments passed to the receiver numLiterals numLiterals Answer the number of literals for the receiver numTemps numTemps Answer the number of temporary variables used by the receiver selector selector Answer the selector through which the method is called selector: selector: aSymbol Set the selector through which the method is called stackDepth stackDepth Answer the number of stack slots needed for the receiver CompiledBlock: basic == aMethod Answer whether the receiver and aMethod are equal methodCategory methodCategory Answer the method category methodCategory: methodCategory: aCategory Set the method category to the given string methodSourceCode methodSourceCode Answer the method source code (a FileSegment or String or nil) methodSourceFile methodSourceFile Answer the file where the method source code is stored methodSourcePos methodSourcePos Answer the location where the method source code is stored inthe methodSourceFile methodSourceString methodSourceString Answer the method source code as a string CompiledBlock: printing printOn:printOn: aStream Print the receiver's class and selector on aStream CompiledBlock: saving and loading binaryRepresentationObject blockAt:tobinaryRepresentationObject This method is implemented to allow for a PluggableProxy to be usedwith CompiledBlocks. Answer a DirectedMessage which sends #blockAt:to the CompiledMethod containing the receiver. CompiledCode CompiledCode Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Language-Implementation I represent code that has been compiled. I am an abstractsuperclass for blocks and methods CompiledCode class: cache flushing flushTranslatorCacheflushTranslatorCache Answer any kind of cache mantained by a just-in-time code translatorin the virtual machine (if any). Do nothing for now. CompiledCode class: instance creation new:header:literals:new: numBytecodes header: anInteger literals: literals Answer a new instance of the receiver with room for the givennumber of bytecodes and the given header new:header:numLiterals: new: numBytecodes header: anInteger numLiterals: numLiterals Answer a new instance of the receiver with room for the givennumber of bytecodes and the given header CompiledCode class: tables bytecodeInfoTablebytecodeInfoTable Return a ByteArray which defines some properties of the bytecodes.For each bytecode, 4 bytes are reserved. The fourth byte is aflag byte: bit 7 means that the argument is a line number to beused in creating the bytecode->line number map.The first three have a meaning only for those bytecodes thatrepresent a combination of operations: the combination can beBC1 ARG BC2 OPERAND if the fourth byte's bit 0 = 0or BC1 OPERAND BC2 ARG if the fourth byte's bit 0 = 1where BC1 is the first byte, BC2 is the second, ARG is the thirdand OPERAND is the bytecode argument as it appears in the bytecodestream. specialSelectors specialSelectors This method should not be called for instances of this class. specialSelectorsNumArgs specialSelectorsNumArgs Not commented. CompiledCode: accessing at:put:at: anIndex put: aBytecode Store aBytecode as the anIndex-th bytecode blockAt: blockAt: anIndex Answer the CompiledBlock attached to the anIndex-th literal,assuming that the literal is a CompiledBlock or a BlockClosure. bytecodeAt: bytecodeAt: anIndex Answer the anIndex-th bytecode bytecodeAt:put: bytecodeAt: anIndex put: aBytecode Store aBytecode as the anIndex-th bytecode flags flags Private - Answer the optimization flags for the receiver isAnnotated isAnnotated Answer `false'. literalAt: literalAt: anIndex Answer the anIndex-th literal literalAt:put: literalAt: anInteger put: aValue Store aValue as the anIndex-th literal literals literals Not commented. methodClass methodClass Answer the class in which the receiver is installed. methodClass: methodClass: methodClass Set the receiver's class instance variable numArgs numArgs Answer the number of arguments for the receiver numLiterals numLiterals Answer the number of literals for the receiver numTemps numTemps Answer the number of temporaries for the receiver primitive primitive Answer the primitive called by the receiver selector selector Answer the selector through which the method is called selector: selector: aSymbol Set the selector through which the method is called stackDepth stackDepth Answer the number of stack slots needed for the receiver CompiledCode: basic == aMethod Answer whether the receiver and aMethod are equal hash hash Answer an hash value for the receiver methodCategory methodCategory Answer the method category methodCategory: methodCategory: aCategory Set the method category to the given string methodSourceCode methodSourceCode Answer the method source code (a FileSegment or String or nil) methodSourceFile methodSourceFile Answer the file where the method source code is stored methodSourcePos methodSourcePos Answer the location where the method source code is stored inthe methodSourceFile methodSourceString methodSourceString Answer the method source code as a string CompiledCode: copying deepCopydeepCopy Answer a deep copy of the receiver CompiledCode: debugging inspectinspect Print the contents of the receiver in a verbose way. CompiledCode: decoding bytecodes dispatchTo:with:dispatchTo: anObject with: param Disassemble the bytecodes and tell anObject about them in the formof message sends. param is given as an argument to every messagesend. CompiledCode: literals - iteration allLiteralsDo:allLiteralsDo: aBlock Not commented. allLiteralSymbolsDo: allLiteralSymbolsDo: aBlock Not commented. literalsDo: literalsDo: aBlock Not commented. traverseLiteral:with: traverseLiteral: anArray with: aBlock Not commented. CompiledCode: security verifyverify Verify the bytecodes for the receiver, and raise an exception ifthe verification process failed. CompiledCode: testing accesses accesses:accesses: instVarIndex Answer whether the receiver accesses the instance variable with the givenindex assigns: assigns: instVarIndex Answer whether the receiver writes to the instance variable with the givenindex containsLiteral: containsLiteral: anObject Answer if the receiver contains a literal which is equal to anObject. hasBytecode:between:and: hasBytecode: byte between: firstIndex and: lastIndex Answer whether the receiver includes the `byte' bytecode in anyof the indices between firstIndex and lastIndex. jumpDestinationAt: jumpDestinationAt: anIndex Answer where the jump at bytecode index `anIndex' lands reads: reads: instVarIndex Answer whether the receiver reads the instance variable with the givenindex refersTo: refersTo: anObject Answer whether the receiver refers to the given object sourceCodeMap sourceCodeMap Answer an array which maps bytecode indices to source codeline numbers. 0 values represent invalid instructionpointer indices. CompiledCode: translation discardTranslationdiscardTranslation Flush the just-in-time translated code for the receiver (if any). CompiledMethod CompiledMethod Defined in namespace SmalltalkSuperclass: CompiledCodeCategory: Language-Implementation I represent methods that have been compiled. I can recompilemethods from their source code, I can invoke Emacs to edit the source codefor one of my instances, and I know how to access components of myinstances. CompiledMethod class: instance creation literals:numArgs:numTemps:attributes:bytecodes:depth:literals: lits numArgs: numArg numTemps: numTemp attributes: attrArray bytecodes: bytecodes depth: depthAnswer a full fledged CompiledMethod. Construct the methodheader from the parameters, and set the literals and bytecodesto the provided ones. Also, the bytecodes are optimized andany embedded CompiledBlocks modified to refer to these literalsand to the newly created CompiledMethod. numArgs: valueWithReceiver:withArguments: numArgs: args Create a user-defined method (one that is sent#valueWithReceiver:withArguments: when it is invoked)with numArgs arguments. This only makes sense whencalled for a subclass of CompiledMethod. CompiledMethod class: lean images stripSourceCodestripSourceCode Remove all the references to method source code from the system CompiledMethod: accessing allBlocksDo:allBlocksDo: aBlock Evaluate aBlock, passing to it all the CompiledBlocks it holds allLiterals allLiterals Answer the literals referred to by the receiver and all the blocksin it flags flags Private - Answer the optimization flags for the receiver methodClass methodClass Answer the class in which the receiver is installed. methodClass: methodClass: methodClass Set the receiver's class instance variable numArgs numArgs Answer the number of arguments for the receiver numTemps numTemps Answer the number of temporaries for the receiver primitive primitive Answer the primitive called by the receiver selector selector Answer the selector through which the method is called selector: selector: aSymbol Set the selector through which the method is called stackDepth stackDepth Answer the number of stack slots needed for the receiver withAllBlocksDo: withAllBlocksDo: aBlock Evaluate aBlock, passing the receiver and all the CompiledBlocks itholds withNewMethodClass: withNewMethodClass: class Answer either the receiver or a copy of it, with the method class setto class withNewMethodClass:selector: withNewMethodClass: class selector: selector Answer either the receiver or a copy of it, with the method class setto class CompiledMethod: attributes attributeAt:attributeAt: aSymbol Return a Message for the first attribute named aSymbol defined by thereceiver, or answer an error if none was found. attributeAt:ifAbsent: attributeAt: aSymbol ifAbsent: aBlock Return a Message for the first attribute named aSymbol defined by thereceiver, or evaluate aBlock is none was found. attributes attributes Return an Array of Messages, one for each attribute defined by thereceiver. attributesDo: attributesDo: aBlock Evaluate aBlock once for each attribute defined by the receiver,passing a Message each time. isAnnotated isAnnotated If the receiver has any attributes, answer true. primitiveAttribute primitiveAttribute If the receiver defines a primitive, return a Message resemblingthe attribute that was used to define it. CompiledMethod: basic == aMethod Answer whether the receiver and aMethod are equal hash hash Answer an hash value for the receiver methodCategory methodCategory Answer the method category methodCategory: methodCategory: aCategory Set the method category to the given string methodSourceCode methodSourceCode Answer the method source code (a FileSegment or String or nil) methodSourceFile methodSourceFile Answer the file where the method source code is stored methodSourcePos methodSourcePos Answer the location where the method source code is stored inthe methodSourceFile methodSourceString methodSourceString Answer the method source code as a string CompiledMethod: c call-outs isValidCCallisValidCCall Not commented. rewriteAsAsyncCCall:args: rewriteAsAsyncCCall: func args: argsArray Not commented. rewriteAsCCall:for: rewriteAsCCall: func for: aClass Not commented. rewriteAsCCall:returning:args: rewriteAsCCall: func returning: returnType args: argsArray Not commented. CompiledMethod: invoking valueWithReceiver:withArguments: subclassResponsibilityvalueWithReceiver: anObject withArguments: args Execute the method within anObject, passing the elements of the argsArray as parameters. The method need not reside on the hierarchyfrom the receiver's class to Object – it need not reside at all ina MethodDictionary, in fact – but doing bad things will compromisestability of the Smalltalk virtual machine (and don't blame anybodybut yourself).If the flags field of the method header is 6, this method insteadprovides a hook from which the virtual machine can call back wheneverexecution of the method is requested. In this case, invoking themethod would cause an infinite loop (the VM asks the method torun, the method asks the VM to invoke it, and so on), so this methodfails with a #subclassResponsibility error. CompiledMethod: printing printOn:printOn: aStream Print the receiver's class and selector on aStream storeOn: storeOn: aStream Print code to create the receiver on aStream CompiledMethod: saving and loading binaryRepresentationObject >>tobinaryRepresentationObject This method is implemented to allow for a PluggableProxy to be usedwith CompiledMethods. Answer a DirectedMessage which sends #>>to the class object containing the receiver. CompiledMethod: testing accesses:accesses: instVarIndex Answer whether the receiver or the blocks it contains accessesthe instance variable with the given index assigns: assigns: instVarIndex Answer whether the receiver or the blocks it contains writes tothe instance variable with the given index reads: reads: instVarIndex Answer whether the receiver or the blocks it contains reads tothe instance variable with the given index ContextPart 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. ContextPart class: built ins thisContextthisContext Return the value of the thisContext variable. Called internallywhen the variable is accessed. ContextPart class: exception handling backtracebacktrace Print a backtrace from the caller to the bottom of the stack on theTranscript backtraceOn: backtraceOn: aStream Print a backtrace from the caller to the bottom of the stack on aStream lastUnwindPoint lastUnwindPoint Private - Return the last context marked as an unwind point, orour environment if none is. removeLastUnwindPoint removeLastUnwindPoint Private - Return and remove the last context marked as an unwind point,or our environment if the last unwind point belongs to anotherenvironment. unwind unwind Return execution to the last context marked as an unwind point, returningnil on that stack. unwind: unwind: returnValue Return execution to the last context marked as an unwind point, returningreturnValue on that stack. ContextPart: accessing clientclient Answer the client of this context, that is, the object that sent themessage that created this context. Fail if the receiver has no parent environment environment To create a valid execution environment for the interpreter even beforeit starts, GST creates a fake context whose selector is nil and whichcan be used as a marker for the current execution environment. Thismethod answers that context.For processes, it answers the process block itself home home Answer the MethodContext to which the receiver refers initialIP initialIP Answer the value of the instruction pointer when execution startsin the current context ip ip Answer the current instruction pointer into the receiver ip: ip: newIP Set the instruction pointer for the receiver isBlock isBlock Answer whether the receiver is a block context isDisabled continue: ensure: isDisabled Answers whether the context is skipped when doing a return. Contextsare marked as disabled whenever a non-local return is done (either byreturning from the enclosing method of a block, or with the#continue: method of ContextPart) and there are unwind contexts suchas those created by #ensure:. All non-unwind contexts are thenmarked as disabled. isEnvironment isEnvironment To create a valid execution environment for the interpreter evenbefore it starts, GST creates a fake context which invokes a special“termination” method. Such a context can be used as a marker forthe current execution environment. Answer whether the receiver isthat kind of context. isProcess newProcess isProcess Answer whether the receiver represents a process context, i.e. a contextcreated by BlockClosure>>#newProcess. Such a context can be recognizedbecause it has no parent but its flags are different from those of thecontexts created by the VM's prepareExecutionEnvironment function. isUnwind continue: ensure: isUnwind Answers whether the context must continue execution even after anon-local return (a return from the enclosing method of a block, ora call to the #continue: method of ContextPart). Such contexts arecreated by #ensure:. method method Return the CompiledMethod being executed methodClass methodClass Return the class in which the CompiledMethod being executed is defined numArgs numArgs Answer the number of arguments passed to the receiver numTemps numTemps Answer the number of temporaries used by the receiver parentContext parentContext Answer the context that called the receiver parentContext: parentContext: aContext Set the context to which the receiver will return push: push: anObject Push an object on the receiver's stack. receiver receiver Return the receiver (self) for the method being executed selector selector Return the selector for the method being executed size size Answer the number of valid fields for the receiver. Any readaccess from (self size + 1) to (self basicSize) has undefinedresults - even crashing sp sp Answer the current stack pointer into the receiver sp: sp: newSP Set the stack pointer for the receiver. validSize validSize Answer how many elements in the receiver should be inspected ContextPart: built ins continue: ensure: ifCurtailed:continue: anObject Resume execution from the receiver, faking that the context ontop of it in the execution chain has returned anObject. Thereceiver must belong to the same process as the executing context,otherwise the results are not predictable. All #ensure: (andpossibly #ifCurtailed:) blocks between the currently executingcontext and the receiver are evaluated (which is not whatwould happen if you directly bashed at the parent context ofthisContext). ContextPart: copying deepCopydeepCopy Answer a shallow copy of the receiver – duplicatinge.g. the method and the instance variables that havebeen pushed is almost surely not the right thing. ContextPart: debugging debuggerClassdebuggerClass Answer which debugger should be used to debug the currentcontext chain. The class with the highest debuggingpriority is picked among those mentioned in the chain. isInternalExceptionHandlingContext isInternalExceptionHandlingContext Answer whether the receiver is a context that should be hidden to the userwhen presenting a backtrace. ContextPart: enumerating scanBacktraceFor:do:scanBacktraceFor: selectors do: aBlock Scan the backtrace for contexts whose selector is among thoselisted in selectors; if one is found, invoke aBlock passing thecontext. scanBacktraceForAttribute:do: scanBacktraceForAttribute: selector do: aBlock Scan the backtrace for contexts which have the attribute selectorlisted in selectors; if one is found, invoke aBlock passing thecontext and the attribute. ContextPart: exception handling markmark Add the receiver as a possible unwind point ContextPart: printing backtracebacktrace Print a backtrace from the receiver to the bottom of the stack on theTranscript. backtraceOn: backtraceOn: aStream Print a backtrace from the caller to the bottom of the stack on aStream. ContextPart: security checks checkSecurityFor:checkSecurityFor: perm First of all, check against the static permissions for thiscontext. doSecurityCheckForName:actions:target: doSecurityCheckForName: name actions: actions target: target Not commented. securityCheckForName: securityCheckForName: name Not commented. securityCheckForName:action: securityCheckForName: name action: action Not commented. securityCheckForName:actions:target: securityCheckForName: name actions: actions target: target Not commented. securityCheckForName:target: securityCheckForName: name target: target Not commented. CoreException CoreException Defined in namespace SmalltalkSuperclass: TrappableEventCategory: Language-Exceptions My instances describe a single event that can be trapped using #on:do:...,contain whether such execution can be resumed after such an event, adescription of what happened, and a block that is used as an handler bydefault. Using my methods you can raise exceptions and create new exceptions.Exceptions are organized in a kind of hierarchy (different from the classhierarchy): intercepting an exception will intercept all its children too.CoreExceptions are different from ANSI Exceptions in that the signaledexception is not an instance of the CoreException, instead it belongsto a different class, Signal. ANSI Exceptions inherit from Signal buthold on to a CoreException via a class-instance variable. CoreException class: instance creation newnew Create a new exception whose parent is ExAll CoreException: accessing defaultHandlerdefaultHandler Answer the default handler for the receiver defaultHandler: defaultHandler: aBlock Set the default handler of the receiver to aBlock. A Signal object willbe passed to aBlock description description Answer a description of the receiver description: description: aString Set the description of the receiver to aString isResumable isResumable Answer true if the receiver is resumable isResumable: isResumable: aBoolean Set the resumable flag of the receiver to aBoolean parent parent Answer the parent of the receiver signalClass signalClass Answer the subclass of Signal to be passed to handler blocksthat handle the receiver signalClass: signalClass: aClass Set which subclass of Signal is to be passed to handler blocksthat handle the receiver CoreException: basic postCopypostCopy Modify the receiver so that the description is deep copied CoreException: enumerating allExceptionsDo:allExceptionsDo: aBlock Private - Evaluate aBlock for every exception in the receiver. As it contains just oneexception, evaluate it just once, passing the receiver goodness: goodness: exception Answer how good the receiver is at handling the given exception. Anegative value indicates that the receiver is not able to handlethe exception. handles: handles: exceptionOrSignal Answer whether the receiver handles `exceptionOrSignal'. CoreException: exception handling signalsignal Raise the exception described by the receiver, passing no parameters signalWith: signalWith: arg Raise the exception described by the receiver, passing the parameter arg signalWith:with: signalWith: arg with: arg2 Raise the exception described by the receiver, passing the parameters argand arg2 signalWithArguments: signalWithArguments: args Raise the exception described by the receiver, passing the parameters inargs CoreException: instance creation newChildnewChild Answer a child exception of the receiver. Its properties are set to thoseof the receiver CPtr CPtr Defined in namespace SmalltalkSuperclass: CAggregateCategory: Language-C interface CPtr: accessing alignofalignof Answer the receiver's required aligment sizeof sizeof Answer the receiver's size value value Answer the address of the location pointed to by the receiver. value: value: anObject Set the address of the location pointed to by the receiverto anObject, which can be either an Integer or a CObject.if anObject is an Integer, it is interpreted as a 32-bitor 64-bit address. If it is a CObject, its address isstored. CPtrCType CPtrCType Defined in namespace SmalltalkSuperclass: CTypeCategory: Language-C interface CPtrCType class: instance creation elementType:elementType: aCType Answer a new instance of CPtrCType that maps pointers to the given CType CPtrCType: accessing elementTypeelementType Answer the type of the elements in the receiver's instances new: new: size Allocate space for `size' objects like those that the receiver pointsto, and with the type (class) identified by the receiver.It is the caller's responsibility to free the memory allocated for it. CScalar CScalar Defined in namespace SmalltalkSuperclass: CObjectCategory: Language-C interface CScalar class: instance creation typetype Answer a CType for the receiver - for example, CByteType ifthe receiver is CByte. value: addToBeFinalized value: anObject Answer a newly allocated CObject containing the passed value,anObject. Remember to call #addToBeFinalized if you want theCObject to be automatically freed CScalar: accessing cObjStoredType at:put:cObjStoredType Private - Provide a conversion from a CObject to a Smalltalk objectto be stored by #at:put: value value Answer the value the receiver is pointing to. The exact returnedvalue depends on the receiver's class value: value: aValue Set the receiver to point to the value, aValue. The exact meaningof aValue depends on the receiver's class CScalarCType CScalarCType Defined in namespace SmalltalkSuperclass: CTypeCategory: Language-C interface CScalarCType: accessing valueTypevalueType valueType is used as a means to communicate to the interpreter theunderlying type of the data. For scalars, it is supplied by theCObject subclass. CScalarCType: storing storeOn:storeOn: aStream Store Smalltalk code that compiles to the receiver CShort CShort Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CShort class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CShort: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CSmalltalk CSmalltalk Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CSmalltalk class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CSmalltalk: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CString CString Defined in namespace SmalltalkSuperclass: CPtrCategory: Language-C interface Technically, CString is really a pointer to CChar. However, it can bevery useful as a distinct datatype because it is a separate datatypein Smalltalk, so we allow developers to express their semantics moreprecisely by using a more descriptive type.Note that like CChar is a pointer to char, CString is actually a *pointer*to string: a char ** in C terms. If you need to take a String out of achar *, use CChar>>#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 #valuemethod returns a Smalltalk String, as you would expect for a scalar datatype. CString class: instance creation typetype Answer a CType for the receiver - for example, CByteType ifthe receiver is CByte. value: addToBeFinalized value: anObject Answer a newly allocated CObject containing the passed value,anObject. Remember to call #addToBeFinalized if you want theCObject to be automatically freed CString: accessing cObjStoredType at:put:cObjStoredType Private - Provide a conversion from a CObject to a Smalltalk objectto be stored by #at:put: value value Answer the value the receiver is pointing to. The exact returnedvalue depends on the receiver's class value: value: aValue Set the receiver to point to the value, aValue. The exact meaningof aValue depends on the receiver's class CStringCType CStringCType Defined in namespace SmalltalkSuperclass: CScalarCTypeCategory: Language-C interface CStringCType: accessing elementTypeelementType Answer the type of the elements in the receiver's instances CStruct CStruct Defined in namespace SmalltalkSuperclass: CCompoundCategory: Language-C interface CStruct class: subclass creation compileDeclaration:compileDeclaration: array Compile methods that implement the declaration in array. CType CType Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface I am not part of the standard Smalltalk kernel class hierarchy.I contain type information used by subclasses of CObject, which representsexternal C data items.My only instance variable, cObjectType, is used to hold onto the CObjectsubclass that gets created for a given CType. Used primarily in the C partof the interpreter because internally it cannot execute methods to get values,so it has a simple way to access instance variable which holds the desiredsubclass.My subclasses have instances which represent the actual data types; for thescalar types, there is only one instance created of each, but for theaggregate types, there is at least one instance per base type and/or number ofelements. CType class: C instance creation cObjectType:cObjectType: aCObjectSubclass Create a new CType for the given subclass of CObject CType: accessing alignofalignof Answer the size of the receiver's instances arrayType: arrayType: size Answer a CArrayCType which represents an array with the given sizeof CObjects whose type is in turn represented by the receiver cObjectType cObjectType Answer the CObject subclass whose instance is created when new is sentto the receiver ptrType ptrType Answer a CPtrCType which represents a pointer to CObjects whosetype is in turn represented by the receiver sizeof sizeof Answer the size of the receiver's instances valueType valueType valueType is used as a means to communicate to the interpreter theunderlying type of the data. For anything but scalars, it's just 'self' CType: C instance creation address:address: cObjOrInt Create a new CObject with the type (class) identified by the receiver,pointing to the given address (identified by an Integer or CObject). new new Allocate a new CObject with the type (class) identified by the receiver.It is the caller's responsibility to free the memory allocated for it. CType: storing storeOn:storeOn: aStream Store Smalltalk code that compiles to the receiver CUChar CUChar Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CUChar class: getting info alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CUChar: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CUInt CUInt Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CUInt class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CUInt: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CULong CULong Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CULong class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CULong: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size CUnion CUnion Defined in namespace SmalltalkSuperclass: CCompoundCategory: Language-C interface CUnion class: subclass creation compileDeclaration:compileDeclaration: array Compile methods that implement the declaration in array. CUShort CUShort Defined in namespace SmalltalkSuperclass: CScalarCategory: Language-C interface CUShort class: accessing alignofalignof Answer the receiver's instances required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's instances scalar type sizeof sizeof Answer the receiver's instances size CUShort: accessing alignofalignof Answer the receiver's required aligment scalarIndex scalarIndex Private - Answer an index referring to the receiver's scalar type sizeof sizeof Answer the receiver's size Date Date Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types My instances represent dates. My base date is defined to be Jan 1, 1901.I provide methods for instance creation (including via "symbolic" dates,such as "Date newDay: 14 month: #Feb year: 1990".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. Inaddition, since ten days were lost from October 5 through October 15,operations between 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 willyield 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 will assume that it is a two-digit year (e.g. 90=1990, 1000=2900). The onlyway to create Julian calendar dates is with the #fromDays: instance creationmethod. Date class: basic abbreviationOfDay:abbreviationOfDay: dayIndex Answer the abbreviated name of the day of week corresponding to the givenindex dayOfWeek: dayOfWeek: dayName Answer the index of the day of week corresponding to the given name daysInMonth:forYear: daysInMonth: monthName forYear: yearInteger Answer the number of days in the given (named) month for the given year daysInYear: daysInYear: i Answer the number of days in the given year indexOfMonth: indexOfMonth: monthName Answer the index of the month corresponding to the given name initDayNameDict initDayNameDict Initialize the DayNameDict to the names of the days initialize initialize Initialize the receiver initMonthNameDict initMonthNameDict Initialize the MonthNameDict to the names of the months nameOfDay: nameOfDay: dayIndex Answer the name of the day of week corresponding to the given index nameOfMonth: nameOfMonth: monthIndex Answer the name of the month corresponding to the given index shortNameOfMonth: shortNameOfMonth: monthIndex Answer the name of the month corresponding to the given index Date class: instance creation (ANSI) year:day:hour:minute:second:year: y day: d hour: h minute: min second: s Answer a Date denoting the d-th day of the given year year:month:day:hour:minute:second: year: y month: m day: d hour: h minute: min second: s Answer a Date denoting the d-th day of the given (as a number)month and year Date class: instance creation (Blue Book) dateAndTimeNowdateAndTimeNow Answer an array containing the current date and time fromDays: fromDays: dayCount Answer a Date denoting dayCount days past 1/1/1901 fromJulian: fromJulian: jd Answer a Date denoting the jd-th day in the astronomical Julian calendar. fromSeconds: fromSeconds: time Answer a Date denoting the date time seconds past Jan 1st, 1901 newDay:month:year: newDay: day month: monthName year: yearInteger Answer a Date denoting the dayCount day of the given (named)month and year newDay:monthIndex:year: newDay: day monthIndex: monthIndex year: yearInteger Answer a Date denoting the dayCount day of the given (as a number)month and year newDay:year: newDay: dayCount year: yearInteger Answer a Date denoting the dayCount day of the yearInteger year readFrom: readFrom: aStream Parse an instance of the receiver from aStream today today Answer a Date denoting the current date in local time utcDateAndTimeNow utcDateAndTimeNow Answer an array containing the current date and time in CoordinatedUniversal Time (UTC) utcToday utcToday Answer a Date denoting the current date in Coordinated UniversalTime (UTC) Date: basic addDays:addDays: dayCount Answer a new Date pointing dayCount past the receiver subtractDate: subtractDate: aDate Answer the number of days between aDate and the receiver (negativeif the receiver is before aDate) subtractDays: subtractDays: dayCount Answer a new Date pointing dayCount before the receiver Date: compatibility (non-ANSI) dayday Answer the day represented by the receiver dayName dayName Answer the day of week of the receiver as a Symbol shortMonthName shortMonthName Answer the abbreviated name of the month represented by the receiver Date: date computations asSecondsasSeconds Answer the date as the number of seconds from 1/1/1901. dayOfMonth day dayOfMonth Answer the day represented by the receiver (same as #day) dayOfWeek dayOfWeek Answer the day of week of the receiver. 1 = Monday, 7 = Sunday dayOfWeekAbbreviation dayOfWeekAbbreviation Answer the day of week of the receiver as a Symbol dayOfWeekName dayOfWeekName Answer the day of week of the receiver as a Symbol dayOfYear dayOfYear Answer the days passed since 31/12 of last year; e.g. New Year's Day is 1 daysFromBaseDay daysFromBaseDay Answer the days passed since 1/1/1901 daysInMonth daysInMonth Answer the days in the month represented by the receiver daysInYear daysInYear Answer the days in the year represented by the receiver daysLeftInMonth daysLeftInMonth Answer the days to the end of the month represented by the receiver daysLeftInYear daysLeftInYear Answer the days to the end of the year represented by the receiver firstDayOfMonth firstDayOfMonth Answer a Date representing the first day of the month represented by thereceiver isLeapYear isLeapYear Answer whether the receiver refers to a date in a leap year. lastDayOfMonth lastDayOfMonth Answer a Date representing the last day of the month represented by thereceiver month month Answer the index of the month represented by the receiver monthAbbreviation monthAbbreviation Answer the abbreviated name of the month represented by the receiver monthIndex monthIndex Answer the index of the month represented by the receiver monthName monthName Answer the name of the month represented by the receiver year year Answer the year represented by the receiver Date: printing printOn:printOn: aStream Print a representation for the receiver on aStream Date: storing storeOn:storeOn: aStream Store on aStream Smalltalk code compiling to the receiver Date: testing << aDate Answer whether the receiver indicates a date preceding aDate = = aDate Answer whether the receiver indicates the same date as aDate hash hash Answer an hash value for the receievr DateTime DateTime Defined in namespace SmalltalkSuperclass: DateCategory: Language-Data types My instances represent timestamps. DateTime class: information clockPrecisionclockPrecision Answer `ClockPrecision'. initialize initialize Initialize the receiver's class variables DateTime class: instance creation nownow Answer an instance of the receiver referring to the currentdate and time. readFrom: readFrom: aStream Parse an instance of the receiver from aStream year:day:hour:minute:second: year: y day: d hour: h minute: min second: s Answer a DateTime denoting the d-th day of the given year, andsetting the time part to the given hour, minute, and second year:day:hour:minute:second:offset: year: y day: d hour: h minute: min second: s offset: ofs Answer a DateTime denoting the d-th day of the given year.Set the offset field to ofs (a Duration), and the time partto the given hour, minute, and second year:month:day:hour:minute:second: year: y month: m day: d hour: h minute: min second: s Answer a DateTime denoting the d-th day of the given (as a number)month and year, setting the time part to the given hour, minute,and second year:month:day:hour:minute:second:offset: year: y month: m day: d hour: h minute: min second: s offset: ofs Answer a DateTime denoting the d-th day of the given (as a number)month and year. Set the offset field to ofs (a Duration), andthe the time part to the given hour, minute, and second DateTime class: instance creation (non-ANSI) fromDays:seconds:offset:fromDays: days seconds: secs offset: ofs Answer a DateTime denoting the d-th day of the given (as a number)month and year. Set the offset field to ofs (a Duration), andthe the time part to the given hour, minute, and second DateTime: basic ++ aDuration Answer a new Date pointing dayCount past the receiver - - aDateTimeOrDuration Answer a new Date pointing dayCount before the receiver DateTime: computations asSecondsasSeconds Answer the date as the number of seconds from 1/1/1901. dayOfWeek dayOfWeek Answer the day of week of the receiver. Unlike Dates, DateAndTimeshave 1 = Sunday, 7 = Saturday hour hour Answer the hour in a 24-hour clock hour12 hour12 Answer the hour in a 12-hour clock hour24 hour24 Answer the hour in a 24-hour clock meridianAbbreviation AM PM meridianAbbreviation Answer either #AM (for anti-meridian) or #PM (for post-meridian) minute minute Answer the minute second second Answer the month represented by the receiver DateTime: printing printOn:printOn: aStream Print a representation for the receiver on aStream DateTime: splitting in dates & times asDateasDate Answer a Date referring to the same day as the receiver asTime asTime Answer a Time referring to the same time (from midnight) as the receiver at: at: anIndex Since in the past timestamps were referred to as Arrays containinga Date and a Time (in this order), this method provides access toDateTime objects like if they were two-element Arrays. DateTime: storing storeOn:storeOn: aStream Store on aStream Smalltalk code compiling to the receiver DateTime: testing << aDateTime Answer whether the receiver indicates a date preceding aDate = = aDateTime Answer whether the receiver indicates the same date as aDate hash hash Answer an hash value for the receievr DateTime: time zones asLocalasLocal Answer the receiver, since DateTime objects store themselvesin Local time asUTC asUTC Convert the receiver to UTC time, and answer a new DateTime object. offset offset Answer the receiver's offset from UTC to local time (e.g. +3600 secondsfor Central Europe Time, -3600*6 seconds for Eastern Standard Time).The offset is expressed as a Duration offset: offset: anOffset Answer a copy of the receiver with the offset from UTC to local timechanged to anOffset (a Duration). timeZoneAbbreviation timeZoneAbbreviation Answer an abbreviated indication of the receiver's offset, expressedas `shhmm', where `hh' is the number of hours and `mm' is the numberof minutes between UTC and local time, and `s' can be `+' for theEastern hemisphere and `-' for the Western hemisphere. timeZoneName timeZoneAbbreviation timeZoneName Answer the time zone name for the receiver (currently, it issimply `GMT +xxxx', where `xxxx' is the receiver's#timeZoneAbbreviation). Delay Delay Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-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,that process goes to sleep for the interval specified when the instance wascreated. Delay class: general inquiries millisecondClockValuemillisecondClockValue Private - Answer the number of milliseconds since midnight Delay class: initialization initializeinitialize Private - Initialize the receiver and the associated process Delay class: instance creation forMilliseconds:forMilliseconds: millisecondCount Answer a Delay waiting for millisecondCount milliseconds forSeconds: forSeconds: secondCount Answer a Delay waiting for secondCount seconds untilMilliseconds: untilMilliseconds: millisecondCount Answer a Delay waiting for millisecondCount milliseconds after midnight Delay: accessing resumptionTimeresumptionTime Answer the time when a process waiting on a Delay will resume Delay: comparing == aDelay Answer whether the receiver and aDelay denote the same delay hash hash Answer an hash value for the receiver Delay: process delay waitwait Wait until the amount of time represented by the instance of Delayelapses DelayedAdaptor DelayedAdaptor Defined in namespace SmalltalkSuperclass: PluggableAdaptorCategory: Language-Data types I can be used where many expensive updates must be performed. My in-stances buffer the last value that was set, and only actually set thevalue when the #trigger message is sent. Apart from this, I'm equi-valent to PluggableAdaptor. DelayedAdaptor: accessing triggertrigger Really set the value of the receiver. value value Get the value of the receiver. value: trigger value: anObject Set the value of the receiver - actually, the value is cached andis not set until the #trigger method is sent. Dictionary Dictionary Defined in namespace SmalltalkSuperclass: HashedCollectionCategory: Collections-Keyed I implement a dictionary, which is an object that is indexed byunique objects (typcially instances of Symbol), and associates anotherobject with that index. I use the equality operator = to determineequality of indices. Dictionary class: instance creation newnew Create a new dictionary with a default size Dictionary: accessing add:add: newObject Add the newObject association to the receiver addAll: addAll: aCollection Adds all the elements of 'aCollection' to the receiver, answeraCollection associationAt: associationAt: key Answer the key/value Association for the given key. Fail if the keyis not found associationAt:ifAbsent: associationAt: key ifAbsent: aBlock Answer the key/value Association for the given key. Evaluate aBlock(answering the result) if the key is not found at: at: key Answer the value associated to the given key. Fail if the keyis not found at:ifAbsent: at: key ifAbsent: aBlock Answer the value associated to the given key, or the result of evaluatingaBlock if the key is not found at:ifAbsentPut: at: aKey ifAbsentPut: aBlock Answer the value associated to the given key. If the key is not found,evaluate aBlock and associate the result to aKey before returning. at:ifPresent: at: aKey ifPresent: aBlock If aKey is absent, answer nil. Else, evaluate aBlock passing theassociated value and answer the result of the invocation at:put: at: key put: value Store value as associated to the given key keyAtValue: keyAtValue: value Answer the key associated to the given value, or nil if the value is not found keyAtValue:ifAbsent: keyAtValue: value ifAbsent: exceptionBlock Answer the key associated to the given value. Evaluate exceptionBlock(answering the result) if the value is not found.IMPORTANT: == is used to compare values keys keys Answer a kind of Set containing the keys of the receiver values values Answer an Array containing the values of the receiver Dictionary: awful ST-80 compatibility hacks findKeyIndex:findKeyIndex: key Tries to see if key exists as a the key of an indexed variable. As soonas nil or an association with the correct key is found, the index of thatslot is answered Dictionary: dictionary enumerating associationsDo:associationsDo: aBlock Pass each association in the dictionary to aBlock collect: collect: aBlock Answer a new dictionary where the keys are the same and the values areobtained by passing each value to aBlock and collecting the return values do: do: aBlock Pass each value in the dictionary to aBlock keysAndValuesDo: keysAndValuesDo: aBlock Pass each key/value pair in the dictionary as two distinct parametersto aBlock keysDo: keysDo: aBlock Pass each key in the dictionary to aBlock reject: reject: aBlock Answer a new dictionary containing the key/value pairs for which aBlockreturns false. aBlock only receives the value part of the pairs. select: select: aBlock Answer a new dictionary containing the key/value pairs for which aBlockreturns true. aBlock only receives the value part of the pairs. Dictionary: dictionary removing remove:remove: anAssociation Remove anAssociation's key from the dictionary remove:ifAbsent: remove: anAssociation ifAbsent: aBlock Remove anAssociation's key from the dictionary removeAllKeys: removeAllKeys: keys Remove all the keys in keys, without raising any errors removeAllKeys:ifAbsent: removeAllKeys: keys ifAbsent: aBlock Remove all the keys in keys, passing the missing keys as parametersto aBlock as they're encountered removeKey: removeKey: key Remove the passed key from the dictionary, fail if it is not found removeKey:ifAbsent: removeKey: key ifAbsent: aBlock Remove the passed key from the dictionary, answer the result ofevaluating aBlock if it is not found Dictionary: dictionary testing includes:includes: anObject Answer whether the receiver contains anObject asone of its values includesAssociation: includesAssociation: anAssociation Answer whether the receiver contains the key which isanAssociation's key and its value is anAssociation's value includesKey: includesKey: key Answer whether the receiver contains the given key occurrencesOf: occurrencesOf: aValue Answer whether the number of occurrences of aValue asone of the receiver's values Dictionary: polymorphism hacks withAllSuperspaceswithAllSuperspaces This method is needed by the compiler Dictionary: printing inspectinspect Print all the instance variables and objects in the receiver on theTranscript printOn: printOn: aStream Print a representation of the receiver on aStream Dictionary: rehashing rehashrehash Rehash the receiver Dictionary: storing storeOn:storeOn: aStream Print Smalltalk code compiling to the receiver on aStream Dictionary: testing == aDictionary Answer whether the receiver and aDictionary are equal hash hash Answer the hash value for the receiver DirectedMessage DirectedMessage Defined in namespace SmalltalkSuperclass: MessageCategory: Language-Implementation I represent a message send: I contain the receiver, selector and argumentsfor a message. DirectedMessage class: creating instances selector:arguments:selector: aSymbol arguments: anArray This method should not be called for instances of this class. selector:arguments:receiver: selector: aSymbol arguments: anArray receiver: anObject Create a new instance of the receiver DirectedMessage: accessing receiverreceiver Answer the receiver receiver: receiver: anObject Change the receiver DirectedMessage: basic printOn:printOn: aStream Print a representation of the receiver on aStream send send Send the message value value Send the message (this message provides interoperabilitybetween DirectedMessages and blocks) DirectedMessage: multiple process forkfork Create a new process executing the receiver and start it forkAt: forkAt: priority Create a new process executing the receiver with given priorityand start it newProcess newProcess Create a new process executing the receiver in suspended state.The priority is the same as for the calling process. The receivermust not contain returns DirectedMessage: saving and loading reconstructOriginalObjectreconstructOriginalObject This method is used when DirectedMessages are used togetherwith PluggableProxies (see ObjectDumper). It sends the receiverto reconstruct the object that was originally stored. Directory Directory Defined in namespace SmalltalkSuperclass: FileCategory: Streams-Files I am the counterpart of File in a tree-structured file system: I caniterate through the file that I contain and construct new instancesof File and Directory. In addition I have the notion of a currentworking directory (which alas must be a real directory and not avirtual one). Directory class: C call-outs primWorking:primWorking: dirName Not commented. Directory class: file name management append:to:append: fileName to: directory Answer the name of a file named `fileName' which resides in a directorynamed `directory'. pathSeparator pathSeparator Answer (as a Character) the character used to separate directory names pathSeparatorString pathSeparatorString Answer (in a String) the character used to separate directory names Directory class: file operations allFilesMatching:do:allFilesMatching: aPattern do: aBlock Not commented. create: create: dirName Create a directory named dirName. working working Not commented. working: working: dirName Change the current working directory to dirName. Directory class: reading system defaults homehome Answer the path to the user's home directory image image Answer the path to GNU Smalltalk's image file kernel kernel Answer the path in which a local version of the GNU Smalltalk kernel'sSmalltalk source files were searched when the image was created localKernel localKernel Answer the path in which a local version of the GNU Smalltalk kernel'sSmalltalk source files were found module module Answer the path to GNU Smalltalk's dynamically loaded modules systemKernel systemKernel Answer the path to the GNU Smalltalk kernel's Smalltalk source files temporary temporary Answer the path in which temporary files can be created. This isread from the environment, and guessed if that fails. Directory: accessing at:at: aName Answer a File or Directory object as appropriate for a file named'aName' in the directory represented by the receiver. directoryAt: directoryAt: aName Answer a Directory object for a file named `aName' residing in thedirectory represented by the receiver. fileAt: fileAt: aName Answer a File object for a file named `aName' residing in thedirectory represented by the receiver. fullNameAt: fullNameAt: aName Answer a String containing the full path to a file named `aName' whichresides in the directory represented by the receiver. includes: includes: aName Answer whether a file named `aName' exists in the directory representedby the receiver. nameAt: nameAt: aName Answer a String containing the path to a file named `aName' whichresides in the directory represented by the receiver. Directory: enumerating allFilesMatching:do: match:allFilesMatching: aPattern do: aBlock Evaluate aBlock on the File objects that match aPattern (according toString>>#match:) in the directory named by the receiver. Recursivelydescend into directories. contents contents Answer an Array with the names of the files in the directoryrepresented by the receiver. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. aBlock should not return. filesMatching:do: match: filesMatching: aPattern do: block Evaluate block on the File objects that match aPattern (according toString>>#match:) in the directory named by the receiver. namesMatching:do: match: namesMatching: aPattern do: block Evaluate block on the file names that match aPattern (according toString>>#match:) in the directory named by the receiver. DLD DLD Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-C interface ...and Gandalf said:“Many folk like to know beforehand what is to be set on thetable; but those who have laboured to prepare the feast liketo keep their secret; for wonder makes the words of praiselouder.”I am just an ancillary class used to reference some C functions.Most of my actual functionality is used by redefinitions of methodsin CFunctionDescriptor. DLD class: C call-outs defineCFunc:as:defineCFunc: aName as: aFuncAddr Not commented. library:getFunc: library: libHandle getFunc: aFuncString Not commented. linkFile: linkFile: aFileName Not commented. DLD class: dynamic linking addLibrary:addLibrary: library Add library to the search path of libraries to be used by DLD. addModule: addModule: library Add library to the list of modules to be loaded when the image isstarted. The gst_initModule function in the library is called,but the library will not be put in the search path used whenevera C function is requested but not registered. defineExternFunc: primDefineExternFunc: defineExternFunc: aFuncName This method calls #primDefineExternFunc: to try to link to a function withthe given name, and answers whether the linkage was successful. You canredefine this method to restrict the ability to do dynamic linking. initialize initialize Private - Initialize the receiver's class variables libraryList libraryList Answer a copy of the search path of libraries to be used by DLD moduleList moduleList Answer a copy of the modules reloaded when the image is started primDefineExternFunc: primDefineExternFunc: aFuncName This method tries to link to a function with the given name, and answerswhether the linkage was successful. It should not be overridden. update: update: aspect Called on startup - Make DLD re-link and reset the addresses ofall the externally defined functions DumperProxy DumperProxy Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams-Files I am an helper class for ObjectDumper. When anobject cannot be saved in the standard way, you can register a subclass of meto provide special means to save that object. DumperProxy class: accessing acceptUsageForClass:acceptUsageForClass: aClass The receiver was asked to be used as a proxy for the class aClass.Answer whether the registration is fine. By default, answer true loadFrom: loadFrom: anObjectDumper Reload a proxy stored in anObjectDumper and reconstruct the object DumperProxy class: instance creation on: dumpTo:on: anObject Answer a proxy to be used to save anObject. This methodMUST be overridden and anObject must NOT be stored in theobject's instance variables unless you override #dumpTo:,because that would result in an infinite loop! DumperProxy: saving and restoring dumpTo: loadFrom:dumpTo: anObjectDumper Dump the proxy to anObjectDumper – the #loadFrom: class methodwill reconstruct the original object. object object Reconstruct the object stored in the proxy and answer it Duration Duration Defined in namespace SmalltalkSuperclass: TimeCategory: Language-Data types My instances represent differences between timestamps. Duration class: instance creation days:days: d Answer a duration of `d' days days:hours:minutes:seconds: days: d hours: h minutes: m seconds: s Answer a duration of `d' days and the given number of hours,minutes, and seconds. initialize initialize Initialize the receiver's instance variables zero zero Answer a duration of zero seconds. Duration class: instance creation (non ANSI) fromDays:seconds:offset:fromDays: days seconds: secs offset: unused Answer a duration of `d' days and `secs' seconds. The lastparameter is unused; this message is available for interoperabilitywith the DateTime class. Duration: arithmetics ** factor Answer a Duration that is `factor' times longer than the receiver + + aDuration Answer a Duration that is the sum of the receiver and aDuration'slengths. - - aDuration Answer a Duration that is the difference of the receiver and aDuration'slengths. / / factorOrDuration If the parameter is a Duration, answer the ratio between the receiverand factorOrDuration. Else divide the receiver by factorOrDuration (aNumber) and answer a new Duration that is correspondingly shorter. abs abs Answer a Duration that is as long as the receiver, but always inthe future. days days Answer the number of days in the receiver negated negated Answer a Duration that is as long as the receiver, but with past andfuture exchanged. negative negative Answer whether the receiver is in the past. positive positive Answer whether the receiver is a zero-second duration or isin the future. printOn: printOn: aStream Print a represention of the receiver on aStream. Error Error Defined in namespace SmalltalkSuperclass: ExceptionCategory: Language-Exceptions Error represents a fatal error. Instances of it are not resumable. Error: exception description descriptiondescription Answer a textual description of the exception. isResumable isResumable Answer false. Error exceptions are by default unresumable; subclassescan override this method if desired. Exception Exception Defined in namespace SmalltalkSuperclass: SignalCategory: Language-Exceptions An Exception defines the characteristics of an exceptional eventin a different way than CoreExceptions. Instead of creating anhierarchy of objects and setting attributes of the objects, youcreate an hierarchy of classes and override methods in those classes;instances of those classes are passed to the handlers instead ofinstances of the common class Signal.Internally, Exception and every subclass of it hold onto aCoreException, so the two mechanisms are actually interchangeable. Exception class: comparison goodness:goodness: anException Answer how good the receiver is at handling the given exception. Anegative value indicates that the receiver is not able to handlethe exception. handles: handles: anException Answer whether the receiver handles `anException'. Exception class: creating ExceptionCollections ,, aTrappableEvent Answer an ExceptionCollection containing all the exceptions in thereceiver and all the exceptions in aTrappableEvent Exception class: initialization initializeinitialize Initialize the `links' between the core exception handling systemand the ANSI exception handling system. Exception class: instance creation newnew Create an instance of the receiver, which you will be able tosignal later. signal signal Create an instance of the receiver, give it default attributes,and signal it immediately. signal: signal: messageText Create an instance of the receiver, set its message text,and signal it immediately. Exception class: interoperability with TrappableEvents allExceptionsDo:allExceptionsDo: aBlock Private - Pass the coreException to aBlock coreException coreException Private - Answer the coreException which represents instances ofthe receiver whenSignalledIn:do:exitBlock: whenSignalledIn: onDoBlock do: handlerBlock exitBlock: exitBlock Private - Create an ExceptionHandler from the arguments and register it Exception: comparison == anObject Answer whether the receiver is equal to anObject. This is true ifeither the receiver or its coreException are the same object as anObject. hash hash Answer an hash value for the receiver. Exception: exception description defaultActiondefaultAction Execute the default action that is attached to the receiver. description description Answer a textual description of the exception. isResumable isResumable Answer true. Exceptions are by default resumable. Exception: exception signaling signalsignal Raise the exceptional event represented by the receiver signal: signal: messageText Raise the exceptional event represented by the receiver, settingits message text to messageText. ExceptionSet ExceptionSet Defined in namespace SmalltalkSuperclass: TrappableEventCategory: 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 ExceptionSet class: instance creation newnew Private - Answer a new, empty ExceptionSet ExceptionSet: enumerating allExceptionsDo:allExceptionsDo: aBlock Private - Evaluate aBlock for every exception in the receiver. Answer thereceiver goodness: goodness: exception Answer how good the receiver is at handling the given exception. Anegative value indicates that the receiver is not able to handlethe exception. handles: handles: exception Answer whether the receiver handles `exception'. False False Defined in namespace SmalltalkSuperclass: BooleanCategory: Language-Data types I always tell lies.I have a single instance in the system, which represents the value false. False: basic && aBoolean We are false – anded with anything, we always answer false and: and: aBlock We are false – anded with anything, we always answer false eqv: eqv: aBoolean Answer whether the receiver and aBoolean represent thesame boolean value ifFalse: ifFalse: falseBlock We are false – evaluate the falseBlock ifFalse:ifTrue: ifFalse: falseBlock ifTrue: trueBlock We are false – evaluate the falseBlock ifTrue: ifTrue: trueBlock We are false – answer nil ifTrue:ifFalse: ifTrue: trueBlock ifFalse: falseBlock We are false – evaluate the falseBlock not not We are false – answer true or: or: aBlock We are false – ored with anything, we always answer the other operand,so evaluate aBlock xor: xor: aBoolean Answer whether the receiver and aBoolean represent differentboolean values | | aBoolean We are false – ored with anything, we always answer the other operand False: C hacks asCBooleanValueasCBooleanValue Answer `0'. False: printing printOn:printOn: aStream Print a representation of the receiver on aStream File File Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams-Files I expose the syntax of file names, including paths. I know how tomanipulate such a path by splitting it into its components. In addition,I expose information about files (both real and virtual) such as theirsize and timestamps. File class: C functions errnoerrno Not commented. stringError: stringError: errno Not commented. File class: file name management extensionFor:extensionFor: aString Answer the extension of a file named `aString'. Note: the extensionincludes an initial dot. fullNameFor: fullNameFor: aString Answer the full path to a file called `aString', resolving the `.' and`..' directory entries, and answer the result. `/..' is the same as '/'. pathFor: pathFor: aString Determine the path of the name of a file called `aString', andanswer the result. With the exception of the root directory, thefinal slash is stripped. pathFor:ifNone: pathFor: aString ifNone: aBlock Determine the path of the name of a file called `aString', andanswer the result. With the exception of the root directory, thefinal slash is stripped. If there is no path, evaluate aBlock andreturn the result. stripExtensionFrom: stripExtensionFrom: aString Remove the extension from the name of a file called `aString', andanswer the result. stripFileNameFor: stripFileNameFor: aString Determine the path of the name of a file called `aString', andanswer the result as a directory name including the final slash. stripPathFrom: stripPathFrom: aString Remove the path from the name of a file called `aString', andanswer the file name plus extension. File class: file operations checkErrorcheckError Return whether an error had been reported or not.If there had been one, raise an exception too checkError: checkError: errno The error with the C code `errno' has been reported.If errno >= 1, raise an exception remove: remove: fileName Remove the file with the given path name rename:to: rename: oldFileName to: newFileName Rename the file with the given path name oldFileName to newFileName touch: touch: fileName Update the timestamp of the file with the given path name. File class: instance creation name:name: aName Answer a new file with the given path. The path is not validated untilsome of the fields of the newly created objects are accessed on: on: aVFSHandler Answer a new file with the given path. The handler that returnsthe information is aVFSHandler File class: reading system defaults imageimage Answer the full path to the image being used. File class: testing exists:exists: fileName Answer whether a file with the given name exists isAccessible: isAccessible: fileName Answer whether a directory with the given name exists and can be accessed isExecutable: isExecutable: fileName Answer whether a file with the given name exists and can be executed isReadable: isReadable: fileName Answer whether a file with the given name exists and is readable isWriteable: isWriteable: fileName Answer whether a file with the given name exists and is writeable File: accessing creationTimecreationTime Answer the creation time of the file identified by the receiver.On some operating systems, this could actually be the last change time(the `last change time' has to do with permissions, ownership and thelike). lastAccessTime lastAccessTime Answer the last access time of the file identified by the receiver lastAccessTime: lastAccessTime: aDateTime Update the last access time of the file corresponding to the receiver,to be aDateTime. lastAccessTime:lastModifyTime: lastAccessTime: accessDateTime lastModifyTime: modifyDateTime Update the timestamps of the file corresponding to the receiver, to beaccessDateTime and modifyDateTime. lastChangeTime lastChangeTime Answer the last change time of the file identified by the receiver(the `last change time' has to do with permissions, ownership and thelike). On some operating systems, this could actually be thefile creation time. lastModifyTime lastModifyTime Answer the last modify time of the file identified by the receiver(the `last modify time' has to do with the actual file contents). lastModifyTime: lastModifyTime: aDateTime Update the last modification timestamp of the file corresponding to thereceiver, to be aDateTime. name name Answer the name of the file identified by the receiver refresh refresh Refresh the statistics for the receiver size size Answer the size of the file identified by the receiver File: file name management extensionextension Answer the extension of the receiver fullName fullName Answer the full name of the receiver, resolving the `.' and`..' directory entries, and answer the result. Answer nil if thename is invalid (such as '/usr/../../badname') path path Answer the path (if any) of the receiver stripExtension stripExtension Answer the path (if any) and file name of the receiver stripFileName stripFileName Answer the path of the receiver, always including a directoryname (possibly `.') and the final directory separator stripPath stripPath Answer the file name and extension (if any) of the receiver File: file operations contentscontents Open a read-only FileStream on the receiver, read its contents,close the stream and answer the contents open: open: mode Open the receiver in the given mode (as answered by FileStream'sclass constant methods) open:ifFail: open: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods). Upon failure, evaluate aBlock. openDescriptor: openDescriptor: mode Open the receiver in the given mode (as answered by FileStream'sclass constant methods) openDescriptor:ifFail: openDescriptor: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods). Upon failure, evaluate aBlock. readStream readStream Open a read-only FileStream on the receiver remove remove Remove the file identified by the receiver renameTo: renameTo: newName Rename the file identified by the receiver to newName touch touch Update the timestamp of the file corresponding to the receiver. writeStream writeStream Open a write-only FileStream on the receiver File: testing existsexists Answer whether a file with the name contained in the receiver does exist. isAccessible isAccessible Answer whether a directory with the name contained in the receiver doesexist and can be accessed isDirectory isDirectory Answer whether a file with the name contained in the receiver does existand identifies a directory. isExecutable isExecutable Answer whether a file with the name contained in the receiver does existand is executable isFile isFile Answer whether a file with the name contained in the receiver does existand does not identify a directory. isReadable isReadable Answer whether a file with the name contained in the receiver does existand is readable isSymbolicLink isSymbolicLink Answer whether a file with the name contained in the receiver does existand does not identify a directory. isWriteable isWriteable Answer whether a file with the name contained in the receiver does existand is writeable FileDescriptor FileDescriptor Defined in namespace SmalltalkSuperclass: ByteStreamCategory: Streams-Files My instances are what conventional programmers think of as files.My instance creation methods accept the name of a disk file (or any namedfile object, such as /dev/rmt0 on UNIX or MTA0: on VMS). In addition,they accept a virtual filesystem path like `configure.gz#ugz' which canbe used to transparently extract or decompress files from archives, ordo arbitrary processing on the files. FileDescriptor class: initialization initializeinitialize Initialize the receiver's class variables update: update: aspect Close open files before quitting FileDescriptor class: instance creation appendappend Open for writing. The file is created if it does not exist. The streamis positioned at the end of the file. create create Open for reading and writing. The file is created if it does not exist,otherwise it is truncated. The stream is positioned at the beginning ofthe file. fopen:mode: append create readWrite read write close removeToBeFinalized fopen: fileName mode: fileMode Open fileName in the required mode - answered by #append, #create,#readWrite, #read or #write - and fail if the file cannot be opened.Else answer a new FileStream. For mode anyway you can use anystandard C non-binary fopen mode.The file will be automatically closed upon GC if the object is notreferenced anymore, but it is better to close it as soon as you'refinished with it anyway, using #close. To keep a file open even whenno references exist anymore, send it #removeToBeFinalized fopen:mode:ifFail: append create readWrite read write close removeToBeFinalized fopen: fileName mode: fileMode ifFail: aBlock Open fileName in the required mode - answered by #append, #create,#readWrite, #read or #write - and evaluate aBlock if the file cannotbe opened. Else answer a new FileStream. For mode anyway you can use anyThe file will be automatically closed upon GC if the object is notreferenced anymore, but it is better to close it as soon as you'refinished with it anyway, using #close. To keep a file open even whenno references exist anymore, send it #removeToBeFinalized on: on: fd Open a FileDescriptor on the given file descriptor. Read-write accessis assumed. open: close removeToBeFinalized open: fileName Open fileName in read-write mode - fail if the file cannot be opened.Else answer a new FileStream.The file will be automatically closed upon GC if the object is notreferenced anymore, but you should close it with #close anyway.To keep a file open, send it #removeToBeFinalized open:mode: append create readWrite read write close removeToBeFinalized open: fileName mode: fileMode Open fileName in the required mode - answered by #append, #create,#readWrite, #read or #write - and fail if the file cannot be opened.Else answer a new FileStream. For mode anyway you can use anystandard C non-binary fopen mode. fileName can be a `virtualfilesystem' path, including URLs and '#' suffixes that areinspected by the virtual filesystem layers and replaced withtasks such as un-gzipping a file or extracting a file from anarchive.The file will be automatically closed upon GC if the object is notreferenced anymore, but it is better to close it as soon as you'refinished with it anyway, using #close. To keep a file open even whenno references exist anymore, send it #removeToBeFinalized open:mode:ifFail: append create readWrite read write close removeToBeFinalized open: fileName mode: fileMode ifFail: aBlock Open fileName in the required mode - answered by #append, #create,#readWrite, #read or #write - and evaluate aBlock if the file cannotbe opened. Else answer a new instance of the receiver. For modeanyway you can use any standard C non-binary fopen mode. fileNamecan be a `virtual filesystem' path, including URLs and '#' suffixesthat are inspected by the virtual filesystem layers and replaced withtasks such as un-gzipping a file or extracting a file from anarchive.The file will be automatically closed upon GC if the object is notreferenced anymore, but it is better to close it as soon as you'refinished with it anyway, using #close. To keep a file open even whenno references exist anymore, send it #removeToBeFinalized openTemporaryFile: openTemporaryFile: baseName Open for writing a file whose name starts with baseName, followedby six random alphanumeric characters. The file is created with moderead/write and permissions 0666 or 0600 on most recent operatingsystems (beware, the former behavior might constitute a securityproblem). The file is opened with the O_EXCL flag, guaranteeing thatwhen the method returns successfully we are the only user. popen:dir: addToBeFinalized read write popen: commandName dir: direction Open a pipe on the given command and fail if the file cannot be opened.Else answer a new FileStream.The pipe will not be automatically closed upon GC, even if the objectis not referenced anymore, because when you close a pipe you have to waitfor the associated process to terminate. To enforce automatic closing ofthe pipe, send it #addToBeFinalized.direction is returned by #read or #write ('r' or 'w') and is interpretedfrom the point of view of Smalltalk: reading means Smalltalk reads thestandard output of the command, writing means Smalltalk writes the standard input of the command. The other channel(stdin when reading, stdout when writing) is the same as GST's, unlesscommandName alters it. popen:dir:ifFail: addToBeFinalized popen: commandName dir: direction ifFail: aBlock Open a pipe on the given command and evaluate aBlockfile cannot be opened. Else answer a new FileStream.The pipe will not be automatically closed upon GC, even if the objectis not referenced anymore, because when you close a pipe you have to waitfor the associated process to terminate. To enforce automatic closing ofthe pipe, send it #addToBeFinalized.direction is interpreted from the point of view of Smalltalk: readingmeans that Smalltalk reads the standard output of the command, writingmeans that Smalltalk writes the standard input of the command read read Open text file for reading. The stream is positioned at the beginning ofthe file. readWrite readWrite Open for reading and writing. The stream is positioned at the beginningof the file. write write Truncate file to zero length or create text file for writing. The streamis positioned at the beginning of the file. FileDescriptor: accessing canReadcanRead Answer whether the file is open and we can read from it canWrite canWrite Answer whether the file is open and we can write from it ensureReadable ensureReadable If the file is open, wait until data can be read from it. The waitallows other Processes to run. ensureWriteable ensureWriteable If the file is open, wait until we can write to it. The waitallows other Processes to run. exceptionalCondition exceptionalCondition Answer whether the file is open and an exceptional condition (suchas presence of out of band data) has occurred on it fd fd Return the OS file descriptor of the file isOpen isOpen Answer whether the file is still open isPipe isPipe Answer whether the file is a pipe or an actual disk file name name Return the name of the file waitForException waitForException If the file is open, wait until an exceptional condition (suchas presence of out of band data) has occurred on it. The waitallows other Processes to run. FileDescriptor: basic checkError checkErrorcheckError Perform error checking. By default, we callFile class>>#checkError. close close Close the file contents contents Answer the whole contents of the file copyFrom:to: copyFrom: from to: to Answer the contents of the file between the two given positions finalize finalize Close the file if it is still open by the time the object becomesgarbage. invalidate invalidate Invalidate a file descriptor next next Return the next character in the file, or nil at eof nextByte nextByte Return the next byte in the file, or nil at eof nextPut: nextPut: aCharacter Store aCharacter on the file nextPutByte: nextPutByte: anInteger Store the byte, anInteger, on the file nextPutByteArray: nextPutByteArray: aByteArray Store aByteArray on the file peek peek Returns the next element of the stream without moving the pointer.Returns nil when at end of stream. position position Answer the zero-based position from the start of the file position: position: n Set the file pointer to the zero-based position n reset reset Reset the stream to its beginning size size Return the current size of the file, in bytes truncate truncate Truncate the file at the current position FileDescriptor: built ins fileOp:fileOp: ioFuncIndex Private - Used to limit the number of primitives used by FileStreams fileOp:ifFail: fileOp: ioFuncIndex ifFail: aBlock Private - Used to limit the number of primitives used by FileStreams. fileOp:with: fileOp: ioFuncIndex with: arg1 Private - Used to limit the number of primitives used by FileStreams fileOp:with:ifFail: fileOp: ioFuncIndex with: arg1 ifFail: aBlock Private - Used to limit the number of primitives used by FileStreams. fileOp:with:with: fileOp: ioFuncIndex with: arg1 with: arg2 Private - Used to limit the number of primitives used by FileStreams fileOp:with:with:ifFail: fileOp: ioFuncIndex with: arg1 with: arg2 ifFail: aBlock Private - Used to limit the number of primitives used by FileStreams. fileOp:with:with:with: fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 Private - Used to limit the number of primitives used by FileStreams fileOp:with:with:with:ifFail: fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 ifFail: aBlock Private - Used to limit the number of primitives used by FileStreams. fileOp:with:with:with:with: fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 with: arg4 Private - Used to limit the number of primitives used by FileStreams fileOp:with:with:with:with:ifFail: fileOp: ioFuncIndex with: arg1 with: arg2 with: arg3 with: arg4 ifFail: aBlock Private - Used to limit the number of primitives used by FileStreams. FileDescriptor: class type methods isBinaryisBinary We answer characters, so answer false isExternalStream isExternalStream We stream on an external entity (a file), so answer true isText isText We answer characters, so answer true FileDescriptor: initialize-release initializeinitialize Initialize the receiver's instance variables newBuffer newBuffer Private - Answer a String to be used as the receiver's buffer FileDescriptor: low-level access nextHunknextHunk Answer the next buffers worth of stuff in the Stream representedby the receiver. Do at most one actual input operation. read: read: byteArray Ignoring any buffering, try to fill byteArray with thecontents of the file read:from:to: read: byteArray from: position to: end Ignoring any buffering, try to fill the given range of byteArraywith the contents of the file read:numBytes: read: byteArray numBytes: anInteger Ignoring any buffering, try to fill anInteger bytes of byteArraywith the contents of the file write: write: byteArray Ignoring any buffering, try to write the contents of byteArray in thefile write:from:to: write: byteArray from: position to: end Ignoring any buffering, try to write to the file the given rangeof byteArray, starting at the position-th element and endingat the end-th. write:numBytes: write: byteArray numBytes: anInteger Ignoring any buffering, try to write to the file the first anIntegerbytes of byteArray FileDescriptor: overriding inherited methods isEmptyisEmpty Answer whether the receiver is empty next: next: anInteger Return the next 'anInteger' characters from the stream, as a String. next:putAll:startingAt: next: n putAll: aCollection startingAt: position Put the characters in the supplied range of aCollection in the file nextByteArray: nextByteArray: anInteger Return the next 'anInteger' bytes from the stream, as a ByteArray. nextPutAll: nextPutAll: aCollection Put all the characters in aCollection in the file nextPutAllFlush: nextPutAllFlush: aCollection Put all the characters in aCollection in the file. For compatibilitywith FileStream (FileDescriptor is not buffered, thus this method isequivalent to nextPutAll: reverseContents reverseContents Return the contents of the file from the last byte to the first setToEnd setToEnd Reset the file pointer to the end of the file skip: skip: anInteger Skip anInteger bytes in the file FileDescriptor: printing printOn:printOn: aStream Print a representation of the receiver on aStream FileDescriptor: testing atEndatEnd Answer whether data has come to an end FileSegment FileSegment Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation My instances represent sections of files. I am primarily used by thecompiler to record source code locations. I am not a part of the normalSmalltalk-80 kernel; I am specific to the GNU Smalltalk implementation. FileSegment class: basic on:startingAt:for:on: aFile startingAt: startPos for: sizeInteger Create a new FileSegment referring to the contents of the given file,from the startPos-th byte and for sizeInteger bytes FileSegment class: installing relocateFrom:to:relocateFrom: startPath to: endPath Remove startPath from all paths that start with it, and replace itwith endPath. Needed to support $(DESTDIR) when installing FileSegment: basic asStringasString Answer a String containing the required segment of the file copyFrom:to: copyFrom: from to: to Answer a String containing the given subsegment of the file. As forstreams, from and to are 0-based. fileName fileName Answer the name of the file containing the segment filePos filePos Answer the position in the file where the segment starts relocateFrom:to:map: relocateFrom: startPath to: endPath map: map If the path starts with startPath, remove that part of the pathand replace it with endPath. map is a Dictionary that is usedso that equal filenames stay equal, without increasing the amountof memory that the image uses. size size Answer the length of the segment withFileDo: withFileDo: aBlock Evaluate aBlock passing it the FileStream in which the segmentidentified by the receiver is stored FileSegment: equality == aFileSegment Answer whether the receiver and aFileSegment are equal. hash hash Answer an hash value for the receiver. FileStream FileStream Defined in namespace SmalltalkSuperclass: FileDescriptorCategory: Streams-Files My instances are what conventional programmers think of as files.My instance creation methods accept the name of a disk file (or any namedfile object, such as /dev/rmt0 on UNIX or MTA0: on VMS). FileStream class: file-in fileIn:fileIn: aFileName File in the aFileName file. During a file in operation, global variables(starting with an uppercase letter) that are not declared yet don't yieldan `unknown variable' 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 a namespace (for example by creatinga class) the Association will be removed from Undeclared and reusedin the namespace, so that the old references will automagically pointto the new value. fileIn:ifMissing: fileIn: aFileName ifMissing: aSymbol Conditionally do a file in, only if the key (often a class) specifiedby 'aSymbol' is not present in the Smalltalk system dictionary already.During a file in operation, global variables (starting with anuppercase letter) that are not declared 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 a namespace (for example by creatinga class) the Association will be removed from Undeclared and reusedin the namespace, so that the old references will automagically pointto the new value. fileIn:ifTrue: fileIn: aFileName ifTrue: aBoolean Conditionally do a file in, only if the supplied boolean is true.During a file in operation, global variables (starting with anuppercase letter) that are not declared 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 a namespace (for example by creatinga class) the Association will be removed from Undeclared and reusedin the namespace, so that the old references will automagically pointto the new value. fileIn:line:from:at: fileIn: aFileName line: lineInteger from: realFileName at: aCharPos File in the aFileName file giving errors such as if it was loadedfrom the given line, file name and starting position (instead of 1). generateMakefileOnto: generateMakefileOnto: aStream Generate a make file for the file-ins since record was last set to true.Store it on aStream initialize initialize Private - Initialize the receiver's class variables record: generateMakefileOnto: record: recordFlag Set whether Smalltalk should record information about nested file-ins.When recording is enabled, use #generateMakefileOnto: to automaticallygenerate a valid makefile for the intervening file-ins. require: require: assoc Conditionally do a file in from the value of assoc, only if thekey of assoc is not present in the Smalltalk system dictionary already.During a file in operation, global variables (starting with anuppercase letter) that are not declared 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 a namespace (for example by creatinga class) the Association will be removed from Undeclared and reusedin the namespace, so that the old references will automagically pointto the new value. verbose: verbose: verboseFlag Set whether Smalltalk should output debugging messages when filing in FileStream class: standard streams stderrstderr Answer a FileStream that is attached the Smalltalk program's standarderror file handle, which can be used for error messages and diagnosticsissued by the program. stdin stdin Answer a FileStream that is attached the Smalltalk program's standardinput file handle, which is the normal source of input for the program. stdout stdout Answer a FileStream that is attached the Smalltalk program's standardoutput file handle; this is used for normal output from the program. FileStream: basic bufferStartbufferStart Private - Answer the offset from the start of the file correspondingto the beginning of the read buffer. copyFrom:to: copyFrom: from to: to Answer the contents of the file between the two given positions next next Return the next character in the file, or nil at eof nextByte nextByte Return the next byte in the file, or nil at eof nextPut: nextPut: aCharacter Store aCharacter on the file peek peek Return the next character in the file, or nil at eof.Don't advance the file pointer. position position Answer the zero-based position from the start of the file position: position: n Set the file pointer to the zero-based position n size size Return the current size of the file, in bytes truncate truncate Truncate the file at the current position FileStream: buffering bufferSizebufferSize Answer the file's current buffer bufferSize: bufferSize: bufSize Flush the file and set the buffer's size to bufSize clean clean Synchronize the file descriptor's state with the object's state. fill fill Private - Fill the input buffer flush flush Flush the output buffer. newBuffer newBuffer Private - Answer a String to be used as the receiver's buffer next:bufferAll:startingAt: next: n bufferAll: aCollection startingAt: pos Private - Assuming that the buffer has space for n characters, storen characters of aCollection in the buffer, starting from the pos-th. next:into: next: anInteger into: answer Private - Read up to anInteger bytes from the stream and store theminto answer. Return `answer' itself, possibly truncated if we could notread the full amount of data. nextHunk nextHunk Answer the next buffers worth of stuff in the Stream representedby the receiver. For n consecutive calls to this method, we don - 1 or n actual input operation. pendingWrite pendingWrite Answer whether the output buffer is full. FileStream: overriding inherited methods next:next: anInteger Return the next 'anInteger' characters from the stream, as a String. next:putAll:startingAt: next: n putAll: aCollection startingAt: pos Not commented. nextByteArray: nextByteArray: anInteger Return the next 'anInteger' bytes from the stream, as a ByteArray. nextLine nextLine Returns a collection of the same type that the stream accesses, containingthe next line up to the next new-line character. Returns the entire rest of thestream's contents if no new-line character is found. nextPutAll: nextPutAll: aCollection Put all the characters in aCollection in the file nextPutAllFlush: nextPutAllFlush: aCollection Put all the characters in aCollection in the file, then flush thefile buffers FileStream: testing atEndatEnd Answer whether data has come to an end Float Float Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types My instances represent floating point numbers that have arbitraryprecision. Besides the standard numerical operations, they providetranscendental operations too. They implement IEEE-754 correctlyif the hardware supports it. Float class: byte-order dependancies signBytesignByte Answer the byte of the receiver that contains the sign bit Float class: characterization denormalizeddenormalized Answer whether instances of the receiver can be in denormalizedform. e e Returns the value of e. Hope is that it is precise enough epsilon epsilon Return the smallest Float x for which is 1 + x ~= 1 fmin fmin Return the smallest Float that is > 0. fminDenormalized fminDenormalized Return the smallest Float that is > 0 if denormalized valuesare supported, else return 0. ln10 ln10 Returns the value of ln 10. Hope is that it is precise enough log10Base2 log10Base2 Returns the value of log2 10. Hope is that it is precise enough pi pi Returns the value of pi. Hope is that it is precise enough radix radix Answer the base in which computations between instances of the receiverare made. This should be 2 on about every known computer, so GNUSmalltalk always answers 2. Float: arithmetic integerPartintegerPart Return the receiver's integer part negated negated Return the negation of the receiver. Unlike 0-self, this convertscorrectly signed zeros. raisedToInteger: raisedToInteger: anInteger Return self raised to the anInteger-th power Float: basic hashhash Answer an hash value for the receiver Float: built ins arcCosarcCos Answer the arc-cosine of the receiver arcSin arcSin Answer the arc-sine of the receiver arcTan arcTan Answer the arc-tangent of the receiver ceiling ceiling Answer the integer part of the receiver, truncated towards +infinity cos cos Answer the cosine of the receiver exp exp Answer 'e' (2.718281828459...) raised to the receiver floor floor Answer the integer part of the receiver, truncated towards -infinity ln ln Answer the logarithm of the receiver in base 'e' (2.718281828459...) primHash primHash Private - Answer an hash value for the receiver raisedTo: raisedTo: aNumber Answer the receiver raised to its aNumber power sin sin Answer the sine of the receiver sqrt sqrt Answer the square root of the receiver tan tan Answer the tangent of the receiver Float: coercing asExactFractionasExactFraction Convert the receiver into a fraction with optimal approximation,but with usually huge terms. asFraction asFraction Convert the receiver into a fraction with a good (but undefined)approximation truncated truncated Convert the receiver to an Integer. Only used for LargeIntegers,there are primitives for the other cases. Float: comparing max:max: aNumber Answer the maximum between the receiver and aNumber. Redefinein subclasses if necessary to ensure that if either self oraNumber is a NaN, it is always answered. min: min: aNumber Answer the minimum between the receiver and aNumber. Redefinein subclasses if necessary to ensure that if either self oraNumber is a NaN, it is always answered. withSignOf: withSignOf: aNumber Answer the receiver, with its sign possibly changed to matchthat of aNumber. Float: printing printOn:printOn: aStream Print a representation of the receiver on aStream Float: storing storeOn:storeOn: aStream Print a representation of the receiver on aStream Float: testing isFiniteisFinite Answer whether the receiver does not represent infinity, nor a NaN isInfinite isInfinite Answer whether the receiver represents positive or negative infinity isNaN isNaN Answer whether the receiver represents a NaN negative negative Answer whether the receiver is negative positive positive Answer whether the receiver is positive. Negative zero isnot positive, so the definition is not simply >= 0. sign sign Answer 1 if the receiver is greater than 0, -1 if less than 0,else 0. Negative zero is the same as positive zero. strictlyPositive strictlyPositive Answer whether the receiver is > 0 Float: testing functionality isFloatisFloat Answer `true'. Float: transcendental operations asFloatasFloat Just defined for completeness. Return the receiver. estimatedLog estimatedLog Answer an estimate of (self abs floorLog: 10) log log Not commented. FloatD FloatD Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types My instances represent floating point numbers that have the sameaccuracy as C's "double" numbers. FloatD class: byte-order dependancies signBytesignByte Answer the byte of the receiver that contains the sign bit FloatD class: characterization decimalDigitsdecimalDigits Return the number of decimal digits of precision for a FloatD.Technically, if P is the precision for the representation, thenthe decimal precision Q is the maximum number of decimal digitssuch that any floating point number with Q base 10 digits can berounded to a floating point number with P base 2 digits and backagain, without change to the Q decimal digits. emax emax Return the maximum allowable exponent for a FloatD that is finite. emin emin Return the maximum allowable exponent for a FloatD that is finite. fmax fmax Return the largest normalized FloatD that is not infinite. fminNormalized fminNormalized Return the smallest normalized FloatD that is > 0 infinity infinity Return a FloatD that represents positive infinity. nan nan Return a FloatD that represents a mathematically indeterminate value(e.g. Inf - Inf, Inf / Inf). negativeInfinity negativeInfinity Return a FloatD that represents negative infinity. precision precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1 FloatD class: converting coerce:coerce: aNumber Answer aNumber converted to a FloatD 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 < < 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 asFloatE Answer the receiver converted to a FloatE asFloatQ asFloatQ Answer the receiver converted to a FloatQ exponent exponent Answer the exponent of the receiver in mantissa*2^exponentrepresentation ( |mantissa|<=1 ) fractionPart fractionPart Answer the fractional part of the receiver timesTwoPower: timesTwoPower: arg Answer the receiver multiplied by 2^arg truncated truncated Truncate the receiver towards zero and answer the result ~= ~= arg Answer whether the receiver is not equal to arg FloatD: coercing asFloatDasFloatD Just defined for completeness. Return the receiver. coerce: coerce: aNumber Coerce aNumber to the receiver's class generality generality Answer the receiver's generality unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class FloatE FloatE Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types My instances represent floating point numbers that have the sameaccuracy as C's "float" numbers. FloatE class: byte-order dependancies signBytesignByte Answer the byte of the receiver that contains the sign bit FloatE class: characterization decimalDigitsdecimalDigits Return the number of decimal digits of precision for a FloatE.Technically, if P is the precision for the representation, thenthe decimal precision Q is the maximum number of decimal digitssuch that any floating point number with Q base 10 digits can berounded to a floating point number with P base 2 digits and backagain, without change to the Q decimal digits. e e Returns the value of e. Hope is that it is precise enough emax emax Return the maximum allowable exponent for a FloatE that is finite. emin emin Return the maximum allowable exponent for a FloatE that is finite. fmax fmax Return the largest normalized FloatE that is not infinite. fminNormalized fminNormalized Return the smallest normalized FloatE that is > 0 infinity infinity Return a FloatE that represents positive infinity. ln10 ln10 Returns the value of ln 10. Hope is that it is precise enough log10Base2 log10Base2 Returns the value of log2 10. Hope is that it is precise enough nan nan Return a FloatE that represents a mathematically indeterminate value(e.g. Inf - Inf, Inf / Inf). negativeInfinity negativeInfinity Return a FloatE that represents negative infinity. pi pi Returns the value of pi. Hope is that it is precise enough precision precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1 FloatE class: converting coerce:coerce: aNumber Answer aNumber converted to a FloatE 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 <= <= 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 asFloatD Answer the receiver converted to a FloatD asFloatQ asFloatQ Answer the receiver converted to a FloatQ exponent exponent Answer the exponent of the receiver in mantissa*2^exponentrepresentation ( |mantissa|<=1 ) fractionPart fractionPart Answer the fractional part of the receiver timesTwoPower: timesTwoPower: arg Answer the receiver multiplied by 2^arg truncated truncated Truncate the receiver towards zero and answer the result ~= ~= arg Answer whether the receiver is not equal to arg FloatE: coercing asFloatEasFloatE Just defined for completeness. Return the receiver. coerce: coerce: aNumber Coerce aNumber to the receiver's class generality generality Answer the receiver's generality unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class FloatQ FloatQ Defined in namespace SmalltalkSuperclass: FloatCategory: Language-Data types My instances represent floating point numbers that have the sameaccuracy as C's "long double" numbers. FloatQ class: byte-order dependancies signBytesignByte Answer the byte of the receiver that contains the sign bit FloatQ class: characterization decimalDigitsdecimalDigits Return the number of decimal digits of precision for a FloatQ.Technically, if P is the precision for the representation, thenthe decimal precision Q is the maximum number of decimal digitssuch that any floating point number with Q base 10 digits can berounded to a floating point number with P base 2 digits and backagain, without change to the Q decimal digits. e e Returns the value of e. Hope is that it is precise enough emax emax Return the maximum allowable exponent for a FloatQ that is finite. emin emin Return the maximum allowable exponent for a FloatQ that is finite. fmax fmax Return the largest normalized FloatQ that is not infinite. fminNormalized fminNormalized Return the smallest normalized FloatQ that is > 0 infinity infinity Return a FloatQ that represents positive infinity. ln10 ln10 Returns the value of ln 10. Hope is that it is precise enough log10Base2 log10Base2 Returns the value of log2 10. Hope is that it is precise enough nan nan Return a FloatQ that represents a mathematically indeterminate value(e.g. Inf - Inf, Inf / Inf). negativeInfinity negativeInfinity Return a FloatQ that represents negative infinity. pi pi Returns the value of pi. Hope is that it is precise enough precision precision Answer the number of bits in the mantissa. 1 + (2^-precision) = 1 FloatQ class: converting coerce:coerce: aNumber Answer aNumber converted to a FloatQ 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 >= >= arg Answer whether the receiver is greater than or equal to arg asFloatD asFloatD Answer the receiver converted to a FloatD asFloatE asFloatE Answer the receiver converted to a FloatE exponent exponent Answer the exponent of the receiver in mantissa*2^exponentrepresentation ( |mantissa|<=1 ) fractionPart fractionPart Answer the fractional part of the receiver timesTwoPower: timesTwoPower: arg Answer the receiver multiplied by 2^arg truncated truncated Truncate the receiver towards zero and answer the result ~= ~= arg Answer whether the receiver is not equal to arg FloatQ: coercing asFloatQasFloatQ Just defined for completeness. Return the receiver. coerce: coerce: aNumber Coerce aNumber to the receiver's class generality generality Answer the receiver's generality unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class Fraction Fraction Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types I represent rational numbers in the form (p/q) where p and q are integers.The arithmetic operations *, +, -, /, on fractions, all return a reducedfraction. Fraction class: converting coerce:coerce: aNumber Answer aNumber converted to a Fraction Fraction class: instance creation initializeinitialize Initialize the receiver's class variables numerator:denominator: numerator: nInteger denominator: dInteger Answer a new instance of fraction (nInteger/dInteger) Fraction: accessing denominatordenominator Answer the receiver's denominator numerator numerator Answer the receiver's numerator Fraction: arithmetic ** aNumber Multiply two numbers and answer the result. + + aNumber Sum two numbers and answer the result. - - aNumber Subtract aNumber from the receiver and answer the result. / / aNumber Divide the receiver by aNumber and answer the result. // // aNumber Return the integer quotient of dividing the receiver by aNumber withtruncation towards negative infinity. \\ \\ aNumber Return the remainder from dividing the receiver by aNumber, (using //). estimatedLog estimatedLog Answer an estimate of (self abs floorLog: 10) Fraction: coercing ceilingceiling Truncate the receiver towards positive infinityand return the truncated result coerce: coerce: aNumber Coerce aNumber to the receiver's class floor floor Truncate the receiver towards negative infinityand return the truncated result generality generality Return the receiver's generality truncated truncated Truncate the receiver and return the truncated result unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class 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 hash Answer an hash value for the receiver Fraction: converting asFloatDasFloatD Answer the receiver converted to a FloatD asFloatE asFloatE Answer the receiver converted to a FloatD asFloatQ asFloatQ Answer the receiver converted to a FloatD asFraction asFraction Answer the receiver, it is already a Fraction integerPart integerPart Answer the integer part of the receiver, expressed as a Fraction Fraction: optimized cases negatednegated Return the receiver, with its sign changed. raisedToInteger: raisedToInteger: anInteger Return self raised to the anInteger-th power. reciprocal reciprocal Return the reciprocal of the receiver squared squared Return the square of the receiver. Fraction: printing printOn:printOn: aStream Print a representation of the receiver on aStream storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Fraction: testing isRationalisRational Answer whether the receiver is rational - true Getopt Getopt Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types This class is usually not instantiated. Class methods provide a wayto parse command lines from Smalltalk. Getopt class: instance creation parse:with:do: parse:with:do:ifError:parse: args with: pattern do: actionBlock Parse the command-line arguments in args according to the syntax specified inpattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. Forfile names (or in general, other command-line arguments than options) theblock's first argument will be nil. For options without arguments, or withunspecified optional arguments, the block's second argument will be nil.The option name will be passed 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 syntaxof pattern, see #parse:with:do:ifError:. parse:with:do:ifError: parse: args with: pattern do: actionBlock ifError: errorBlock Parse the command-line arguments in args according to the syntax specified inpattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. Forfile names (or in general, other command-line arguments than options) theblock's first argument will be nil. For options without arguments, or withunspecified optional arguments, the block's second argument will be nil.The option name will be passed 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 the returned 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' orlong names like `–long') can be specified. Before passing the option toactionBlock, 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 longeroption.Mandatory arguments can appear in the next argument, or in the same argument(separated by an = for arguments to long options). Optional arguments mustappear in the same argument. Halt Halt Defined in namespace SmalltalkSuperclass: ErrorCategory: Language-Exceptions Halt represents a resumable error, usually a bug. Halt: description descriptiondescription Answer a textual description of the exception. isResumable halt isResumable Answer true. #halt exceptions are by default resumable. HashedCollection HashedCollection Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Unordered I am an hashed collection that can store objects uniquely andgive fast responses on their presence in the collection. HashedCollection class: instance creation newnew Answer a new instance of the receiver with a default size new: new: anInteger Answer a new instance of the receiver with the given capacity primNew: primNew: realSize Not commented. withAll: withAll: aCollection Answer a collection whose elements are all those in aCollection HashedCollection: accessing add:add: newObject Add newObject to the set, if and only if the set doesn't already containan occurrence of it. Don't fail if a duplicate is found. Answer anObject at: at: index This method should not be called for instances of this class. at:put: at: index put: value This method should not be called for instances of this class. HashedCollection: builtins primAt:primAt: anIndex Private - Answer the anIndex-th item of the hash table for the receiver.Using this instead of basicAt: allows for easier changes in therepresentation primAt:put: primAt: anIndex put: value Private - Store value in the anIndex-th item of the hash table for thereceiver. Using this instead of basicAt:put: allows for easierchanges in the representation primSize primSize Private - Answer the size of the hash table for the receiver.Using this instead of basicSize allows for easier changesin the representation HashedCollection: copying deepCopydeepCopy Returns a deep copy of the receiver (the instance variables arecopies of the receiver's instance variables) shallowCopy shallowCopy Returns a shallow copy of the receiver (the instance variables arenot copied) HashedCollection: enumerating the elements of a collection do:do: aBlock Enumerate all the non-nil members of the set HashedCollection: rehashing rehashrehash Rehash the receiver HashedCollection: removing remove:ifAbsent:remove: oldObject ifAbsent: anExceptionBlock Remove oldObject to the set. If it is found, answer oldObject.Otherwise, evaluate anExceptionBlock and return its value. HashedCollection: saving and loading postLoadpostLoad Called after loading an object; rehash the collection because identityobjects will most likely mutate their hashes. postStore postLoad postStore Called after an object is dumped. Do nothing – necessary becauseby default this calls #postLoad by default HashedCollection: storing storeOn:storeOn: aStream Store on aStream some Smalltalk code which compiles to the receiver HashedCollection: testing collections == aHashedCollection Returns true if the two sets have the same membership, false if not capacity capacity Answer how many elements the receiver can hold before having to grow. hash hash Return the hash code for the members of the set. Since order isunimportant, we use a commutative operator to compute the hash value. includes: includes: anObject Answer whether the receiver contains an instance of anObject. isEmpty isEmpty Answer whether the receiver is empty. occurrencesOf: occurrencesOf: anObject Return the number of occurrences of anObject. Since we're a set, thisis either 0 or 1. Nil is never directly in the set, so we special caseit (the result is always 1). size size Answer the receiver's size HomedAssociation HomedAssociation Defined in namespace SmalltalkSuperclass: AssociationCategory: Language-Data types My instances represent know about their parent namespace, whichis of use when implementing weak collections and finalizations. HomedAssociation class: basic key:value:environment:key: aKey value: aValue environment: aNamespace Answer a new association with the given key and value HomedAssociation: accessing environmentenvironment Answer the namespace in which I live. environment: environment: aNamespace Set the namespace in which I live to be aNamespace. HomedAssociation: finalization mournmourn This message is sent to the receiver when the object is made ephemeron(which is common when HomedAssociations are used by a WeakKeyDictionaryor a WeakSet). The mourning of the object's key is first of all demandedto the environment (which will likely remove the object from itself), andthen performed as usual by clearing the key and value fields. HomedAssociation: storing storeOn:storeOn: aStream Put on aStream some Smalltalk code compiling to the receiver IdentityDictionary IdentityDictionary Defined in namespace SmalltalkSuperclass: LookupTableCategory: Collections-Keyed I am similar to LookupTable, except that I use the object identitycomparision message == to determine equivalence of indices. IdentitySet IdentitySet Defined in namespace SmalltalkSuperclass: SetCategory: Collections-Unordered I am the typical set object; I can store any objects uniquely. Iuse the == operator to determine duplication of objects. IdentitySet: testing identityIncludes: includes:identityIncludes: anObject Answer whether we include the anObject object; for IdentitySetsthis is identical to #includes: Integer Integer Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types I am the abstract integer class of the GNU Smalltalk system. Mysubclasses' instances can represent signed integers of varioussizes (a subclass is picked according to the size), with varyingefficiency. Integer class: converting coerce:coerce: aNumber Answer aNumber converted to a kind of Integer readFrom:radix: readFrom: aStream radix: radix Read a possibly negative number in the given radix from aStream,and answer its value. Integer: accessing denominatordenominator Answer `1'. numerator numerator Answer the receiver. Integer: basic hashhash Answer an hash value for the receiver Integer: bit operators allMask:allMask: anInteger True if all 1 bits in anInteger are 1 in the receiver anyMask: anyMask: anInteger True if any 1 bits in anInteger are 1 in the receiver bitAt: bitAt: index Answer the index-th bit of the receiver (the LSB has an indexof 1) bitAt:put: bitAt: index put: value Answer an integer which is identical to the receiver,possibly with the exception of the index-th bit of thereceiver (the LSB having an index of 1), which assumesa value equal to the low-order bit of the second parameter. bitClear: bitClear: aMask Answer an Integer equal to the receiver, except that all the bitsthat are set in aMask are cleared. bitInvert bitInvert Return the 1's complement of the bits of the receiver clearBit: clearBit: index Clear the index-th bit of the receiver and answer a new Integer highBit highBit Return the index of the highest order 1 bit of the receiver. isBitSet: isBitSet: index Answer whether the index-th bit of the receiver is set lowBit lowBit Return the index of the lowest order 1 bit of the receiver. noMask: noMask: anInteger Answer true if no 1 bits in anInteger are 1 in the receiver. setBit: setBit: index Set the index-th bit of the receiver and answer a new Integer Integer: converting asCharacterasCharacter Return self as a Character or UnicodeCharacter object. asFraction asFraction Return the receiver converted to a fraction asScaledDecimal: asScaledDecimal: n Answer the receiver, converted to a ScaledDecimal object.The scale is forced to be 0. ceiling ceiling Return the receiver - it's already truncated coerce: coerce: aNumber Coerce aNumber to the receiver's class. floor floor Return the receiver - it's already truncated rounded rounded Return the receiver - it's already truncated truncated truncated Return the receiver - it's already truncated Integer: extension alignTo:alignTo: anInteger Answer the receiver, truncated to the first higher or equalmultiple of anInteger (which must be a power of two) Integer: iterators timesRepeat:timesRepeat: aBlock Evaluate aBlock a number of times equal to the receiver's value.Compiled in-line for no argument aBlocks without temporaries, andtherefore not overridable. Integer: math methods binomial:binomial: anInteger Compute the number of combinations of anInteger objects amonga number of objects given by the receiver. ceilingLog: ceilingLog: radix Answer (self log: radix) ceiling. Optimized to answer an integer. estimatedLog estimatedLog Answer an estimate of (self abs floorLog: 10) even even Return whether the receiver is even factorial factorial Return the receiver's factorial. floorLog: floorLog: radix Answer (self log: radix) floor. Optimized to answer an integer. gcd: gcd: anInteger Return the greatest common divisor (Euclid's algorithm) between thereceiver and anInteger lcm: lcm: anInteger Return the least common multiple between the receiver and anInteger odd odd Return whether the receiver is odd Integer: printing displayOn:displayOn: aStream Print on aStream the base 10 representation of the receiver displayString displayString Return the base 10 representation of the receiver printOn: printOn: aStream Print on aStream the base 10 representation of the receiver printOn:base: printOn: aStream base: b Print on aStream the base b representation of the receiver printString printString Return the base 10 representation of the receiver printString: printString: baseInteger Return the base b representation of the receiver printStringRadix: printStringRadix: baseInteger Return the base b representation of the receiver, with BBr infront of it radix: printStringRadix:instead radix: baseInteger Return the base b representation of the receiver, with BBr infront of it. This method is deprecated, use #printStringRadix:instead. storeOn:base: storeOn: aStream base: b Print on aStream Smalltalk code compiling to the receiver,represented in base b Integer: storing storeOn:storeOn: aStream Print on aStream the base 10 representation of the receiver storeString storeString Return the base 10 representation of the receiver Integer: testing functionality isIntegerisInteger Answer `true'. isRational isRational Answer whether the receiver is rational - true Interval Interval Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable My instances represent ranges of objects, typically Number typeobjects. I provide iteration/enumeration messages for producing all themembers that my instance represents. Interval class: instance creation from:to:from: startInteger to: stopInteger Answer an Interval going from startInteger to thestopInteger, with a step of 1 from:to:by: from: startInteger to: stopInteger by: stepInteger Answer an Interval going from startInteger to thestopInteger, with a step of stepInteger withAll: withAll: aCollection Answer an Interval containing the same elements as aCollection.Fail if it is not possible to create one. Interval: basic at:at: index Answer the index-th element of the receiver. at:put: at: index put: anObject This method should not be called for instances of this class. collect: collect: aBlock Evaluate the receiver for each element in aBlock,collect in an array the result of the evaluations. do: "Note to Not commented. reverse reverse Answer a copy of the receiver with all of its items reversed size size Answer the number of elements in the receiver. species species Answer `Array'. Interval: printing firstfirst Answer `start'. increment increment Answer `step'. last last Not commented. printOn: printOn: aStream Print a representation for the receiver on aStream Interval: storing storeOn:storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Interval: testing == anInterval Answer whether anInterval is the same interval as the receiver hash hash Answer an hash value for the receiver LargeArray LargeArray Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable I am similar to a plain array, but I'm specially designed to savememory when lots of items are nil. LargeArray: overridden newCollection:newCollection: size Create an Array of the given size LargeArrayedCollection LargeArrayedCollection Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable I am an abstract class specially designed to savememory when lots of items have the same value. LargeArrayedCollection class: instance creation new:new: anInteger Answer a new instance of the receiver, with room for anInteger elements. LargeArrayedCollection: accessing at:at: anIndex Answer the anIndex-th item of the receiver. at:put: at: anIndex put: anObject Replace the anIndex-th item of the receiver with anObject. compress compress Arrange the representation of the array for maximum memory saving. LargeArrayedCollection: basic == aLargeArray Answer whether the receiver and aLargeArray have the same contents hash hash Answer an hash value for the receiver size size Answer the maximum valid index for the receiver LargeArraySubpart LargeArraySubpart Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Collections-Sequenceable This class is an auxiliary class used to store informationabout a LargeArrayedCollection's contents. LargeArrayedCollectionsstore their items non-contiguously in a separate storage object, anduse a SortedCollection to map between indices in the array and indicesin the storage object; instances of this class represent a block ofindices that is stored contiguously in the storage object. LargeArraySubpart class: instance creation first:last:index: first last firstIndexfirst: first last: last index: index Answer a LargeArraySubpart which answers first, last, and indexwhen it is sent (respectively) #first, #last and #firstIndex. LargeArraySubpart: accessing firstfirst Answer the index of the first item of the LargeArrayedCollectionthat the receiver refers to. first:last:index: first last firstIndex first: firstIndex last: lastIndex index: storagePosition Set up the receiver so that it answers first, last, and indexwhen it is sent (respectively) #first, #last and #firstIndex. firstIndex firstIndex Answer the index in the collection's storage object of the firstitem of the LargeArrayedCollection that the receiver refers to. last last Answer the index of the last item of the LargeArrayedCollectionthat the receiver refers to. lastIndex lastIndex Answer the index in the collection's storage object of the lastitem of the LargeArrayedCollection that the receiver refers to. LargeArraySubpart: comparing << anObject Answer whether the receiver points to a part of the array thatis before anObject (this makes sense only if the receiver andanObject are two LargeArraySubparts referring to the sameLargeArrayedCollection). <= <= anObject Answer whether the receiver points to a part of the array thatis before anObject or starts at the same point (this makes senseonly if the receiver and anObject are two LargeArraySubpartsreferring to the same LargeArrayedCollection). = = anObject Answer whether the receiver and anObject are equal (assuming thatthe receiver and anObject are two LargeArraySubpartsreferring to the same LargeArrayedCollection, which the receivercannot check for). hash hash Answer an hash value for the receiver LargeArraySubpart: modifying cutAt: removeFirst:cutAt: position Answer a new LargeArraySubpart whose lastIndex is position - 1,and apply a #removeFirst: to the receiver so that the firstIndexbecomes position grow grow Add one to last and lastIndex growBy: growBy: numberOfElements Add numberOfElements to last and lastIndex relocateTo: relocateTo: position Move the firstIndex to position, and the lastIndex accordingly. removeFirst: removeFirst: n Sum n to first and firstIndex, but leave last/lastIndex untouched removeLast: removeLast: n Subtract n from last and lastIndex, but leave first/firstIndex untouched LargeByteArray LargeByteArray Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable I am similar to a plain ByteArray, but I'm specially designed to savememory when lots of items are zero. LargeByteArray: overridden costOfNewIndexcostOfNewIndex Answer the maximum number of consecutive items set to the defaultElementthat can be present in a compressed array. defaultElement defaultElement Answer the value which is hoped to be the most common in the array newCollection: newCollection: size Create a ByteArray of the given size LargeInteger LargeInteger Defined in namespace SmalltalkSuperclass: IntegerCategory: Language-Data types I represent a large integer, which has to be stored as a long sequenceof bytes. I have methods to do arithmetics and comparisons, but I needsome help from my children, LargePositiveInteger and LargeNegativeInteger,to speed them up a bit. LargeInteger: accessing raisedToInteger:raisedToInteger: n Return self raised to the anInteger-th power LargeInteger: arithmetic ** aNumber Multiply aNumber and the receiver, answer the result + + aNumber Sum the receiver and aNumber, answer the result - - aNumber Subtract aNumber from the receiver, answer the result / / aNumber Divide aNumber and the receiver, answer the result (an Integer orFraction) // // aNumber Divide aNumber and the receiver, answer the result truncated towards-infinity \\ \\ aNumber Divide aNumber and the receiver, answer the remainder truncatedtowards -infinity estimatedLog estimatedLog Answer an estimate of (self abs floorLog: 10) negated negated Answer the receiver's negated quo: quo: aNumber Divide aNumber and the receiver, answer the result truncatedtowards 0 rem: rem: aNumber Divide aNumber and the receiver, answer the remainder truncatedtowards 0 LargeInteger: bit operations bitAnd:bitAnd: aNumber Answer the receiver ANDed with aNumber bitAt: bitAt: aNumber Answer the aNumber-th bit in the receiver, where the LSB is 1 bitInvert bitInvert Answer the receiver's 1's complement bitOr: bitOr: aNumber Answer the receiver ORed with aNumber bitShift: bitShift: aNumber Answer the receiver shifted by aNumber places bitXor: bitXor: aNumber Answer the receiver XORed with aNumber lowBit lowBit Return the index of the lowest order 1 bit of the receiver. LargeInteger: built-ins at:at: anIndex Answer the anIndex-th byte in the receiver's representation at:put: at: anIndex put: aNumber Set the anIndex-th byte in the receiver's representation digitAt: digitAt: anIndex Answer the anIndex-th base-256 digit in the receiver's representation digitAt:put: digitAt: anIndex put: aNumber Set the anIndex-th base-256 digit in the receiver's representation digitLength digitLength Answer the number of base-256 digits in the receiver hash hash Answer an hash value for the receiver primReplaceFrom:to:with:startingAt: primReplaceFrom: start to: stop with: replacementString startingAt: replaceStartPrivate - Replace the characters from start to stop with newcharacters contained in replacementString (which, actually, can beany variable byte class), starting at the replaceStart location ofreplacementString size size Answer the number of indexed instance variable in the receiver LargeInteger: coercion coerce:coerce: aNumber Truncate the number; if needed, convert it to LargeIntegerrepresentation. generality generality Answer the receiver's generality unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class LargeInteger: disabled asObjectasObject This method always fails. The number of OOPs is far less thanthe minimum number represented with a LargeInteger. asObjectNoFail asObjectNoFail Answer `nil'. LargeInteger: primitive operations basicLeftShift:basicLeftShift: totalShift Private - Left shift the receiver by aNumber places basicRightShift: basicRightShift: totalShift Private - Right shift the receiver by 'shift' places largeNegated largeNegated Private - Same as negated, but always answer a LargeInteger LargeInteger: testing << aNumber Answer whether the receiver is smaller than aNumber <= <= aNumber Answer whether the receiver is smaller than aNumber or equal to it = = aNumber Answer whether the receiver and aNumber identify the same number. > > aNumber Answer whether the receiver is greater than aNumber >= >= aNumber Answer whether the receiver is greater than aNumber or equal to it ~= ~= aNumber Answer whether the receiver and aNumber identify different numbers. LargeNegativeInteger LargeNegativeInteger Defined in namespace SmalltalkSuperclass: LargeIntegerCategory: Language-Data types Just like my brother LargePositiveInteger, I provide a few methods thatallow LargeInteger to determine the sign of a large integer in a fast wayduring its calculations. For example, I know that I am smaller than anyLargePositiveInteger LargeNegativeInteger: converting asFloatDasFloatD Answer the receiver converted to a FloatD asFloatE asFloatE Answer the receiver converted to a FloatE asFloatQ asFloatQ Answer the receiver converted to a FloatQ LargeNegativeInteger: numeric testing absabs Answer the receiver's absolute value. negative negative Answer whether the receiver is < 0 positive positive Answer whether the receiver is >= 0 sign sign Answer the receiver's sign strictlyPositive strictlyPositive Answer whether the receiver is > 0 LargeNegativeInteger: reverting to LargePositiveInteger ++ aNumber Sum the receiver and aNumber, answer the result - - aNumber Subtract aNumber from the receiver, answer the result gcd: gcd: anInteger Return the greatest common divisor between the receiver and anInteger highBit highBit Answer the receiver's highest bit's index LargePositiveInteger LargePositiveInteger Defined in namespace SmalltalkSuperclass: LargeIntegerCategory: Language-Data types Just like my brother LargeNegativeInteger, I provide a few methods thatallow LargeInteger to determine the sign of a large integer in a fast wayduring its calculations. For example, I know that I am larger than anyLargeNegativeInteger. In addition I implement the guts of arbitraryprecision arithmetic. LargePositiveInteger: arithmetic ++ aNumber Sum the receiver and aNumber, answer the result - - aNumber Subtract aNumber from the receiver, answer the result gcd: gcd: anInteger Calculate the GCD between the receiver and anInteger highBit highBit Answer the receiver's highest bit's index LargePositiveInteger: converting asFloatDasFloatD Answer the receiver converted to a FloatD asFloatE asFloatE Answer the receiver converted to a FloatE asFloatQ asFloatQ Answer the receiver converted to a FloatQ replace:withStringBase: replace: str withStringBase: radix Return in a String str the base radix representation of thereceiver. LargePositiveInteger: helper byte-level methods bytes:from:compare:bytes: byteArray1 from: j compare: byteArray2 Private - Answer the sign of byteArray2 - byteArray1; thej-th byte of byteArray1 is compared with the first of byteArray2,the j+1-th with the second, and so on. bytes:from:subtract: bytes: byteArray1 from: j subtract: byteArray2 Private - Sutract the bytes in byteArray2 from those in byteArray1 bytes:multiply: bytes: bytes multiply: anInteger Private - Multiply the bytes in bytes by anInteger, which must be < 255.Put the result back in bytes. bytesLeftShift: bytesLeftShift: aByteArray Private - Left shift by 1 place the bytes in aByteArray bytesLeftShift:big: bytesLeftShift: aByteArray big: totalShift Private - Left shift the bytes in aByteArray by totalShift places bytesLeftShift:n: bytesLeftShift: aByteArray n: shift Private - Left shift by shift places the bytes in aByteArray(shift <= 7) bytesRightShift:big: bytesRightShift: aByteArray big: totalShift Private - Right shift the bytes in aByteArray by totalShift places bytesRightShift:n: bytesRightShift: bytes n: aNumber Private - Right shift the bytes in `bytes' by 'aNumber' places(shift <= 7) bytesTrailingZeros: bytesTrailingZeros: bytes Private - Answer the number of trailing zero bits in the receiver primDivide: primDivide: rhs Private - Implements Knuth's divide and correct algorithm from`Seminumerical Algorithms' 3rd Edition, section 4.3.1 (whichis basically an enhanced version of the divide `algorithm' fortwo-digit divisors which is taught in primary school!!!) LargePositiveInteger: numeric testing absabs Answer the receiver's absolute value negative negative Answer whether the receiver is < 0 positive positive Answer whether the receiver is >= 0 sign sign Answer the receiver's sign strictlyPositive strictlyPositive Answer whether the receiver is > 0 LargePositiveInteger: primitive operations divide:using:divide: aNumber using: aBlock Private - Divide the receiver by aNumber (unsigned division). EvaluateaBlock passing the result ByteArray, the remainder ByteArray, andwhether the division had a remainder isSmall isSmall Private - Answer whether the receiver is small enough to employ simplescalar algorithms for division and multiplication multiply: multiply: aNumber Private - Multiply the receiver by aNumber (unsigned multiply) LargeWordArray LargeWordArray Defined in namespace SmalltalkSuperclass: LargeArrayedCollectionCategory: Collections-Sequenceable I am similar to a plain WordArray, but I'm specially designed to savememory when lots of items are zero. LargeWordArray: overridden defaultElementdefaultElement Answer the value which is hoped to be the most common in the array newCollection: newCollection: size Create a WordArray of the given size LargeZeroInteger LargeZeroInteger Defined in namespace SmalltalkSuperclass: LargePositiveIntegerCategory: Language-Data types I am quite a strange class. Indeed, the concept of a "large integer"that is zero is a weird one. Actually my only instance is zero butis represented like LargeIntegers, has the same generality asLargeIntegers, and so on. That only instance is stored in the classvariable Zero, and is used in arithmetical methods, when we have tocoerce a parameter that is zero. LargeZeroInteger: accessing at:at: anIndex Answer `0'. hash hash Answer `0'. size size Answer `0'. LargeZeroInteger: arithmetic ** aNumber Multiply aNumber and the receiver, answer the result + + aNumber Sum the receiver and aNumber, answer the result - - aNumber Subtract aNumber from the receiver, answer the result / / aNumber Divide aNumber and the receiver, answer the result (an Integer orFraction) // // aNumber Divide aNumber and the receiver, answer the result truncated towards-infinity \\ \\ aNumber Divide aNumber and the receiver, answer the remainder truncatedtowards -infinity quo: quo: aNumber Divide aNumber and the receiver, answer the result truncatedtowards 0 rem: rem: aNumber Divide aNumber and the receiver, answer the remainder truncatedtowards 0 LargeZeroInteger: numeric testing signsign Answer the receiver's sign strictlyPositive strictlyPositive Answer whether the receiver is > 0 LargeZeroInteger: printing replace:withStringBase:replace: str withStringBase: radix Return in a string the base radix representation of the receiver. Link Link Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections-Sequenceable I represent simple linked lists. Generally, I am not used by myself, butrather a subclass adds other instance variables that hold the informationfor each node, and I hold the glue that keeps them together. Link class: instance creation nextLink:nextLink: aLink Create an instance with the given next link Link: basic nextLinknextLink Answer the next item in the list nextLink: nextLink: aLink Set the next item in the list Link: iteration at:at: index Retrieve a node (instance of Link) that is at a distance of `index'after the receiver. at:put: at: index put: object This method should not be called for instances of this class. do: do: aBlock Evaluate aBlock for each element in the list size size Answer the number of elements in the list. Warning: this is O(n) LinkedList LinkedList Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable I provide methods that access and manipulate linked lists. I assume thatthe elements of the linked list are subclasses of Link, because I usethe methods that class Link supplies to implement my methods. LinkedList: accessing at:at: index Return the element that is index into the linked list. at:put: at: index put: object This method should not be called for instances of this class. LinkedList: adding add:add: aLink Add aLink at the end of the list; return aLink. addFirst: addFirst: aLink Add aLink at the head of the list; return aLink. addLast: addLast: aLink Add aLink at then end of the list; return aLink. remove:ifAbsent: remove: aLink ifAbsent: aBlock Remove aLink from the list and return it, or invoke aBlock if it's notfound in the list. removeFirst removeFirst Remove the first element from the list and return it, or error if thelist is empty. removeLast removeLast Remove the final element from the list and return it, or error if thelist is empty. LinkedList: enumerating do:do: aBlock Enumerate each object in the list, passing it to aBlock (actualbehavior might depend on the subclass of Link that is being used). identityIncludes: identityIncludes: anObject Answer whether we include the anObject object includes: includes: anObject Answer whether we include anObject LinkedList: testing isEmptyisEmpty Returns true if the list contains no members notEmpty notEmpty Returns true if the list contains at least a member size size Answer the number of elements in the list. Warning: this is O(n) LookupKey LookupKey Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types I represent a key for looking up entries in a data structure. Subclassesof me, such as Association, typically represent dictionary entries. LookupKey class: basic key:key: aKey Answer a new instance of the receiver with the given key and value LookupKey: accessing keykey Answer the receiver's key key: key: aKey Set the receiver's key to aKey LookupKey: printing printOn:printOn: aStream Put on aStream a representation of the receiver LookupKey: storing storeOn:storeOn: aStream Put on aStream some Smalltalk code compiling to the receiver LookupKey: testing << aLookupKey Answer whether the receiver's key is less than aLookupKey's = = aLookupKey Answer whether the receiver's key and value are the same asaLookupKey's, or false if aLookupKey is not an instance ofthe receiver hash hash Answer an hash value for the receiver LookupTable LookupTable Defined in namespace SmalltalkSuperclass: DictionaryCategory: Collections-Keyed I am similar to Dictionary, except that my representation isdifferent (more efficient, but not useful to store a variablebinding). I use the object equality comparison message #=to determine equivalence of indices. LookupTable class: instance creation newnew Create a new LookupTable with a default size primNew: primNew: realSize Not commented. LookupTable: accessing add:add: anAssociation Add the anAssociation key to the receiver associationAt:ifAbsent: associationAt: key ifAbsent: aBlock Answer the key/value Association for the given key. Evaluate aBlock(answering the result) if the key is not found at:ifAbsent: at: key ifAbsent: aBlock Answer the value associated to the given key, or the result of evaluatingaBlock if the key is not found at:ifPresent: at: aKey ifPresent: aBlock If aKey is absent, answer nil. Else, evaluate aBlock passing theassociated value and answer the result of the invocation at:put: at: key put: value Store value as associated to the given key LookupTable: copying deepCopydeepCopy Returns a deep copy of the receiver (the instance variables arecopies of the receiver's instance variables) LookupTable: enumerating associationsDo:associationsDo: aBlock Pass each association in the LookupTable to aBlock. do: do: aBlock Pass each value in the LookupTable to aBlock. keysAndValuesDo: keysAndValuesDo: aBlock Pass each key/value pair in the LookupTable as two distinct parametersto aBlock. keysDo: keysDo: aBlock Pass each key in the LookupTable to aBlock. LookupTable: hashing hashhash Answer the hash value for the receiver LookupTable: rehashing rehashrehash Rehash the receiver LookupTable: removing remove:remove: anAssociation Remove anAssociation's key from the dictionary remove:ifAbsent: remove: anAssociation ifAbsent: aBlock Remove anAssociation's key from the dictionary removeKey:ifAbsent: removeKey: key ifAbsent: aBlock Remove the passed key from the LookupTable, answer the result ofevaluating aBlock if it is not found LookupTable: storing storeOn:storeOn: aStream Print Smalltalk code compiling to the receiver on aStream Magnitude Magnitude Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types I am an abstract class. My objects represent things that are discrete andmap to a number line. My instances can be compared with < and >. Magnitude: basic << aMagnitude Answer whether the receiver is less than aMagnitude <= <= aMagnitude Answer whether the receiver is less than or equal to aMagnitude = "Relational operators This method's functionality should be implemented by subclasses of Magnitude > > aMagnitude Answer whether the receiver is greater than aMagnitude >= >= aMagnitude Answer whether the receiver is greater than or equal to aMagnitude Magnitude: misc methods between:and:between: min and: max Returns true if object is inclusively between min and max. max: max: aMagnitude Returns the greatest object between the receiver and aMagnitude min: min: aMagnitude Returns the least object between the receiver and aMagnitude MappedCollection MappedCollection Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Keyed I represent collections of objects that are indirectly indexed by names.There are really two collections involved: domain and a map. The map mapsbetween external names and indices into domain, which contains thereal association. In order to work properly, the domain must be an instanceof a subclass of SequenceableCollection, and the map must be an instance ofDictionary, or of a 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. Toaccess by key, to perform enumeration, etc. you would ask an instance of me;to access by index, you would access the domain directly.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. MappedCollection class: instance creation collection:map:collection: aCollection map: aMap Answer a new MappedCollection using the given domain (aCollection)and map new collection:map: new This method should not be used; instead, use #collection:map: tocreate MappedCollection. MappedCollection: basic add:add: anObject This method should not be called for instances of this class. at: at: key Answer the object at the given key at:put: at: key put: value Store value at the given key collect: collect: aBlock Answer a MappedCollection with a copy of the receiver's mapand a domain obtained by passing each object through aBlock contents contents Answer a bag with the receiver's values do: do: aBlock Evaluate aBlock for each object domain domain Answer the domain keys keys Answer the keys that can be used to access this collection. map map Answer the map reject: reject: aBlock Answer the objects in the domain for which aBlock returns false select: select: aBlock Answer the objects in the domain for which aBlock returns true size size Answer the receiver's size Memory Memory Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I provide access to actual machine addresses of OOPs and objects. Ihave no instances; you send messages to my class to map between an objectand the address of its OOP or object. In addition I provide directmemory access with different C types (ints, chars, OOPs, floats,...). Memory class: accessing at:"Note that Not commented. at:put: "Storing methods at: anAddress put: aValue bigEndian bigEndian Answer whether we're running on a big- or little-endian system. charAt: charAt: anAddress Access the C char at the given address. The value isreturned as a Smalltalk Character. charAt:put: charAt: anAddress put: aValue Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given address, using sizeof(char)bytes - i.e. 1 byte. deref: deref: anAddress Access the C int pointed by the given address doubleAt: doubleAt: anAddress Access the C double at the given address. doubleAt:put: doubleAt: anAddress put: aValue Store the Smalltalk Float object identified by `value', at thegiven address, writing it like a C double. floatAt: floatAt: anAddress Access the C float at the given address. floatAt:put: floatAt: anAddress put: aValue Store the Smalltalk Float object identified by `value', at thegiven address, writing it like a C float. intAt: intAt: anAddress Access the C int at the given address. intAt:put: intAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(int) bytes. longAt: longAt: anAddress Access the C long int at the given address. longAt:put: longAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(long) bytes. longDoubleAt: longDoubleAt: anAddress Access the C long double at the given address. longDoubleAt:put: longDoubleAt: anAddress put: aValue Store the Smalltalk Float object identified by `value', at thegiven address, writing it like a C long double. shortAt: shortAt: anAddress Access the C short int at the given address. shortAt:put: shortAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(short) bytes. stringAt: stringAt: anAddress Access the string pointed by the C `char *' at the given given address. stringAt:put: stringAt: anAddress put: aValue Store the Smalltalk String object identified by `value', at thegiven address in memory, writing it like a *FRESHLY ALLOCATED*C string. It is the caller's responsibility to free it ifnecessary. ucharAt:put: ucharAt: anAddress put: aValue Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given address, using sizeof(char)bytes - i.e. 1 byte. uintAt:put: uintAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(int) bytes. ulongAt:put: ulongAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(long) bytes. unsignedCharAt: unsignedCharAt: anAddress Access the C unsigned char at the given address.The value is returned as a Smalltalk Character. unsignedCharAt:put: unsignedCharAt: anAddress put: aValue Store as a C char the Smalltalk Character or Integer objectidentified by `value', at the given address, using sizeof(char)bytes - i.e. 1 byte. unsignedIntAt: unsignedIntAt: anAddress Access the C unsigned int at the given address. unsignedIntAt:put: unsignedIntAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(int) bytes. unsignedLongAt: unsignedLongAt: anAddress Access the C unsigned long int at the given address. unsignedLongAt:put: unsignedLongAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(long) bytes. unsignedShortAt: unsignedShortAt: anAddress Access the C unsigned short int at the given address. unsignedShortAt:put: unsignedShortAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(short) bytes. ushortAt:put: ushortAt: anAddress put: aValue Store the Smalltalk Integer object identified by `value', at thegiven address, using sizeof(short) bytes. Message Message Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I represent a message send. My instances are created to hold a messagethat has failed, so that error reporting methods can examine the senderand arguments, but also to represent method attributes (like<primitive: 111> since their syntax is isomorphic to that of amessage send. Message class: creating instances selector:arguments:selector: aSymbol arguments: anArray Create a new Message with the given selector and arguments Message: accessing argumentargument Answer the first of the receiver's arguments arguments arguments Answer the receiver's arguments arguments: arguments: anArray Set the receiver's arguments selector selector Answer the receiver's selector selector: selector: aSymbol Set the receiver's selector Message: basic printAsAttributeOn:printAsAttributeOn: aStream Print a representation of the receiver on aStream, modelingit after the source code for a attribute. Message: printing printOn:printOn: aStream Print a representation of the receiver on aStream reinvokeFor: reinvokeFor: aReceiver Resend to aReceiver - present for compatibility sendTo: sendTo: aReceiver Resend to aReceiver MessageNotUnderstood MessageNotUnderstood Defined in namespace SmalltalkSuperclass: HaltCategory: Language-Exceptions MessageNotUnderstood represents an error during message lookup. Signalingit is the default action of the #doesNotUnderstand: handler MessageNotUnderstood: accessing messagemessage Answer the message that wasn't understood receiver receiver Answer the object to whom the message send was directed MessageNotUnderstood: description descriptiondescription Answer a textual description of the exception. Metaclass Metaclass Defined in namespace SmalltalkSuperclass: ClassDescriptionCategory: Language-Implementation I am the root of the class hierarchy. My instances are metaclasses, one foreach real class. My instances have a single instance, which they holdonto, which is the class that they are the metaclass of. I provide methodsfor creation of actual class objects from metaclass object, and the creationof metaclass objects, which are my instances. If this is confusing to you,it should be...the Smalltalk metaclass system is strange and complex. Metaclass class: instance creation subclassOf:subclassOf: superMeta Answer a new metaclass representing a subclass of superMeta Metaclass: accessing instanceClassinstanceClass Answer the only instance of the metaclass primaryInstance primaryInstance Answer the only instance of the metaclass - present for compatibility soleInstance soleInstance Answer the only instance of the metaclass - present for compatibility Metaclass: basic instanceVariableNames:instanceVariableNames: classInstVarNames Set the class-instance variables for the receiver to be thosein classInstVarNames name:environment:subclassOf:instanceVariableArray:shape:classPool:poolDictionaries:category: name: className environment: aNamespace subclassOf: superclass instanceVariableArray: variableArray shape: shape classPool: classVarDict poolDictionaries: sharedPoolNames category: categoryNamePrivate - create a full featured class and install it, or change anexisting one name:environment:subclassOf:instanceVariableNames:shape:classVariableNames:poolDictionaries:category: name: newName environment: aNamespace subclassOf: superclass instanceVariableNames: stringOfInstVarNames shape: shape classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNamePrivate - parse the instance and class variables, and the pooldictionaries, then create the class. newMeta:environment:subclassOf:instanceVariableArray:shape:classPool:poolDictionaries:category: newMeta: className environment: aNamespace subclassOf: superclass instanceVariableArray: arrayOfInstVarNames shape: shape classPool: classVarDict poolDictionaries: sharedPoolNames category: categoryNamePrivate - create a full featured class and install it Metaclass: delegation addClassVarName:addClassVarName: aString Add a class variable with the given name to the class pool dictionary addSharedPool: addSharedPool: aDictionary Add the given shared pool to the list of the class' pool dictionaries allClassVarNames allClassVarNames Answer the names of the variables in the receiver's class pool dictionaryand in each of the superclasses' class pool dictionaries allSharedPools allSharedPools Return the names of the shared pools defined by the class and any ofits superclasses category category Answer the class category classPool classPool Answer the class pool dictionary classVarNames classVarNames Answer the names of the variables in the class pool dictionary comment comment Answer the class comment debuggerClass debuggerClass Answer the debugger class that was set in the instance class environment environment Answer the namespace in which the receiver is implemented name name Answer the class name - it has none, actually pragmaHandlerFor: pragmaHandlerFor: aSymbol Not commented. removeClassVarName: removeClassVarName: aString Removes the class variable from the class, error if not present, orstill in use. removeSharedPool: removeSharedPool: aDictionary Remove the given dictionary to the list of the class' pool dictionaries sharedPools sharedPools Return the names of the shared pools defined by the class Metaclass: filing fileOutOn:fileOutOn: aFileStream File out complete class description: class definition, class andinstance methods Metaclass: printing nameIn:nameIn: aNamespace Answer the class name when the class is referenced from aNamespace. printOn: printOn: aStream Print a represention of the receiver on aStream printOn:in: printOn: aStream in: aNamespace Print on aStream the class name when the class is referenced fromaNamespace. storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Metaclass: testing functionality asClassasClass Answer `instanceClass'. isMetaclass isMetaclass Answer `true'. MethodContext MethodContext Defined in namespace SmalltalkSuperclass: ContextPartCategory: Language-Implementation My instances represent an actively executing method. They record variousbits of information about the execution environment, and contain theexecution stack. MethodContext: accessing homehome Answer the MethodContext to which the receiver refers(i.e. the receiver itself) isBlock isBlock Answer whether the receiver is a block context isDisabled ensure:block isDisabled Answers whether the receiver has actually ended execution and willbe skipped when doing a return. BlockContexts are removed from thechain whenever a non-local return is done, but MethodContexts need tostay there in case there is a non-local return from the #ensure:block. isEnvironment isEnvironment To create a valid execution environment for the interpreter evenbefore it starts, GST creates a fake context which invokes a special“termination” method. Such a context can be used as a marker forthe current execution environment. Answer whether the receiver isthat kind of context. isUnwind continue: ensure: isUnwind Answers whether the context must continue execution even after anon-local return (a return from the enclosing method of a block, ora call to the #continue: method of ContextPart). Such contexts arecreated only by #ensure:. sender sender Return the context from which the receiver was sent MethodContext: debugging isInternalExceptionHandlingContext exceptionHandlingInternal:isInternalExceptionHandlingContext Answer whether the receiver is a context that should be hidden to the userwhen presenting a backtrace. Such contexts are identified through the#exceptionHandlingInternal: attribute: if there is such a context inthe backtrace, 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 meansthat the contexts above it must be hidden, but not the context itself. MethodContext: printing printOn:printOn: aStream Print a representation for the receiver on aStream MethodDictionary MethodDictionary Defined in namespace SmalltalkSuperclass: LookupTableCategory: Language-Implementation I am similar to an IdentityDictionary, except that removal andrehashing operations inside my instances look atomic to theinterpreter. MethodDictionary: adding at:put:at: key put: value Store value as associated to the given key MethodDictionary: rehashing rehashrehash Rehash the receiver MethodDictionary: removing remove:remove: anAssociation Remove anAssociation's key from the dictionary removeKey:ifAbsent: removeKey: anElement ifAbsent: aBlock Remove the passed key from the dictionary, answer the result ofevaluating aBlock if it is not found MethodInfo 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 sourcecode of the method. MethodInfo: accessing categorycategory Answer the method category category: category: aCategory Set the method category methodClass methodClass Answer the class in which the method is defined methodClass: methodClass: aClass Set the class in which the method is defined selector selector Answer the selector through which the method is called selector: selector: aSymbol Set the selector through which the method is called sourceCode sourceCode Answer a FileSegment or String or nil containing the method source code sourceFile sourceFile Answer the name of the file where the method source code is sourcePos sourcePos Answer the starting position of the method source code in the sourceFile sourceString sourceString Answer a String containing the method source code stripSourceCode stripSourceCode Remove the reference to the source code for the method MethodInfo: equality == aMethodInfo Compare the receiver and aMethodInfo, answer whether they're equal hash hash Answer an hash value for the receiver Namespace Namespace Defined in namespace SmalltalkSuperclass: AbstractNamespaceCategory: Language-Implementation I am a Namespace that has a super-namespace. Namespace class: accessing currentcurrent Answer the current namespace current: current: aNamespaceOrClass Set the current namespace to be aNamespace or, if it is a class,its class pool (the Dictionary that holds class variables). Namespace class: disabling instance creation new addSubspace:new Disabled - use #addSubspace: to create instances new: addSubspace: new: size Disabled - use #addSubspace: to create instances Namespace class: initialization initializeinitialize This actually is not needed, the job could be done in dict.c(function namespace_new). But I'm lazy and I prefer to relyon the Smalltalk implementation of IdentitySet. Namespace: accessing inheritedKeysinheritedKeys Answer a Set of all the keys in the receiver and its superspaces Namespace: namespace hierarchy siblingssiblings Answer all the other namespaces that inherit from the receiver'ssuperspace. siblingsDo: siblingsDo: aBlock Evaluate aBlock once for each of the other namespaces that inheritfrom the receiver's superspace, passing the namespace as a parameter. Namespace: overrides for superspaces associationAt:ifAbsent:associationAt: key ifAbsent: aBlock Return the key/value pair associated to the variable named asspecified by `key'. If the key is not found search will bebrought on in superspaces, finally evaluating aBlock if thevariable cannot be found in any of the superspaces. associationsDo: associationsDo: aBlock Pass each association in the namespace to aBlock at:ifAbsent: at: key ifAbsent: aBlock Return the value associated to the variable named as specifiedby `key'. If the key is not found search will be brought on insuperspaces, finally evaluating aBlock if the variable cannot befound in any of the superspaces. at:ifPresent: at: key ifPresent: aBlock If aKey is absent from the receiver and all its superspaces,answer nil. Else, evaluate aBlock passing the associated valueand answer the result of the invocation do: do: aBlock Pass each value in the namespace to aBlock includesKey: includesKey: key Answer whether the receiver or any of its superspaces containthe given key keysAndValuesDo: keysAndValuesDo: aBlock Pass to aBlock each of the receiver's keys and values, in twoseparate parameters keysDo: keysDo: aBlock Pass to aBlock each of the receiver's keys set:to:ifAbsent: set: key to: newValue ifAbsent: aBlock Assign newValue to the variable named as specified by `key'.This method won't define a new variable; instead if the keyis not found it will search in superspaces and evaluateaBlock if it is not found. Answer newValue. size size Answer the number of keys in the receiver and each of its superspaces Namespace: printing nameIn:nameIn: aNamespace Answer Smalltalk code compiling to the receiver when the currentnamespace is aNamespace printOn:in: printOn: aStream in: aNamespace Print on aStream some Smalltalk code compiling to the receiverwhen the current namespace is aNamespace storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver NetClients.URIResolver NetClients.URIResolver Defined in namespace Smalltalk.NetClientsSuperclass: ObjectCategory: NetClients-URIResolver This class publishes methods to download files from the Internet. NetClients.URIResolver class: api openOn:openOn: aURI Always raise an error, as this method is not supportedwithout loading the additional NetClients package. openOn:ifFail: openOn: aURI ifFail: aBlock Always evaluate aBlock and answer the result if the additional NetClientspackage is not loaded. If it is, instead, return a WebEntity with thecontents of the resource specified by anURI, and only evaluate the blockif loading the resource fails. openStreamOn: openStreamOn: aURI Check if aURI can be fetched from the Internet or from the local system,and if so return a Stream with its contents. If this is not possible,raise an exception. openStreamOn:ifFail: openStreamOn: aURI ifFail: aBlock Check if aURI can be fetched from the Internet or from the local system,and if so return a Stream with its contents. If this is not possible,instead, evaluate the zero-argument block aBlock and answer the resultof the evaluation. NetClients.URIResolver class: instance creation on:on: anURL Answer a new URIResolver that will do its best to fetch the data foranURL from the Internet. NetClients.URL NetClients.URL Defined in namespace Smalltalk.NetClientsSuperclass: ObjectCategory: NetClients-URIResolver Copyright (c) Kazuki Yasumatsu, 1995. All rights reserved. NetClients.URL class: encoding URLs decode:decode: aString Decode a text/x-www-form-urlencoded String into a text/plain String. encode: encode: anURL Encode a text/plain into a text/x-www-form-urlencoded String (thosethings with lots of % in them). initialize initialize Initialize the receiver's class variables. NetClients.URL class: instance creation fromString:fromString: aString Parse the given URL and answer an URL object based on it. new new Answer a 'blank' URL. scheme:host:port:path: scheme: schemeString host: hostString port: portNumber path: pathString Answer an URL object made from all the parts passed as arguments. scheme:path: scheme: schemeString path: pathString Answer an URL object made from all the parts passed as arguments. scheme:username:password:host:port:path: scheme: schemeString username: userString password: passwordString host: hostString port: portNumber path: pathString Answer an URL object made from all the parts passed as arguments. NetClients.URL: accessing decodedFieldsdecodedFields Convert the form fields to a Dictionary, answernil if no question mark is found in the URL. decodedFile decodedFile Answer the file part of the URL, decoding it from x-www-form-urlencodedformat. decodedFragment decodedFragment Answer the fragment part of the URL, decoding it from x-www-form-urlencodedformat. fragment fragment Answer the fragment part of the URL, leaving it in x-www-form-urlencodedformat. fragment: fragment: aString Set the fragment part of the URL, which should be in x-www-form-urlencodedformat. fullRequestString fullRequestString Answer the full request string corresponding to the URL. This is howthe URL would be printed in the address bar of a web browser, except thatthe query data is printed even if it is to be sent through a POST request. hasPostData hasPostData Answer 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 HTTPGET request). hasPostData: hasPostData: aBoolean Set whether the query part of the URL is actually the data for an HTTP POSTrequest and not really part of the URL (as it would be for the HTTPGET request). host host Answer the host part of the URL. host: host: aString Set the host part of the URL to aString. newsGroup newsGroup If the receiver is an nntp url, return the news group. password password Answer the password part of the URL. password: password: aString Set the password part of the URL to aString. path path Answer the path part of the URL. path: path: aString Set the path part of the URL to aString. port port Answer the port number part of the URL. port: port: anInteger Set the port number part of the URL to anInteger. postData postData Answer whether the URL has a query part and it is meant for an HTTP POSTrequest, answer it. Else answer nil. postData: postData: aString Associate to the URL some data that is meant to be sent through an HTTP POSTrequest, answer it. query query Answer the query data associated to the URL. query: query: aString Set the query data associated to the URL to aString. requestString requestString Answer the URL as it would be sent in an HTTP stream (that is, thepath and the query data, the latter only if it is to be sent withan HTTP POST request). scheme scheme Answer the URL's scheme. scheme: scheme: aString Set the URL's scheme to be aString. username username Answer the username part of the URL. username: username: aString Set the username part of the URL to aString. NetClients.URL: comparing == anURL Answer whether the two URLs are equal. The file and anchorare converted to full 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 hash Answer an hash value for the receiver NetClients.URL: copying copyWithoutAuxiliaryPartscopyWithoutAuxiliaryParts Answer a copy of the receiver where the fragment and queryparts of the URL have been cleared. copyWithoutFragment copyWithoutFragment Answer a copy of the receiver where the fragmentparts of the URL has been cleared. postCopy postCopy All the variables are copied when an URL object is copied. NetClients.URL: initialize-release initializeinitialize Initialize the object to a consistent state. NetClients.URL: printing printOn:printOn: stream Print a representation of the URL on the given stream. NetClients.URL: testing canCachecanCache Answer whether the URL is cacheable. The current implementation considersfile URLs not to be cacheable, and everything else to be. hasFragment hasFragment Answer whether the URL points to a particular fragment (anchor) of theresource. hasQuery hasQuery Answer whether the URL includes query arguments to be submitted whenretrieving the resource. isFileScheme isFileScheme Answer whether the URL is a file URL. isFragmentOnly isFragmentOnly Answer whether the URL only includes the name of a particular fragment (anchor)of the resource to which it refers. NetClients.URL: utilities construct:construct: anURL Construct an absolute URL based on the relative URL anURL and the base pathrepresented by the receiver Notification 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 simplyreturns nil. Notification: exception description defaultActiondefaultAction Do the default action for notifications, which is to resume executionof the context which signaled the exception. description description Answer a textual description of the exception. isResumable isResumable Answer true. Notification exceptions are by default resumable. NullProxy NullProxy Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files I am a proxy that does no special processing on the objectto be saved. I can be used to disable proxies for particular subclasses. Mysubclasses add to the stored information, but share the fact that the formatis about the same as that of #dump: without a proxy. NullProxy class: instance creation loadFrom:loadFrom: anObjectDumper Reload the object stored in anObjectDumper NullProxy: accessing dumpTo:dumpTo: anObjectDumper Dump the object stored in the proxy to anObjectDumper NullValueHolder 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 use the only instance of my class (returned by `ValueHolder null')if you're not interested in a value that is returned as described inValueHolder's comment. NullValueHolder class: creating instances newnew Not used – use `ValueHolder null' instead NullValueHolder: accessing valuevalue Retrive the value of the receiver. Always answer nil value: value: anObject Set the value of the receiver. Do nothing, discard the value Number Number Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types I am an abstract class that provides operations on numbers, both floatingpoint and integer. I provide some generic predicates, and supply theimplicit type coercing code for binary operations. Number class: converting coerce:coerce: aNumber Answer aNumber - whatever class it belongs to, it is good readFrom: readFrom: aStream Answer the number read from the rest of aStream, converted to aninstance of the receiver. If the receiver is number, the class of theresult is undefined – but the result is good. Number class: testing isImmediateisImmediate Answer whether, if x is an instance of the receiver, x copy == x Number: arithmetic ** aNumber Subtract the receiver and aNumber, answer the result + + aNumber Sum the receiver and aNumber, answer the result - - aNumber Subtract aNumber from the receiver, answer the result / / aNumber Divide the receiver by aNumber, answer the result (no loss ofprecision). Raise a ZeroDivide exception or return a valid(possibly infinite) continuation value if aNumber is zero. // // aNumber Return the integer quotient of dividing the receiver by aNumber withtruncation towards negative infinity. Raise a ZeroDivideexception if aNumber is zero \\ \\ aNumber Return the remainder of dividing the receiver by aNumber withtruncation towards negative infinity. Raise a ZeroDivideexception if aNumber is zero quo: quo: aNumber Return the integer quotient of dividing the receiver by aNumber withtruncation towards zero. Raise a ZeroDivide exception if aNumber iszero reciprocal reciprocal Return the reciprocal of the receiver rem: rem: aNumber Return the remainder of dividing the receiver by aNumber withtruncation towards zero. Raise a ZeroDivide exception if aNumber iszero Number: comparing max:max: aNumber Answer the maximum between the receiver and aNumber. Redefinein subclasses if necessary to ensure that if either self oraNumber is a NaN, it is always answered. min: min: aNumber Answer the minimum between the receiver and aNumber. Redefinein subclasses if necessary to ensure that if either self oraNumber is a NaN, it is always answered. Number: converting asFloatasFloat Convert the receiver to an arbitrary subclass of Float asFloatD asFloatD This method's functionality should be implemented by subclasses of Number asFloatE asFloatE This method's functionality should be implemented by subclasses of Number asFloatQ asFloatQ This method's functionality should be implemented by subclasses of Number asNumber asNumber Answer the receiver, since it is already a number asRectangle asRectangle Answer an empty rectangle whose origin is (self asPoint) asScaledDecimal: asScaledDecimal: n Answer the receiver, converted to a ScaledDecimal object. asScaledDecimal:radix:scale: asScaledDecimal: denDigits radix: base scale: n Answer the receiver, divided by base^denDigits and converted toa ScaledDecimal object. coerce: coerce: aNumber Answer aNumber - whatever class it belongs to, it is good degreesToRadians degreesToRadians Convert the receiver to radians generality generality Answer the receiver's generality radiansToDegrees radiansToDegrees Convert the receiver from radians to degrees unity unity Coerce 1 to the receiver's class. The default implementation works,but is inefficient zero zero Coerce 0 to the receiver's class. The default implementation works,but is inefficient Number: copying deepCopydeepCopy Return the receiver - it's an immediate (immutable) object shallowCopy shallowCopy Return the receiver - it's an immediate (immutable) object Number: error raising arithmeticError:arithmeticError: msg Raise an ArithmeticError exception having msg as its message text. zeroDivide zeroDivide Raise a division-by-zero (ZeroDivide) exception whose dividendis the receiver. Number: misc math absabs Answer the absolute value of the receiver arcCos arcCos Answer the arc cosine of the receiver arcSin arcSin Answer the arc sine of the receiver arcTan arcTan Answer the arc tangent of the receiver arcTan: arcTan: x Answer the angle (measured counterclockwise) between (x, self) anda ray starting in (0, 0) and moving towards (1, 0) - i.e. 3 o'clock ceilingLog: ceilingLog: radix Answer (self log: radix) ceiling. Optimized to answer an integer. cos cos Answer the cosine of the receiver estimatedLog estimatedLog Answer an estimate of (self abs floorLog: 10). This methodshould be overridden by subclasses, but Number's implementationdoes not raise errors - simply, it gives a correct result, soit is slow. exp exp Answer e raised to the receiver floorLog: floorLog: radix Answer (self log: radix) floor. Optimized to answer an integer. ln ln Answer log base e of the receiver log log Answer log base aNumber of the receiver log: log: aNumber Answer log base aNumber of the receiver negated negated Answer the negated of the receiver positiveDifference: positiveDifference: aNumber Answer the positive difference of the receiver andaNumber, that is self - aNumber if it is positive,0 otherwise. raisedTo: raisedTo: aNumber Return self raised to aNumber power raisedToInteger: raisedToInteger: anInteger Return self raised to the anInteger-th power sin sin Answer the sine of the receiver sqrt sqrt Answer the square root of the receiver squared squared Answer the square of the receiver tan tan Answer the tangent of the receiver withSignOf: withSignOf: aNumber Answer the receiver, with its sign possibly changed to matchthat of aNumber. Number: point creation @@ y Answer a new point whose x is the receiver and whose y is y asPoint asPoint Answer a new point, self @ self Number: retrying retry:coercing: = ~=retry: aSymbol coercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling aSymbol. aSymbol issupposed not to be #= or #~= (since those don't fail if aNumber is nota Number). retryDifferenceCoercing: - retryDifferenceCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #-. retryDivisionCoercing: / retryDivisionCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #/. retryEqualityCoercing: = retryEqualityCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #=. retryError retryError Raise an error—a retrying method was called with two argumentshaving the same generality. retryInequalityCoercing: ~= retryInequalityCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #~=. retryMultiplicationCoercing: * retryMultiplicationCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #*. retryRelationalOp:coercing: retryRelationalOp: aSymbol coercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling aSymbol (<, <=, >, >=). retrySumCoercing: + retrySumCoercing: aNumber Coerce to the other number's class the one number between the receiver andaNumber which has the lowest, and retry calling #+. Number: shortcuts and iterators to:to: stop Return an interval going from the receiver to stop by 1 to:by: to: stop by: step Return an interval going from the receiver to stop with the given step to:by:do: to: stop by: step do: aBlock Evaluate aBlock for each value in the interval going from the receiverto stop with the given step. Compiled in-line for integer literal steps,and for one-argument aBlocks without temporaries, and thereforenot overridable. to:do: to: stop do: aBlock Evaluate aBlock for each value in the interval going from the receiverto stop by 1. Compiled in-line for one-argument aBlocks withouttemporaries, and therefore not overridable. Number: testing closeTo:closeTo: num Answer whether the receiver can be considered sufficientlyclose to num (this is done by checking equality if num isnot a number, and by checking with 0.01% tolerance if numis a number). even even Returns true if self is divisible by 2 isFinite subclassResponsibility isFinite Answer whether the receiver represents a finite quantity. Mostnumeric classes are for finite quantities, so the default is toanswer true rather than calling #subclassResponsibility. isInfinite subclassResponsibility isInfinite Answer whether the receiver represents an infinite quantity. Mostnumeric classes are for finite quantities, so the default is toanswer false rather than calling #subclassResponsibility. isNaN subclassResponsibility isNaN Answer whether the receiver is a Not-A-Number. Most numericclasses don't handle nans, so the default is to answer falserather than calling #subclassResponsibility. isNumber isNumber Answer `true'. isRational isRational Answer whether the receiver is rational - false by default negative negative Answer whether the receiver is < 0 odd odd Returns true if self is not divisible by 2 positive positive Answer whether the receiver is >= 0 sign sign Returns the sign of the receiver. strictlyPositive strictlyPositive Answer whether the receiver is > 0 Number: truncation and round off asIntegerasInteger Answer the receiver, rounded to the nearest integer floor floor Return the integer nearest the receiver toward negative infinity. fractionPart integerPart fractionPart Answer a number which, summed to the #integerPart of thereceiver, gives the receiver itself. integerPart integerPart Answer the receiver, truncated towards zero rounded rounded Returns the integer nearest the receiver roundTo: roundTo: aNumber Answer the receiver, truncated to the nearest multipleof aNumber truncated truncated Answer the receiver, truncated towards zero truncateTo: truncateTo: aNumber Answer the receiver, truncated towards zero to a multipleof aNumber Object Object Defined in namespace SmalltalkSuperclass: noneCategory: Language-Implementation I am the root of the Smalltalk class system.All classes in the system are subclasses of me. Object class: initialization dependenciesdependencies Answer a dictionary that associates an object with its dependents. dependencies: dependencies: anObject Use anObject as the dictionary that associates an object with its dependents. finalizableObjects finalizableObjects Answer a set of finalizable objects. initialize initialize Initialize the Dependencies dictionary to be an IdentityDictionary. In a laterphase of the bootstrap process this is changed to be a WeakKeyIdentityDictionary. update: update: aspect Do any global tasks for the ObjectMemory events. Object: built ins == arg Answer whether the receiver is equal to arg. The equality test isby default the same as that for identical objects. = must not fail;answer false if the receiver cannot be compared to arg == == arg Answer whether the receiver is the same object as arg. This is avery fast test and is called 'object identity'. allOwners allOwners Return an Array of Objects that point to the receiver. asOop asOop Answer the object index associated to the receiver. The objectindex doesn't change when garbage collection is performed. at: at: anIndex Answer the index-th indexed instance variable of the receiver at:put: at: anIndex put: value Store value in the index-th indexed instance variable of the receiver basicAt: basicAt: anIndex Answer the index-th indexed instance variable of the receiver.This method must not be overridden, override at: instead basicAt:put: basicAt: anIndex put: value Store value in the index-th indexed instance variable of the receiverThis method must not be overridden, override at:put: instead basicPrint basicPrint Print a basic representation of the receiver basicSize basicSize Answer the number of indexed instance variable in the receiver become: become: become: otherObject Change all references to the receiver into references to otherObject.Depending on the implementation, references to otherObject might ormight not be transformed into the receiver (respectively,'two-way become' and 'one-way become').Implementations doing one-way become answer the receiver (so that it isnot lost). Most implementations doing two-way become answer otherObject,but this is not assured - so do answer the receiver for consistency.GNU Smalltalk does two-way become and answers otherObject, but thismight change in future versions: programs should not rely on the behaviorand results of #become: . changeClassTo: changeClassTo: aBehavior Mutate the class of the receiver to be aBehavior.Note: Tacitly assumes that the structure is the samefor the original and new class!! checkIndexableBounds: checkIndexableBounds: index Private - Check the reason why an access to the given indexedinstance variable failed checkIndexableBounds:put: checkIndexableBounds: index put: object Private - Check the reason why a store to the given indexedinstance variable failed class class Answer the class to which the receiver belongs halt "### look Not commented. hash hash Answer an hash value for the receiver. This hash value is okfor objects that do not redefine ==. identityHash identityHash Answer an hash value for the receiver. This method must not beoverridden instVarAt: instVarAt: index Answer the index-th instance variable of the receiver.This method must not be overridden. instVarAt:put: instVarAt: index put: value Store value in the index-th instance variable of the receiver.This method must not be overridden. isReadOnly isReadOnly Answer whether the object's indexed instance variables can bewritten isUntrusted isUntrusted Answer whether the object is to be considered untrusted. makeEphemeron mourn makeEphemeron Make the object an 'ephemeron'. An ephemeron is marked after allother objects, and if no references are found to the key except fromthe object itself, it is sent the #mourn message. makeFixed makeFixed Avoid that the receiver moves in memory across garbage collections. makeReadOnly: makeReadOnly: aBoolean Set whether the object's indexed instance variables can be written makeUntrusted: makeUntrusted: aBoolean Set whether the object is to be considered untrusted. makeWeak mourn makeWeak Make 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 tonils by the VM; the weak object is then sent the #mourn message. mark: mark: mark: mark: aSymbol Private - use this method to mark code which needs to be reworked,removed, etc. You can then find all senders of #mark: to find all markedmethods or you can look for all senders of the symbol that you sent to#mark: to find a category of marked methods. nextInstance nextInstance Private - answer another instance of the receiver's class, ornil if the entire object table has been walked notYetImplemented notYetImplemented Called when a method defined by a class is not yet implemented,but is going to be perform: perform: selectorOrMessageOrMethod Send the unary message named selectorOrMessageOrMethod (if a Symbol)to the receiver, or the message and arguments it identifies (if a Messageor DirectedMessage), or finally execute the method within the receiver(if a CompiledMethod). In the last case, the method need not reside onthe hierarchy from the receiver's class to Object – it need not resideat all in a MethodDictionary, in fact – but doing bad things willcompromise stability of the Smalltalk virtual machine (and don't blameanybody but yourself).This method should not be overridden perform:with: perform: selectorOrMethod with: arg1 Send the message named selectorOrMethod (if a Symbol) to the receiver,passing arg1 to it, or execute the method within the receiver(if a CompiledMethod). In the latter case, the method need not reside onthe hierarchy from the receiver's class to Object – it need not resideat all in a MethodDictionary, in fact – but doing bad things willcompromise stability of the Smalltalk virtual machine (and don't blameanybody but yourself).This method should not be overridden perform:with:with: perform: selectorOrMethod with: arg1 with: arg2 Send the message named selectorOrMethod (if a Symbol) to the receiver,passing arg1 and arg2 to it, or execute the method within the receiver(if a CompiledMethod). In the latter case, the method need not reside onthe hierarchy from the receiver's class to Object – it need not resideat all in a MethodDictionary, in fact – but doing bad things willcompromise stability of the Smalltalk virtual machine (and don't blameanybody but yourself).This method should not be overridden perform:with:with:with: perform: selectorOrMethod with: arg1 with: arg2 with: arg3 Send the message named selectorOrMethod (if a Symbol) to the receiver,passing the other arguments to it, or execute the method within thereceiver (if a CompiledMethod). In the latter case, the method need notreside on the hierarchy from the receiver's class to Object – it neednot reside at all in a MethodDictionary, in fact – but doing bad thingswill compromise stability of the Smalltalk virtual machine (and don'tblame anybody but yourself).This method should not be overridden perform:with:with:with:with: perform: selectorOrMethod with: arg1 with: arg2 with: arg3 with: arg4 Send the message named selectorOrMethod (if a Symbol) to the receiver,passing the other arguments to it, or execute the method within thereceiver (if a CompiledMethod). In the latter case, the method need notreside on the hierarchy from the receiver's class to Object – it neednot reside at all in a MethodDictionary, in fact – but doing bad thingswill compromise stability of the Smalltalk virtual machine (and don'tblame anybody but yourself).This method should not be overridden perform:withArguments: perform: selectorOrMethod withArguments: argumentsArray Send the message named selectorOrMethod (if a Symbol) to the receiver,passing the elements of argumentsArray as parameters, or execute themethod within the receiver (if a CompiledMethod). In the latter case,the method need not reside on the hierarchy from the receiver's classto Object – it need not reside at all in a MethodDictionary, infact – but doing bad things will compromise stability of the Smalltalkvirtual machine (and don't blame anybody but yourself).This method should not be overridden primError: basicPrint printOn: primError: message This might start the debugger... Note that we use #basicPrint'cause #printOn: might invoke an error. primitiveFailed primitiveFailed Called when a VM primitive fails shallowCopy shallowCopy Returns a shallow copy of the receiver (the instance variables arenot copied) shouldNotImplement shouldNotImplement Called when objects belonging to a class should not answer aselector defined by a superclass size size Answer the number of indexed instance variable in the receiver subclassResponsibility subclassResponsibility Called when a method defined by a class should be overriddenin a subclass tenure tenure Move the object to oldspace. Object: change and update broadcast:broadcast: aSymbol Send the unary message aSymbol to each of the receiver's dependents broadcast:with: broadcast: aSymbol with: anObject Send the message aSymbol to each of the receiver's dependents, passinganObject broadcast:with:with: broadcast: aSymbol with: arg1 with: arg2 Send the message aSymbol to each of the receiver's dependents, passingarg1 and arg2 as parameters broadcast:withArguments: broadcast: aSymbol withArguments: anArray Send the message aSymbol to each of the receiver's dependents, passingthe parameters in anArray broadcast:withBlock: broadcast: aSymbol withBlock: aBlock Send the message aSymbol to each of the receiver's dependents, passingthe result of evaluating aBlock with each dependent as the parameter changed changed Send update: for each of the receiver's dependents, passing them thereceiver changed: changed: aParameter Send update: for each of the receiver's dependents, passing themaParameter update: changed changed: update: aParameter Default behavior is to do nothing. Called by #changed and #changed: Object: class type methods species class species copyEmpty:species This method has no unique definition. Generally speaking, methods whichalways return the same type usually don't use #class, but #species.For example, a PositionableStream's species is the class of the collectionon which it is streaming (used by upTo:, upToAll:, upToEnd). Stream usesspecies for obtaining the class of next:'s return value, Collection usesit in its #copyEmpty: message, which in turn is used by all collection-re-turning methods. An Interval's species is Array (used by collect:, select:,reject:, etc.). yourself yourself Answer the receiver Object: conversion asValueasValue Answer a ValueHolder whose initial value is the receiver. Object: copying copycopy Returns a shallow copy of the receiver (the instance variables arenot copied). The shallow copy receives the message postCopy and theresult of postCopy is passed back. deepCopy deepCopy Returns a deep copy of the receiver (the instance variables arecopies of the receiver's instance variables) postCopy postCopy Performs any changes required to do on a copied object. This is theplace where one could, for example, put code to replace objects withcopies of the objects Object: debugging inspectinspect Print all the instance variables of the receiver on the Transcript validSize validSize Answer how many elements in the receiver should be inspected Object: dependents access addDependent:addDependent: anObject Add anObject to the set of the receiver's dependents. Important:if an object has dependents, it won't be garbage collected. dependents dependents Answer a collection of the receiver's dependents. release release Remove all of the receiver's dependents from the set and allow thereceiver to be garbage collected. removeDependent: removeDependent: anObject Remove anObject to the set of the receiver's dependents. No problemif anObject is not in the set of the receiver's dependents. Object: error raising doesNotUnderstand:doesNotUnderstand: aMessage Called by the system when a selector was not found. message is aMessage containing information on the receiver error: error: message Display a walkback for the receiver, with the given error message.Signal an `Error' exception (you can trap it the old way too, with`ExError' halt: halt: message Display a walkback for the receiver, with the given error message.Signal an `Halt' exception (you can trap it the old way too, with`ExHalt') Object: finalization addToBeFinalized finalizeaddToBeFinalized Arrange things so that #finalize is sent to the object when the garbagecollector finds out there are only weak references to it. finalize finalize Do nothing by default mourn mourn This method is sent by the VM to weak and ephemeron objects when one oftheir fields is found out to be garbage collectable (this means, for weakobjects, that there are no references to it from non-weak objects, andfor ephemeron objects, that the only paths to the first instance variablepass through other instance variables of the same ephemeron). The defaultbehavior is to do nothing. removeToBeFinalized finalize removeToBeFinalized Unregister the object, so that #finalize is no longer sent to the objectwhen the garbage collector finds out there are only weak references to it. Object: printing basicPrintNlbasicPrintNl Print a basic representation of the receiver, followed by a new line. basicPrintOn: basicPrintOn: aStream Print a represention of the receiver on aStream display printrepresentation display Print a represention of the receiver on the Transcript (stdout the GUIis not active). For most objects this is simply its #printrepresentation, but for strings and characters, superfluous dollarsor extra pair of quotes are stripped. displayNl printNl displayNl Print a represention of the receiver, then put a new line onthe Transcript (stdout the GUI is not active). For most objects thisis simply its #printNl representation, but for strings andcharacters, superfluous dollars or extra pair of quotes are stripped. displayOn: printOn: displayOn: aStream Print a represention of the receiver on aStream. For most objectsthis is simply its #printOn: representation, but for strings andcharacters, superfluous dollars or extra pair of quotes are stripped. displayString printString displayString Answer a String representing the receiver. For most objectsthis is simply its #printString, but for strings and characters,superfluous dollars or extra pair of quotes are stripped. print print Print a represention of the receiver on the Transcript (stdout the GUIis not active) printNl printNl Print a represention of the receiver on stdout, put a new linethe Transcript (stdout the GUI is not active) printOn: printOn: aStream Print a represention of the receiver on aStream printString printString Answer a String representing the receiver Object: relational operators ~=~= anObject Answer whether the receiver and anObject are not equal ~~ ~~ anObject Answer whether the receiver and anObject are not the same object Object: saving and loading binaryRepresentationObjectbinaryRepresentationObject This method must be implemented if PluggableProxies are used withthe receiver's class. The default implementation raises an exception. postLoad postLoad Called after loading an object; must restore it to the state before`preStore' was called. Do nothing by default postStore postLoad postStore Called after an object is dumped; must restore it to the state before`preStore' was called. Call #postLoad by default preStore preStore Called before dumping an object; it must *change* it (it must not answera new object) if necessary. Do nothing by default reconstructOriginalObject binaryRepresentationObject reconstructOriginalObject Used if an instance of the receiver's class is returned as the#binaryRepresentationObject of another object. The default implementationraises an exception. Object: storing storestore Put a String of Smalltalk code compiling to the receiver onthe Transcript (stdout the GUI is not active) storeNl storeNl Put a String of Smalltalk code compiling to the receiver, followed bya new line, on the Transcript (stdout the GUI is not active) storeOn: storeOn: aStream Put Smalltalk code compiling to the receiver on aStream storeString storeString Answer a String of Smalltalk code compiling to the receiver Object: syntax shortcuts ->-> anObject Creates a new instance of Association with the receiver being the keyand the argument becoming the value Object: testing functionality ifNil:ifNil: nilBlock Evaluate nilBlock if the receiver is nil, else answer self ifNil:ifNotNil: ifNil: nilBlock ifNotNil: notNilBlock Evaluate nilBlock if the receiver is nil, else evaluatenotNilBlock, passing the receiver. ifNotNil: ifNotNil: notNilBlock Evaluate notNiilBlock if the receiver is not nil, passing the receiver.Else answer nil. ifNotNil:ifNil: ifNotNil: notNilBlock ifNil: nilBlock Evaluate nilBlock if the receiver is nil, else evaluatenotNilBlock, passing the receiver. isArray isArray Answer `false'. isBehavior isBehavior Answer `false'. isCharacter isCharacter Answer `false'. isCharacterArray isCharacterArray Answer `false'. isClass isClass Answer `false'. isFloat isFloat Answer `false'. isInteger isInteger Answer `false'. isKindOf: isKindOf: aClass Answer whether the receiver's class is aClass ora subclass of aClass isMemberOf: isMemberOf: aClass Returns true if the receiver is an instance of the class 'aClass' isMeta isMeta Same as isMetaclass isMetaClass isMetaClass Same as isMetaclass isMetaclass isMetaclass Answer `false'. isNamespace isNamespace Answer `false'. isNil isNil Answer whether the receiver is nil isNumber isNumber Answer `false'. isSmallInteger isSmallInteger Answer `false'. isString isString Answer `false'. isSymbol isSymbol Answer `false'. notNil notNil Answer whether the receiver is not nil respondsTo: respondsTo: aSymbol Returns true if the receiver understands the given selector Object: VM callbacks badReturnErrorbadReturnError Called back when a block performs a bad return. mustBeBoolean mustBeBoolean Called by the system when ifTrue:*, ifFalse:*, and: or or: are sent toanything but a boolean noRunnableProcess noRunnableProcess Called back when all processes are suspended userInterrupt userInterrupt Called back when the user presses Ctrl-Break ObjectDumper ObjectDumper Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Files I'm not part of a normal Smalltalk system, but mostSmalltalks provide a similar feature: that is, support for storing objectsin a binary format; there are many advantages in using me instead of #storeOn:and the Smalltalk compiler.The data is stored in a very compact format, which has the side effect ofmaking loading much faster when compared with compiling the Smalltalk codeprepared by #storeOn:. In addition, my instances support circular referencesbetween objects, while #storeOn: supports it only if you know of suchreferences at design time and you override #storeOn: to deal with them ObjectDumper class: establishing proxy classes disableProxyFor:disableProxyFor: aClass Disable proxies for instances of aClass and its descendants hasProxyFor: hasProxyFor: aClass Answer whether a proxy class has been registered for instancesof aClass. proxyClassFor: proxyClassFor: anObject Answer the class of a valid proxy for an object, or nil if none couldbe found proxyFor: proxyFor: anObject Answer a valid proxy for an object, or the object itself if none couldbe found registerProxyClass:for: registerProxyClass: aProxyClass for: aClass Register the proxy class aProxyClass - descendent of DumperProxy -to be used for instances of aClass and its descendants ObjectDumper class: instance creation newnew This method should not be called for instances of this class. on: on: aFileStream Answer an ObjectDumper working on aFileStream. ObjectDumper class: shortcuts dump:to:dump: anObject to: aFileStream Dump anObject to aFileStream. Answer anObject loadFrom: loadFrom: aFileStream Load an object from aFileStream and answer it ObjectDumper class: testing exampleexample This is a real torture test: it outputs recursive objects,identical objects multiple times, classes, metaclasses,integers, characters and proxies (which is also a test of morecomplex objects)! ObjectDumper: accessing flushflush `Forget' any information on previously stored objects. stream stream Answer the ByteStream to which the ObjectDumper will writeand from which it will read. stream: stream: aByteStream Set the ByteStream to which the ObjectDumper will writeand from which it will read. ObjectDumper: loading/dumping objects dump:dump: anObject Dump anObject on the stream associated with the receiver. AnsweranObject load load Load an object from the stream associated with the receiver and answerit ObjectDumper: stream interface atEndatEnd Answer whether the underlying stream is at EOF next next Load an object from the underlying stream nextPut: nextPut: anObject Store an object on the underlying stream ObjectMemory ObjectMemory Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I provide a few methods that enable one to tune thevirtual machine's usage of memory. In addition, I can signal to mydependants some `events' that can happen during the virtual machine'slife.ObjectMemory has both class-side and instance-side methods. In general,class-side methods provide means to tune the parameters of the memorymanager, while instance-side methods are used together with the #currentclass-side method to take a look at statistics on the memory manager'sstate. ObjectMemory class: accessing currentcurrent Return a snapshot of the VM's memory management statistics. ObjectMemory class: builtins abortabort Quit the Smalltalk environment, dumping core. addressOf: addressOf: anObject Returns the address of the actual object that anObjectreferences. Note that, with the exception of fixed objectsthis address is only valid until the next garbage collection;thus it's pretty risky to count on the address returned bythis method for very long. addressOfOOP: addressOfOOP: anObject Returns the address of the OOP (object table slot) for anObject.The address is an Integer and will not change over time (i.e. isimmune from garbage collector action) except if the virtual machineis stopped and restarted. bigObjectThreshold bigObjectThreshold Answer the smallest size for objects that are allocated outsidethe main heap in the hope of providing more locality of referencebetween small objects. bigObjectThreshold: bigObjectThreshold: bytes Set the smallest size for objects that are allocated outsidethe main heap in the hope of providing more locality of referencebetween small objects. bytes must be a positive SmallInteger. compact compact Force a full garbage collection, including compaction of oldspace finishIncrementalGC finishIncrementalGC Do a step in the incremental garbage collection. gcMessage gcMessage Answer whether messages indicating that garbage collection is takingplace are printed on stdout gcMessage: gcMessage: aBoolean Set whether messages indicating that garbage collection is takingplace are printed on stdout globalGarbageCollect globalGarbageCollect Force a full garbage collection growThresholdPercent growThresholdPercent Answer the percentage of the amount of memory used by the system growswhich has to be full for the system to allocate more memory growThresholdPercent: growThresholdPercent: growPercent Set the percentage of the amount of memory used by the system growswhich has to be full for the system to allocate more memory growTo: growTo: numBytes Grow the amount of memory used by the system grows to numBytes. incrementalGCStep incrementalGCStep Do a step in the incremental garbage collection. quit quit Quit the Smalltalk environment. Whether files are closed andother similar cleanup occurs depends on the platform quit: quit: exitStatus Quit the Smalltalk environment, passing the exitStatus integerto the OS. Files are closed and other similar cleanups occur. scavenge scavenge Force a minor garbage collection smoothingFactor smoothingFactor Answer the factor (between 0 and 1) used to smooth the statisticsprovided by the virtual machine about memory handling. 0 disablesupdating the averages, 1 disables the smoothing (the statisticsreturn the last value). smoothingFactor: smoothingFactor: rate Set the factor (between 0 and 1) used to smooth the statisticsprovided by the virtual machine about memory handling. 0 disablesupdating the averages, 1 disables the smoothing (the statisticsreturn the last value). snapshot: snapshot: aString Save an image on the aString file spaceGrowRate spaceGrowRate Answer the rate with which the amount of memory used by the system grows spaceGrowRate: spaceGrowRate: rate Set the rate with which the amount of memory used by the system grows ObjectMemory class: initialization changed:changed: aSymbol Not commented. initialize initialize Initialize the globals ObjectMemory class: saving the image snapshotsnapshot Save a snapshot on the image file that was loaded on startup. ObjectMemory: accessing allocFailuresallocFailures Answer the number of times that the old-space allocator foundno block that was at least as big as requested, and had to askthe operating system for more memory. allocMatches allocMatches Answer the number of times that the old-space allocator founda block that was exactly as big as requested. allocProbes allocProbes Answer the number of free blocks that the old-space allocator hadto examine so far to allocate all the objects that are in old-space allocSplits allocSplits Answer the number of times that the old-space allocator could notfind a block that was exactly as big as requested, and had to splita larger free block in two parts. bytesPerOOP bytesPerOOP Answer the number of bytes that is taken by an ordinaryobject pointer (in practice, a field such as a named instancevariable). bytesPerOTE bytesPerOTE Answer the number of bytes that is taken by an objecttable entry (in practice, the overhead incurred by everyobject in the system, with the sole exception of SmallIntegers). edenSize edenSize Answer the number of bytes in the `eden' area of the younggeneration (in practice, the number of allocated bytes betweentwo scavenges). edenUsedBytes edenUsedBytes Answer the number of bytes that are currently filled in the`eden' area of the young generation. fixedSpaceSize fixedSpaceSize Answer the number of bytes in the special heap devoted toobjects that the garbage collector cannot move around in memory. fixedSpaceUsedBytes fixedSpaceUsedBytes Answer the number of bytes that are currently filled in thespecial heap devoted to objects that the garbage collectorcannot move around in memory. numCompactions numCompactions Answer the number of oldspace compactions that happened sincethe VM was started. numFixedOOPs numFixedOOPs Answer the number of objects that the garbage collectorcannot move around in memory. numFreeOTEs numFreeOTEs Answer the number of entries that are currently free in theobject table. numGlobalGCs numGlobalGCs Answer the number of global garbage collections (collectionof the entire heap) that happened since the VM was started. numGrowths numGrowths Answer the number of times that oldspace was grown sincethe VM was started. numOldOOPs numOldOOPs Answer the number of objects that reside in the old generation. numOTEs numOTEs Answer the number of entries that are currently allocated for theobject table. numScavenges numScavenges Answer the number of scavenges (fast collections of the younggeneration) that happened since the VM was started. numWeakOOPs numWeakOOPs Answer the number of weak objects that the garbage collectoris currently tracking. oldSpaceSize oldSpaceSize Answer the number of bytes in the old generation. oldSpaceUsedBytes oldSpaceUsedBytes Answer the number of bytes that are currently filled in theold generation. reclaimedBytesPerGlobalGC reclaimedBytesPerGlobalGC Answer the average number of bytes that are found to be garbageduring a global garbage collections. reclaimedBytesPerScavenge reclaimedBytesPerScavenge Answer the average number of bytes that are found to be garbageduring a scavenge. reclaimedPercentPerScavenge reclaimedPercentPerScavenge Answer the average percentage of allocated bytes that are foundto be garbage during a scavenge. If this number falls below 60-70you should definitely increment the size of the eden, because yourisk that scavenging is eating a considerable fraction of yourexecution time; do the measurement on a restartedimage, so that the extra tenuring incurred when creating long-livedobjects such as classes or methods is not considered. survSpaceSize survSpaceSize Answer the number of bytes in the `survivor' area of the younggeneration (the area to which young objects are relocated duringscavenges). survSpaceUsedBytes survSpaceUsedBytes Answer the number of bytes that are currently filled in the`survivor' area of the young generation. tenuredBytesPerScavenge tenuredBytesPerScavenge Answer the average number of bytes that are promoted to oldspaceduring a scavenge. timeBetweenGlobalGCs timeBetweenGlobalGCs Answer the average number of milliseconds between two globalgarbage collections. timeBetweenGrowths timeBetweenGrowths Answer the average number of milliseconds between decisions togrow the heap. timeBetweenScavenges timeBetweenScavenges Answer the average number of milliseconds between two scavenges(fast collections of the young generation). timeToCollect timeToCollect Answer the average number of milliseconds that a globalgarbage collection takes. timeToCompact timeToCompact Answer the average number of milliseconds that compacting theheap takes. This the same time that is taken by growing theheap. timeToScavenge timeToScavenge Answer the average number of milliseconds that a scavenge takes(fast collections of the young generation). ObjectMemory: builtins updateupdate Update the values in the object to the current state of the VM. ObjectMemory: derived information scavengesBeforeTenuringscavengesBeforeTenuring Answer the number of scavenges that an object must on averagesurvive before being promoted to oldspace; this is however onlyan estimate because objects that are reachable from oldspace havea higher probability to be tenured soon, while objects that areonly reachable from thisContext have a lower probability to betenured. Anyway, if this number falls below 2-3 you shoulddefinitely increment the size of eden and/or of survivor space,because you are tenuring too often and relying too much onglobal garbage collection to keep your heap clean; do themeasurement on a restarted image, so that the extra tenuringincurred when creating long-lived objects such as classes ormethods is not considered. OrderedCollection OrderedCollection Defined in namespace SmalltalkSuperclass: SequenceableCollectionCategory: Collections-Sequenceable My instances represent ordered collections of arbitrary typed objects whichare not directly accessible by an index. They can be accessed indirectlythrough an index, and can be manipulated by adding to the end or basedon content (such as add:after:) OrderedCollection class: instance creation newnew Answer an OrderedCollection of default size new: new: anInteger Answer an OrderedCollection of size anInteger OrderedCollection: accessing at:at: anIndex Answer the anIndex-th item of the receiver at:put: at: anIndex put: anObject Store anObject at the anIndex-th item of the receiver, answer anObject size size Return the number of objects in the receiver OrderedCollection: adding add:add: anObject Add anObject in the receiver, answer it add:after: add: newObject after: oldObject Add newObject in the receiver just after oldObject, answer it.Fail if oldObject can't be found add:afterIndex: add: newObject afterIndex: i Add newObject in the receiver just after the i-th, answer it.Fail if i < 0 or i > self size add:before: add: newObject before: oldObject Add newObject in the receiver just before oldObject, answer it.Fail if oldObject can't be found add:beforeIndex: add: newObject beforeIndex: i Add newObject in the receiver just before the i-th, answer it.Fail if i < 1 or i > self size + 1 addAll: addAll: aCollection Add every item of aCollection to the receiver, answer it addAll:after: addAll: newCollection after: oldObject Add every item of newCollection to the receiver just afteroldObject, answer it. Fail if oldObject is not found addAll:afterIndex: addAll: newCollection afterIndex: i Add every item of newCollection to the receiver just afterthe i-th, answer it. Fail if i < 0 or i > self size addAll:before: addAll: newCollection before: oldObject Add every item of newCollection to the receiver just beforeoldObject, answer it. Fail if oldObject is not found addAll:beforeIndex: addAll: newCollection beforeIndex: i Add every item of newCollection to the receiver just beforethe i-th, answer it. Fail if i < 1 or i > self size + 1 addAllFirst: addAllFirst: aCollection Add every item of newCollection to the receiver right at the startof the receiver. Answer aCollection addAllLast: addAllLast: aCollection Add every item of newCollection to the receiver right at the endof the receiver. Answer aCollection addFirst: addFirst: newObject Add newObject to the receiver right at the start of the receiver.Answer newObject addLast: addLast: newObject Add newObject to the receiver right at the end of the receiver.Answer newObject OrderedCollection: removing remove:ifAbsent:remove: anObject ifAbsent: aBlock Remove anObject from the receiver. If it can't be found, answer theresult of evaluating aBlock removeAtIndex: removeAtIndex: anIndex Remove the object at index anIndex from the receiver. Fail if theindex is out of bounds. removeFirst removeFirst Remove an object from the start of the receiver. Fail if the receiveris empty removeLast removeLast Remove an object from the end of the receiver. Fail if the receiveris empty Package Package Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Packaging I am not part of a standard Smalltalk system. I store internally theinformation on a Smalltalk package, and can output my description inXML. Package: accessing allFilesallFiles Answer an OrderedCollection of all the files, both built anddistributed, that are part of the package. baseDirs: baseDirs: baseDirs Resolve the names in the package according to the base directoriesin baseDirs, which depend on where the packages.xml is found:the three possible places are 1) the system kernel directory's parentdirectory, 2) the local kernel directory's parent directory, 3) thelocal image directory (in order of decreasing priority).For a packages.xml found in the system kernel directory's parentdirectory, all three directories are searched. For a packages.xmlfound in the local kernel directory's parent directory, onlydirectories 2 and 3 are searched. For a packages.xml directory inthe local image directory, instead, only directory 3 is searched. builtFiles builtFiles Answer a (modifiable) OrderedCollection of files that are part ofthe package but are not distributed. callouts callouts Answer a (modifiable) Set of call-outs that are required to loadthe package. Their presence is checked after the libraries andmodules are loaded so that you can do a kind of versioning. createNamespace createNamespace Private - Create the path of namespaces indicated by ournamespace field in dot notation, and answer the final namespace directory directory Answer the base directory from which to load the package. directory: directory: dir Set the base directory from which to load the package to dir. features features Answer a (modifiable) Set of features provided by the package. fileIn fileIn File in the given package and its dependencies. fileIns fileIns Answer a (modifiable) OrderedCollections of files that are to befiled-in to load the package. This is usually a subset of`files' and `builtFiles'. files files Answer a (modifiable) OrderedCollection of files that are part ofthe package. findBaseDirs:for: findBaseDirs: baseDirs for: aCollection Resolve the names in aCollection according to the base directoriesin baseDirs, and return the collection with the full filenames, ornil if no directory was found for one or more file in aCollection. findBaseDirs:forFile: findBaseDirs: baseDirs forFile: fileName Try appending 'self directory' and fileName to each of the directoryin baseDirs, and return the path to the first tried filename that exists.Return nil if no directory is found that contains the file. libraries libraries Answer a (modifiable) Set of shared library namesthat are required to load the package. modules modules Answer a (modifiable) Set of modules that arerequired to load the package. name name Answer the name of the package. name: name: aString Set to aString the name of the package. namespace namespace Answer the namespace in which the package is loaded. namespace: namespace: aString Set to aString the namespace in which the package is loaded. prerequisites prerequisites Answer a (modifiable) Set of prerequisites. primFileIn primFileIn Private - File in the given package without paying attention atdependencies and C callout availability printOn: printOn: aStream Print a representation of the receiver on aStream (it happensto be XML. printXmlOn:collection:tag: printXmlOn: aStream collection: aCollection tag: aString Private - Print aCollection on aStream as a sequence of aStringtags. sunitScript sunitScript Answer a String containing a SUnit script thatdescribes the package's test suite. sunitScripts sunitScripts Answer a (modifiable) OrderedCollection of SUnit scripts thatcompose the package's test suite. PackageLoader PackageLoader Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Packaging I am not part of a standard Smalltalk system. I provide methods forretrieving package information from an XML file and to load packagesinto a Smalltalk image, correctly handling dependencies. PackageLoader class: accessing builtFilesFor: directoryFor:builtFilesFor: package Answer a Set of Strings containing the filenames of the given package'smachine-generated files (relative to the directory answered by#directoryFor:) calloutsFor: directoryFor: calloutsFor: package Answer a Set of Strings containing the filenames of the given package'srequired callouts (relative to the directory answered by #directoryFor:) directoryFor: directoryFor: package Answer a complete path to the given package's files featuresFor: featuresFor: package Answer a Set of Strings containing the features provided by the givenpackage. fileInsFor: directoryFor: fileInsFor: package Answer a Set of Strings containing the filenames of the given package'sfile-ins (relative to the directory answered by #directoryFor:) filesFor: directoryFor: filesFor: package Answer a Set of Strings containing the filenames of the given package'sfiles (relative to the directory answered by #directoryFor:) flush flush Set to reload the `packages.xml' file the next time it is needed. ignoreCallouts ignoreCallouts Answer whether unavailable C callouts must generate errors or not. ignoreCallouts: ignoreCallouts: aBoolean Set whether unavailable C callouts must generate errors or not. librariesFor: directoryFor: librariesFor: package Answer a Set of Strings containing the filenames of the given package'slibraries (relative to the directory answered by #directoryFor:) modulesFor: directoryFor: modulesFor: package Answer a Set of Strings containing the filenames of the given package'smodules (relative to the directory answered by #directoryFor:) packageAt: packageAt: package Answer a Package object for the given package prerequisitesFor: prerequisitesFor: package Answer a Set of Strings containing the prerequisites for the given package refreshDependencies refreshDependencies Reload the `packages.xml' file in the image and kernel directories.The three possible places are 1) the system kernel directory's parentdirectory, 2) the local kernel directory's parent directory, 3) thelocal image directory (in order of decreasing priority).For a packages.xml found in the system kernel directory's parentdirectory, all three directories are searched. For a packages.xmlfound in the local kernel directory's parent directory, onlydirectories 2 and 3 are searched. For a packages.xml directory inthe local image directory, instead, only directory 3 is searched. sunitScriptFor: sunitScriptFor: package Answer a Strings containing a SUnit script that describes the package'stest suite. PackageLoader class: loading extractDependenciesFor:onError:extractDependenciesFor: packagesList onError: aBlock Answer an OrderedCollection containing all the packages which youhave to load to enable the packages in packagesList, in an appropriateorder. For examplePackageLoader extractDependenciesFor: #('BloxTestSuite' 'Blox' 'Browser')on a newly built image will evaluate to an OrderedCollection containing'Kernel', 'Blox', 'BloxTestSuite' and 'Browser'. Note thatBlox has been moved before BloxTestSuite.Pass an error message to aBlock if one or more packages needprerequisites which are not available. fileInPackage: fileInPackage: package File in the given package into GNU Smalltalk. fileInPackages: fileInPackages: packagesList File in all the packages in packagesList into GNU Smalltalk. PackageLoader class: testing canLoad:canLoad: package Answer whether all the needed pre-requisites for package are available. Permission Permission Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Security I am the basic class that represents whether operations that could harmthe system's security are allowed or denied. Permission class: testing allowing:target:action:allowing: aSymbol target: aTarget action: action Not commented. allowing:target:actions: allowing: aSymbol target: aTarget actions: actionsArray Not commented. denying:target:action: denying: aSymbol target: aTarget action: action Not commented. denying:target:actions: denying: aSymbol target: aTarget actions: actionsArray Not commented. granting:target:action: granting: aSymbol target: aTarget action: action Not commented. granting:target:actions: granting: aSymbol target: aTarget actions: actionsArray Not commented. name:target:action: name: aSymbol target: aTarget action: action Not commented. name:target:actions: name: aSymbol target: aTarget actions: actionsArray Not commented. Permission: accessing action:action: anObject Not commented. actions actions Answer `actions'. actions: actions: anObject Not commented. allow allow Not commented. allowing allowing Not commented. deny deny Not commented. denying denying Not commented. isAllowing isAllowing Answer `positive'. name name Answer `name'. name: name: anObject Not commented. target target Answer `target'. target: target: anObject Not commented. Permission: testing check:for:check: aPermission for: anObject Not commented. implies: implies: aPermission Not commented. PluggableAdaptor PluggableAdaptor Defined in namespace SmalltalkSuperclass: ValueAdaptorCategory: Language-Data types I mediate between complex get/set behavior and the #value/#value:protocol used by ValueAdaptors. The get/set behavior can be implementedby two blocks, or can be delegated to another object with messagessuch as #someProperty to get and #someProperty: to set. PluggableAdaptor class: creating instances getBlock:putBlock: value value:getBlock: getBlock putBlock: putBlock Answer a PluggableAdaptor using the given blocks to implement#value and #value: on:aspect: value value: on: anObject aspect: aSymbol Answer a PluggableAdaptor using anObject's aSymbol message toimplement #value, and anObject's aSymbol: message (aSymbolfollowed by a colon) to implement #value: on:getSelector:putSelector: value value: on: anObject getSelector: getSelector putSelector: putSelector Answer a PluggableAdaptor using anObject's getSelector message toimplement #value, and anObject's putSelector message to implement#value: on:index: at: at:put:message value value: at: at:put: on: anObject index: anIndex Answer a PluggableAdaptor using anObject's #at: and #at:put:message to implement #value and #value:; the first parameterof #at: and #at:put: is anIndex on:key: on:index: on: aDictionary key: aKey Same as #on:index:. Provided for clarity and completeness. PluggableAdaptor: accessing valuevalue Get the value of the receiver. value: value: anObject Set the value of the receiver. PluggableProxy PluggableProxy Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files I am a proxy that stores a different objectand, upon load, sends #reconstructOriginalObject to that object (whichcan be a DirectedMessage, in which case the message is sent). Theobject to be stored is retrieved by sending #binaryRepresentationObject tothe object. PluggableProxy class: accessing on: binaryRepresentationObject preStore postStoreon: anObject Answer a proxy to be used to save anObject. The proxystores a different object obtained by sending to anObjectthe #binaryRepresentationObject message (embeddedbetween #preStore and #postStore as usual). PluggableProxy: saving and restoring object reconstructOriginalObject postLoadobject Reconstruct the object stored in the proxy and answer it;the binaryRepresentationObject is sent the#reconstructOriginalObject message, and the resultingobject is sent the #postLoad message. Point Point Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types Beginning of a Point class for simple display manipulation. Has not been exhaustively tested but appears to work for the basic primitives and for the needs of the Rectangle class. Point class: instance creation newnew Create a new point with both coordinates set to 0 x:y: x: xInteger y: yInteger Create a new point with the given coordinates Point: accessing xx Answer the x coordinate x: x: aNumber Set the x coordinate to aNumber x:y: x: anXNumber y: aYNumber Set the x and y coordinate to anXNumber and aYNumber, respectively y y Answer the y coordinate y: y: aNumber Set the y coordinate to aNumber 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, withno loss of precision // // scale Divide the receiver by scale, which can be a Number or a Point, withtruncation towards -infinity abs abs Answer a new point whose coordinates are the absolute values of thereceiver's 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 receiveris higher and to the 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 receiveris lower and to the right of aPoint max: max: aPoint Answer self if it is lower and to the right of aPoint, aPoint otherwise min: min: aPoint Answer self if it is higher and to the left of aPoint, aPoint otherwise Point: converting asPointasPoint Answer the receiver. asRectangle asRectangle Answer an empty rectangle whose origin is self corner: corner: aPoint Answer a Rectangle whose origin is the receiver and whose corneris aPoint extent: extent: aPoint Answer a Rectangle whose origin is the receiver and whose extentis aPoint hash hash Answer an hash value for the receiver Point: point functions arcTanarcTan Answer the angle (measured counterclockwise) between the receiver anda ray starting in (0, 0) and moving towards (1, 0) - i.e. 3 o'clock dist: dist: aPoint Answer the distance between the receiver and aPoint dotProduct: dotProduct: aPoint Answer the dot product between the receiver and aPoint grid: grid: aPoint Answer a new point whose coordinates are rounded towards the nearestmultiple of aPoint normal normal Rotate the Point 90degrees clockwise and get the unit vector transpose transpose Answer a new point whose coordinates are the receiver's coordinatesexchanged (x becomes y, y becomes x) truncatedGrid: truncatedGrid: aPoint Answer a new point whose coordinates are rounded towards -infinity,to a multiple of grid (which must be a Point) Point: printing printOn:printOn: aStream Print a representation for the receiver on aStream Point: storing storeOn:storeOn: aStream Print Smalltalk code compiling to the receiver on aStream Point: truncation and round off roundedrounded Answer a new point whose coordinates are rounded to the nearest integer truncateTo: truncateTo: grid Answer a new point whose coordinates are rounded towards -infinity,to a multiple of grid (which must be a Number) PositionableStream 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 reador write sequentially, but also position the file to a particular placewhenever you choose. Generally, you'll want to use ReadStream, WriteStreamor ReadWriteStream instead of me to create and use streams. PositionableStream class: instance creation on:on: aCollection Answer an instance of the receiver streaming on thewhole contents of aCollection on:from:to: on: aCollection from: firstIndex to: lastIndex Answer an instance of the receiver streaming fromthe firstIndex-th item of aCollection to the lastIndex-th PositionableStream: accessing-reading closeclose Disassociate a stream from its backing store. contents contents Returns a collection of the same type that the stream accesses, up toand including the final element. copyFrom:to: position copyFrom: start to: end Answer the data on which the receiver is streaming, fromthe start-th item to the end-th. Note that this method is 0-based,unlike the one in Collection, because a Stream's #position methodreturns 0-based values. next next Answer the next item of the receiver. Returns nil when at end of stream. peek peek Returns the next element of the stream without moving the pointer.Returns nil when at end of stream. peekFor: peekFor: anObject Returns true and gobbles the next element from the stream of it isequal to anObject, returns false and doesn't gobble the next elementif the next element is not equal to anObject. readStream readStream Answer a ReadStream on the same contents as the receiver reverseContents reverseContents Returns a collection of the same type that the stream accesses, up toand including the final element, but in reverse order. PositionableStream: class type methods isExternalStreamisExternalStream We stream on a collection residing in the image, so answer false species upTo: select: species Return the type of the collections returned by #upTo: etc., which are thesame kind as those returned by the collection with methods such as #select:. PositionableStream: positioning basicPosition:basicPosition: anInteger Move the stream pointer to the anInteger-th object isPositionable skip: isPositionable Answer true if the stream supports moving backwards with #skip:. position position Answer the current value of the stream pointer position: position: anInteger Move the stream pointer to the anInteger-th object reset reset Move the stream back to its first element. For write-only streams,the stream is truncated there. setToEnd setToEnd Move the current position to the end of the stream. size size Answer the size of data on which we are streaming. skip: skip: anInteger Move the current position by anInteger places, either forwards orbackwards. skipSeparators next skipSeparators skipSeparators Advance the receiver until we find a character that is not aseparator. Answer false if we reach the end of the stream,else answer true; in this case, sending #next will return thefirst non-separator character (possibly the same to which thestream pointed before #skipSeparators was sent). PositionableStream: testing atEndatEnd Answer whether the objects in the stream have reached an end basicAtEnd basicAtEnd Answer whether the objects in the stream have reached an end.This method must NOT be overridden. isEmpty isEmpty Answer whether the stream has no objects PositionableStream: truncating truncatetruncate Truncate the receiver to the current position - only validfor writing streams Process Process Defined in namespace SmalltalkSuperclass: LinkCategory: Language-Processes I represent a unit of computation. My instances are independantlyexecutable blocks that have a priority associated with them, and theycan suspend themselves and resume themselves however they wish. Process: accessing externalInterruptsEnabledexternalInterruptsEnabled Answer whether the receiver is executed with interrupts enabled name name Answer the user-friendly name of the process. name: name: aString Give the name aString to the process priority priority Answer the receiver's priority priority: priority: anInteger Change the receiver's priority to anInteger queueInterrupt: queueInterrupt: aBlock Force the receiver to be interrupted and to evaluate aBlock as soon as itbecomes the active process (this could mean NOW if the receiver is active).If the process is temporarily suspended or waiting on a semaphore, it istemporarily woken up so that the interrupt is processed as soon as theprocess priority allows to do. Answer the receiver. setPriorityFrom:to:suspend: setPriorityFrom: activePriority to: anInteger suspend: aBoolean Change the priority to anInteger. If aBoolean is true,suspend the process after having done so; if it is false,check if it is nicer to relinquish control from the runningprocess (based on the priority of the active process, thatis passed in activePriority) and if this is the case, preempt it. suspendedContext suspendedContext Answer the context that the process was executing at the time it wassuspended. valueWithoutInterrupts: valueWithoutInterrupts: aBlock Evaluate aBlock and delay all interrupts that are requested during itsexecution to after aBlock returns. Process: basic contextcontext Return the execution context of the receiver. lowerPriority lowerPriority raisePriority lowerPriority Lower a bit the priority of the receiver. A #lowerPriority willcancel a previous #raisePriority, and vice versa. makeUntrusted: makeUntrusted: aBoolean Set whether the receiver is trusted or not. primTerminate primTerminate Terminate the receiver - This is nothing more than prohibiting toresume the process, then suspending it. raisePriority lowerPriority raisePriority raisePriority Raise a bit the priority of the receiver. A #lowerPriority willcancel a previous #raisePriority, and vice versa. singleStep singleStepWaitingOn: singleStep Execute a limited amount of code (usually a bytecode, or up to thenext backward jump, or up to the next message send) of the receiver,which must in a ready-to-run state (neither executing nor terminatingnor suspended), then restart running the current process. The currentprocess should have higher priority than the receiver. For betterperformance, use the underlying primitive, Process>>#singleStepWaitingOn:. suspend suspend Do nothing if we're already suspended. Note that the blue book madesuspend a primitive - but the real primitive is yielding control toanother process. Suspending is nothing more than taking ourselves outof every scheduling list and THEN yielding control to another process terminate ensure: ifCurtailed: terminate Terminate the receiver after having evaluated all the #ensure: and#ifCurtailed: blocks that are active in it. This is done by signallinga ProcessBeingTerminated notification. Process: builtins resumeresume Resume the receiver's execution singleStepWaitingOn: singleStepWaitingOn: aSemaphore Execute a limited amount of code (usually a bytecode, or up to thenext backward jump, or up to the next message send) of the receiver,which must in a ready-to-run state (neither executing nor terminatingnor suspended), then restart running the current process. aSemaphoreis used as a means to synchronize the execution of the current processand the receiver and should have no signals on it. The current processshould have higher priority than the receiver. yield yield Yield control from the receiver to other processes Process: printing printOn:printOn: aStream Print a representation of the receiver on aStream ProcessorScheduler ProcessorScheduler Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes I provide methods that control the execution of processes. ProcessorScheduler class: instance creation newnew Error—new instances of ProcessorScheduler should not be created. ProcessorScheduler: basic activePriorityactivePriority Answer the active process' priority activeProcess activeProcess Answer the active process changePriorityListOf:to:suspend: changePriorityListOf: aProcess to: aPriority suspend: aBoolean Private - Move aProcess to the execution list for aPriority,answer the new execution list processesAt: processesAt: aPriority Answer a linked list of processes at the given priority terminateActive terminateActive Terminate the active process timeSlice timeSlice Answer the timeslice that is assigned to each Process before itis automatically preempted by the system (in milliseconds). Ananswer of zero means that preemptive multitasking is disabled.Note that the system by default is compiled without preemptivemultitasking, and that even if it is enabled it will work onlyunder BSD derivatives (or, in general, systems that supportITIMER_VIRTUAL). timeSlice: timeSlice: milliSeconds Set the timeslice that is assigned to each Process before it isautomatically preempted by the system. Setting this to zerodisables preemptive multitasking. Note that the system bydefault is compiled with preemptive multitasking disabled, andthat even if it is enabled it will surely work only under BSDderivatives (or, in general, systems that support ITIMER_VIRTUAL). yield yield Let the active process yield control to other processes ProcessorScheduler: built ins disableInterrupts disableInterrupts enableInterruptstwicedisableInterrupts Disable interrupts caused by external events while thecurrent process is executing. Note that interrupts aredisabled on a per-process basis, and that calling#disableInterrupts twice requires calling #enableInterruptstwice as well to re-enable interrupts. enableInterrupts enableInterrupts Re-enable interrupts caused by external events while thecurrent process is executing. By default, interrupts areenabled. ProcessorScheduler: idle tasks idleidle Private - Call the next idle task idleAdd: idleAdd: aBlock Register aBlock to be executed when things are idle initialize initialize Private - Start the finalization process. update: update: aSymbol If we left some work behind when the image was saved,do it now. ProcessorScheduler: printing printOn:printOn: aStream Store onto aStream a printed representation of the receiver ProcessorScheduler: priorities highestPriorityhighestPriority Answer the highest valid priority highIOPriority highIOPriority Answer the priority for system high-priority I/O processes,such as a process handling input from a network. lowestPriority lowestPriority Answer the lowest valid priority lowIOPriority lowIOPriority Answer the priority for system low-priority I/O processes.Examples are the process handling input from the user (keyboard,pointing device, etc.) and the process distributing input from anetwork. priorityName: priorityName: priority Private - Answer a name for the given process priority rockBottomPriority rockBottomPriority Answer the lowest valid priority systemBackgroundPriority systemBackgroundPriority Answer the priority for system background-priority processes.Examples are an incremental garbage collector or status checker. timingPriority timingPriority Answer the priority for system real-time processes. unpreemptedPriority valueWithoutPreemption unpreemptedPriority Answer the highest priority avilable in the system; nevercreate a process with this priority, instead useBlockClosure>>#valueWithoutPreemption. userBackgroundPriority userBackgroundPriority Answer the priority for user background-priority processes userInterruptPriority userInterruptPriority Answer the priority for user interrupt-priority processes.Processes run at this level will preempt the window schedulerand should, therefore, not consume the processor forever. userSchedulingPriority userSchedulingPriority Answer the priority for user standard-priority processes ProcessorScheduler: storing storeOn:storeOn: aStream Store onto aStream a Smalltalk expression which evaluates to the receiver ProcessorScheduler: timed invocation isTimeoutProgrammed signal:atMilliseconds:isTimeoutProgrammed Private - Answer whether there is a pending call to#signal:atMilliseconds: signal:atMilliseconds: signal: aSemaphore atMilliseconds: millis Private - signal 'aSemaphore' after 'millis' milliseconds have elapsed signal:onInterrupt: signal: aSemaphore onInterrupt: anIntegerSignalNumber Private - signal 'aSemaphore' when the given C signal occurs Promise Promise Defined in namespace SmalltalkSuperclass: ValueHolderCategory: Language-Data types I store my value in a variable, and know whether I have beeninitialized or not. If you ask for my value and I have not beeninitialized, I suspend the process until a value has been assigned. Promise class: creating instances nullnull This method should not be called for instances of this class. Promise: accessing hasValuehasValue Answer whether we already have a value. value value Get the value of the receiver. value: value: anObject Set the value of the receiver. Promise: initializing initializeinitialize Private - set the initial state of the receiver Promise: printing printOn:printOn: aStream Print a representation of the receiver Random Random Defined in namespace SmalltalkSuperclass: StreamCategory: Streams My instances are generator streams that produce random numbers, which arefloating point values between 0 and 1. Random class: instance creation newnew Create a new random number generator whose seed is given by thecurrent time on the millisecond clock seed: seed: aFloat Create a new random number generator whose seed is aFloat Random class: shortcuts between:and:between: low and: high Return a random integer between the given extrema next next Return a random number between 0 and 1 (excluded) Random: basic atEndatEnd This stream never ends. Always answer false. between:and: between: low and: high Return a random integer between low and high. next next Return the next random number in the sequence. nextPut: nextPut: value This method should not be called for instances of this class. Random: testing chiSquarechiSquare Compute the chi-square of the random that this class generates. chiSquare:range: chiSquare: n range: r Return the chi-square deduced from calculating n randomnumbers in the 0..r range. ReadStream ReadStream Defined in namespace SmalltalkSuperclass: PositionableStreamCategory: Streams-Collections I implement the set of read-only stream objects. You may read frommy objects, but you may not write to them. ReadStream class: instance creation on:on: aCollection Answer a new stream working on aCollection from its start. on:from:to: on: aCollection from: firstIndex to: lastIndex Answer an instance of the receiver streaming fromthe firstIndex-th item of aCollection to the lastIndex-th ReadWriteStream 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. ReadWriteStream class: instance creation on:on: aCollection Answer a new stream working on aCollection from its start. Thestream starts at the front of aCollection. on:from:to: on: aCollection from: firstIndex to: lastIndex Answer an instance of the receiver streaming fromthe firstIndex-th item of aCollection to the lastIndex-th with: with: aCollection Answer a new instance of the receiver which streams from the endof aCollection. ReadWriteStream: positioning position:position: anInteger Unlike WriteStreams, ReadWriteStreams don't truncate the stream skip: skip: anInteger Unlike WriteStreams, ReadWriteStreams don't truncate the stream Rectangle Rectangle Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Data types Beginning of the Rectangle class for simple display manipulation. Rectangles require the Point class to be available. An extension to the Point class is made here that since it requires Rectangles to be defined (see converting) Rectangle class: instance creation left:right:top:bottom:left: leftNumber right: rightNumber top: topNumber bottom: bottomNumber Answer a rectangle with the given coordinates new new Answer the (0 @ 0 corner: 0 @ 0) rectangle origin:corner: origin: originPoint corner: cornerPoint Answer a rectangle with the given corners origin:extent: origin: originPoint extent: extentPoint Answer a rectangle with the given origin and size Rectangle: accessing bottombottom Answer the corner's y of the receiver bottom: bottom: aNumber Set the corner's y of the receiver bottomCenter bottomCenter Answer the center of the receiver's bottom side bottomLeft bottomLeft Answer the bottom-left corner of the receiver bottomLeft: bottomLeft: aPoint Answer the receiver with the bottom-left changed to aPoint bottomRight bottomRight Answer the bottom-right corner of the receiver bottomRight: bottomRight: aPoint Change the bottom-right corner of the receiver center center Answer the center of the receiver corner corner Answer the corner of the receiver corner: corner: aPoint Set the corner of the receiver extent extent Answer the extent of the receiver extent: extent: aPoint Change the size of the receiver, keeping the origin the same height height Answer the height of the receiver height: height: aNumber Set the height of the receiver left left Answer the x of the left edge of the receiver left: left: aValue Set the x of the left edge of the receiver left:top:right:bottom: left: l top: t right: r bottom: b Change all four the coordinates of the receiver's corners leftCenter leftCenter Answer the center of the receiver's left side origin origin Answer the top-left corner of the receiver origin: origin: aPoint Change the top-left corner of the receiver to aPoint origin:corner: origin: pnt1 corner: pnt2 Change both the origin (top-left corner) and the corner (bottom-rightcorner) of the receiver origin:extent: origin: pnt1 extent: pnt2 Change the top-left corner and the size of the receiver right right Answer the x of the bottom-right corner of the receiver right: right: aNumber Change the x of the bottom-right corner of the receiver rightCenter rightCenter Answer the center of the receiver's right side top top Answer the y of the receiver's top-left corner top: top: aValue Change the y of the receiver's top-left corner topCenter topCenter Answer the center of the receiver's top side topLeft topLeft Answer the receiver's top-left corner topLeft: topLeft: aPoint Change the receiver's top-left corner's coordinates to aPoint topRight topRight Answer the receiver's top-right corner topRight: topRight: aPoint Change the receiver's top-right corner to aPoint width width Answer the receiver's width width: width: aNumber Change the receiver's width to aNumber Rectangle: copying copycopy Return a deep copy of the receiver for safety. Rectangle: printing printOn:printOn: aStream Print a representation of the receiver on aStream storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver on aStream Rectangle: rectangle functions amountToTranslateWithin:amountToTranslateWithin: aRectangle Answer a Point so that if aRectangle is translated by that point,its origin lies within the receiver's. area area Answer the receiver's area. The area is the width times the height,so it is possible for it to be negative if the rectangle is notnormalized. areasOutside: areasOutside: aRectangle Answer a collection of rectangles containing the parts of the receiveroutside of aRectangle. For all points in the receiver, but outsideaRectangle, exactly one rectangle in the collection will contain thatpoint. expandBy: expandBy: delta Answer a new rectangle that is the receiver expanded by aValue:if aValue is a rectangle, calculate origin=origin-aValue origin,corner=corner+aValue corner; else calculate origin=origin-aValue,corner=corner+aValue. insetBy: insetBy: delta Answer a new rectangle that is the receiver inset by aValue:if aValue is a rectangle, calculate origin=origin+aValue origin,corner=corner-aValue corner; else calculate origin=origin+aValue,corner=corner-aValue. insetOriginBy:corner: insetOriginBy: originDelta corner: cornerDelta Answer a new rectangle that is the receiver inset so thatorigin=origin+originDelta, corner=corner-cornerDelta.The deltas can be points or numbers intersect: intersect: aRectangle Answers the rectangle (if any) created by the overlap ofrectangles A and B. Answers nil if the rectangles do notoverlap merge: merge: aRectangle Answer a new rectangle which is the smallest rectangle containingboth the receiver and aRectangle. translatedToBeWithin: translatedToBeWithin: aRectangle Answer a copy of the receiver that does not extend beyond aRectangle. Rectangle: testing == aRectangle Answer whether the receiver is equal to aRectangle contains: contains: aRectangle Answer true if the receiver contains (see containsPoint:) bothaRectangle's origin and aRectangle's corner containsPoint: containsPoint: aPoint Answer true if aPoint is equal to, or below and to the right of, thereceiver's origin; and aPoint is above and to the left of the receiver'scorner hash hash Answer an hash value for the receiver intersects: intersects: aRectangle Answer true if the receiver intersect aRectangle, i.e. if it contains(see containsPoint:) any of aRectangle corners or if aRectangle containsthe receiver Rectangle: transforming moveBy:moveBy: aPoint Change the receiver so that the origin and corner are shifted by aPoint moveTo: moveTo: aPoint Change the receiver so that the origin moves to aPoint and the sizeremains unchanged scaleBy: scaleBy: scale Answer a copy of the receiver in which the origin and corner aremultiplied by scale translateBy: translateBy: factor Answer a copy of the receiver in which the origin and corner are shiftedby aPoint Rectangle: truncation and round off roundedrounded Answer a copy of the receiver with the coordinates rounded to the nearestintegers RecursionLock RecursionLock Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Processes RecursionLock class: instance creation newnew Answer a new semaphore RecursionLock: accessing isOwnerProcessisOwnerProcess Answer whether the receiver is the owner of the lock. name name Answer a user-defined name for the lock. name: name: aString Set to aString the user-defined name for the lock. waitingProcesses waitingProcesses Answer the set of processes that are waiting on the semaphore. wouldBlock wait wouldBlock Answer whether sending #wait to the receiver would suspend theactive process. RecursionLock: mutual exclusion critical:critical: aBlock Wait for the receiver to be free, execute aBlock and signal the receiveragain. Return the result of evaluating aBlock. RecursionLock: printing printOn:printOn: aStream Print a human-readable represention of the receiver on aStream. Regex Regex Defined in namespace SmalltalkSuperclass: StringCategory: Collections-Text A Regex is equivalent to a String, except that it is read-only and thatthe regular expression matcher caches a compiled representation of themost recently used Regexes, thus speeding up matching. Regex objectsare constructed automatically by methods that expect to match manytimes the same regular expression, but can be constructed explicitlysending #asRegex to a String or Symbol.Creation of Regex objects inside a loop is of course slower than creatingthem outside the loop, but special care is taken so that the same Regexobject is used whenever possible (when converting Strings to Regex, thecache is sought for an equivalent, already constructed Regex). Regex class: instance creation fromString:fromString: aString Not commented. new new Not commented. Regex: basic at:put:at: anIndex put: anObject Fail. Regex objects are read-only. copy copy Answer the receiver; instances of Regex are identity objects becausetheir only purpose is to ease caching, and we obtain better cachingif we avoid copying Regex objects Regex: conversion asRegexasRegex Answer the receiver, which *is* a Regex! asString asString Answer the receiver, converted back to a String species species Answer `String'. Regex: printing displayOn: printOn:displayOn: aStream Print a represention of the receiver on aStream. For most objectsthis is simply its #printOn: representation, but for strings andcharacters, superfluous dollars or extra pairs of quotes are stripped. displayString printString displayString Answer a String representing the receiver. For most objectsthis is simply its #printString, but for strings and characters,superfluous dollars or extra pair of quotes are stripped. printOn: printOn: aStream Print a represention of the receiver on aStream. RegexResults RegexResults Defined in namespace SmalltalkSuperclass: ObjectCategory: Collections-Text I hold the results of a regular expression match, and I can reconstructwhich parts of the matched string were assigned to each subexpression.Methods such as #=~ return RegexResults objects, while others transformthe string directly without passing the results object back to thecaller. RegexResults: accessing at:at: anIndex If the regular expression was matched, return the text of theanIndex-th subexpression in the successful match. from from If the regular expression was matched, return the indexof the first character in the successful match. fromAt: fromAt: anIndex If the regular expression was matched, return the index of the firstcharacter of the anIndex-th subexpression in the successful match. intervalAt: intervalAt: anIndex If the regular expression was matched, return an Interval for the rangeof indices in the anIndex-th subexpression of the successful match. match match If the regular expression was matched, return the text of thesuccessful match. matchInterval matchInterval If the regular expression was matched, return an Interval for therange of indices of the successful match. size size If the regular expression was matched, return the numberof subexpressions that were present in the regular expression. subject subject If the regular expression was matched, return the textthat was matched against it. to to If the regular expression was matched, return the indexof the last character in the successful match. toAt: toAt: anIndex If the regular expression was matched, return the index of the lastcharacter of the anIndex-th subexpression in the successful match. RegexResults: testing ifMatched:ifMatched: oneArgBlock If the regular expression was matched, pass the receiver tooneArgBlock and return its result. Otherwise, return nil. ifMatched:ifNotMatched: ifMatched: oneArgBlock ifNotMatched: zeroArgBlock If the regular expression was matched, evaluate oneArgBlock with thereceiver as the argument. If it was not, evaluate zeroArgBlock.Answer the result of the block's evaluation. ifNotMatched: ifNotMatched: zeroArgBlock If the regular expression was matched, return the receiver. If it wasnot, evaluate zeroArgBlock and return its result. ifNotMatched:ifMatched: ifNotMatched: zeroArgBlock ifMatched: oneArgBlock If the regular expression was matched, evaluate oneArgBlock with thereceiver as the argument. If it was not, evaluate zeroArgBlock.Answer the result of the block's evaluation. matched matched Answer whether the regular expression was matched RootNamespace RootNamespace Defined in namespace SmalltalkSuperclass: AbstractNamespaceCategory: Language-Implementation I am a special form of dictionary. Classes hold onan instance of me; it is called their `environment'. RootNamespace class: instance creation new:new: spaceName Create a new root namespace with the given name, and add to Smalltalka key that references it. RootNamespace: namespace hierarchy siblingssiblings Answer all the other root namespaces siblingsDo: siblingsDo: aBlock Evaluate aBlock once for each of the other root namespaces,passing the namespace as a parameter. RootNamespace: overrides for superspaces inheritedKeysinheritedKeys Answer a Set of all the keys in the receiver and its superspaces set:to:ifAbsent: set: key to: newValue ifAbsent: aBlock Assign newValue to the variable named as specified by `key'.This method won't define a new variable; instead if the keyis not found it will search in superspaces and evaluateaBlock if it is not found. Answer newValue. RootNamespace: printing nameIn:nameIn: aNamespace Answer Smalltalk code compiling to the receiver when the currentnamespace is aNamespace printOn:in: printOn: aStream in: aNamespace Print on aStream some Smalltalk code compiling to the receiverwhen the current namespace is aNamespace storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver RunArray RunArray Defined in namespace SmalltalkSuperclass: OrderedCollectionCategory: Collections-Sequenceable My instances are OrderedCollections that automaticallyapply Run Length Encoding compression to the things they store. Be carefulwhen using me: I can provide great space savings, but my instances don'tgrant linear access time. RunArray's behavior currently is similar to thatof OrderedCollection (you can add elements to RunArrays); maybe it shouldbehave like an ArrayedCollection. RunArray class: instance creation newnew Answer an empty RunArray new: new: aSize Answer a RunArray with space for aSize runs RunArray: accessing at:at: anIndex Answer the element at index anIndex at:put: at: anIndex put: anObject Replace the element at index anIndex with anObject and answer anObject RunArray: adding add:afterIndex:add: anObject afterIndex: anIndex Add anObject after the element at index anIndex addAll:afterIndex: do: addAll: aCollection afterIndex: anIndex Add all the elements of aCollection after the one at index anIndex. IfaCollection is unordered, its elements could be added in an order which isnot the #do: order addAllFirst: do: addAllFirst: aCollection Add all the elements of aCollection at the beginning of the receiver. IfaCollection is unordered, its elements could be added in an order which isnot the #do: order addAllLast: do: addAllLast: aCollection Add all the elements of aCollection at the end of the receiver. If aCol-lection is unordered, its elements could be added in an order which is notthe #do: order addFirst: addFirst: anObject Add anObject at the beginning of the receiver. Watch out: this operationcan cause serious performance pitfalls addLast: addLast: anObject Add anObject at the end of the receiver RunArray: basic firstfirst Answer the first element in the receiver last last Answer the last element of the receiver size size Answer the number of elements in the receiver RunArray: copying deepCopy copydeepCopy Answer a copy of the receiver containing copies of the receiver's elements(#copy is used to obtain them) shallowCopy shallowCopy Answer a copy of the receiver. The elements are not copied RunArray: enumerating do:do: aBlock Enumerate all the objects in the receiver, passing each one to aBlock objectsAndRunLengthsDo: objectsAndRunLengthsDo: aBlock Enumerate all the runs in the receiver, passing to aBlock two parametersfor every run: the first is the repeated object, the second is the numberof copies RunArray: removing removeAtIndex:removeAtIndex: anIndex Remove the object at index anIndex from the receiver and answer theremoved object removeFirst removeFirst Remove the first object from the receiver and answer the removed object removeLast removeLast Remove the last object from the receiver and answer the removed object RunArray: searching indexOf:startingAt:ifAbsent:indexOf: anObject startingAt: anIndex ifAbsent: aBlock Answer the index of the first copy of anObject in the receiver, startingthe search at the element at index anIndex. If no equal object is found,answer the result of evaluating aBlock RunArray: testing == anObject Answer true if the receiver is equal to anObject hash hash Answer an hash value for the receiver ScaledDecimal ScaledDecimal Defined in namespace SmalltalkSuperclass: NumberCategory: Language-Data types ScaledDecimal provides a numeric representation of fixed point decimalnumbers able to accurately represent decimal fractions. It supportsunbounded precision, with no limit to the number of digits before andafter the decimal point. ScaledDecimal class: constants initializeinitialize Initialize the receiver's class variables ScaledDecimal class: instance creation newFromNumber:scale:newFromNumber: aNumber scale: scale Answer a new instance of ScaledDecimal, representing a decimalfraction with a decimal representation considered valid up to thescale-th digit. ScaledDecimal: arithmetic ** aNumber Multiply two numbers and answer the result. + + aNumber Sum two numbers and answer the result. - - aNumber Subtract aNumber from the receiver and answer the result. / / aNumber Divide two numbers and answer the result. // // aNumber Answer the integer quotient after dividing the receiver by aNumberwith truncation towards negative infinity. \\ \\ aNumber Answer the remainder after integer division the receiver by aNumberwith truncation towards negative infinity. ScaledDecimal: coercion asFloatDasFloatD Answer the receiver, converted to a FloatD asFloatE asFloatE Answer the receiver, converted to a FloatE asFloatQ asFloatQ Answer the receiver, converted to a FloatQ asFraction asFraction Answer the receiver, converted to a Fraction ceiling ceiling Answer the receiver, converted to an Integer and truncated towards+infinity. coerce: coerce: aNumber Answer aNumber, converted to a ScaledDecimal with the same scaleas the receiver. fractionPart fractionPart Answer the fractional part of the receiver. generality generality Return the receiver's generality integerPart integerPart Answer the fractional part of the receiver. truncated truncated Answer the receiver, converted to an Integer and truncated towards-infinity. ScaledDecimal: comparing << aNumber Answer whether the receiver is less than arg. <= <= aNumber Answer whether the receiver is less than or equal to arg. = = arg Answer whether the receiver is equal to arg. > > aNumber Answer whether the receiver is greater than arg. >= >= aNumber Answer whether the receiver is greater than or equal to arg. hash hash Answer an hash value for the receiver. ~= ~= arg Answer whether the receiver is not equal arg. ScaledDecimal: constants oneone Answer the receiver's representation of one. zero zero Answer the receiver's representation of zero. ScaledDecimal: printing displayOn: printStringdisplayOn: aStream Print a representation of the receiver on aStream, intended tobe directed to a user. In this particular case, the `scale'part of the #printString is not emitted. printOn: printOn: aStream Print a representation of the receiver on aStream. ScaledDecimal: storing storeOn:storeOn: aStream Print Smalltalk code that compiles to the receiver on aStream. SecurityPolicy SecurityPolicy Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Security I am the class that represents which operations that could harmthe system's security are allowed or denied to a particular class. Ifa class does not have a policy, it is allowed everything if it is trusted,and denied everything if it is untrusted SecurityPolicy: modifying addPermission:addPermission: aPermission Not commented. owner: owner: aClass Not commented. removePermission: removePermission: aPermission Not commented. withOwner: withOwner: aClass Not commented. SecurityPolicy: querying check:check: aPermission Not commented. implies: implies: aPermission Not commented. Semaphore 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 also provide some methods for implementing critical sections. Semaphore class: instance creation forMutualExclusionforMutualExclusion Answer a new semaphore with a signal on it. These semaphores are a usefulshortcut when you use semaphores as critical sections. new new Answer a new semaphore Semaphore: accessing namename Answer a user-friendly name for the receiver name: name: aString Answer a user-friendly name for the receiver waitingProcesses waitingProcesses Answer an Array of processes currently waiting on the receiver. wouldBlock wouldBlock Answer whether waiting on the receiver would suspend the current process. Semaphore: builtins locklock Without putting the receiver to sleep, force processes that try to waiton the semaphore to block. Answer whether this was the case even before. notify "synchronization" notifyResume one of the processes that were waiting on the semaphore ifthere were any. Do not leave a signal on the semaphore if noprocess is waiting. notifyAll notifyAll Resume all the processes that were waiting on the semaphore if therewere any. Do not leave a signal on the semaphore if no process iswaiting. signal signal Signal the receiver, resuming a waiting process' if there is one wait wait Wait for the receiver to be signalled, suspending the executing processif it is not yet waitAfterSignalling: notify notifyAllare waitAfterSignalling: aSemaphore Signal aSemaphore then, atomically, wait for the receiver to besignalled, suspending the executing process if it is not yet. Thisis needed to avoid race conditions when the #notify and #notifyAllare used before waiting on receiver: otherwise, if a process sendsany of the two between the time aSemaphore is signaled and the timethe process starts waiting on the receiver, the notification is lost. Semaphore: mutual exclusion critical:critical: aBlock Wait for the receiver to be free, execute aBlock and signal the receiveragain. Return the result of evaluating aBlock. Semaphore: printing printOn:printOn: aStream Print a human-readable represention of the receiver on aStream. SequenceableCollection SequenceableCollection Defined in namespace SmalltalkSuperclass: CollectionCategory: Collections-Sequenceable My instances represent collections of objects that are ordered. I providesome access and manipulation methods. SequenceableCollection class: instance creation streamContents:streamContents: aBlock Create a ReadWriteStream on an empty instance of the receiver;pass the stream to aBlock, then retrieve its contents andanswer them. SequenceableCollection: basic after:after: oldObject Return the element after oldObject. Error if oldObject not found orif no following object is available at:ifAbsent: at: anIndex ifAbsent: aBlock Answer the anIndex-th item of the collection, or evaluate aBlockand answer the result if the index is out of range atAll:put: atAll: aCollection put: anObject Put anObject at every index contained in aCollection atAllPut: atAllPut: anObject Put anObject at every index in the receiver before: before: oldObject Return the element before oldObject. Error if oldObject not found orif no preceding object is available first first Answer the first item in the receiver fourth fourth Answer the fourth item in the receiver identityIncludes: identityIncludes: anObject Answer whether we include the anObject object identityIndexOf: identityIndexOf: anElement Answer the index of the first occurrence of an object identical toanElement in the receiver. Answer 0 if no item is found identityIndexOf:ifAbsent: identityIndexOf: anElement ifAbsent: exceptionBlock Answer the index of the first occurrence of an object identical toanElement in the receiver. Invoke exceptionBlock and answer itsresult if no item is found identityIndexOf:startingAt: identityIndexOf: anElement startingAt: anIndex Answer the first index > anIndex which contains an object identicalto anElement. Answer 0 if no item is found identityIndexOf:startingAt:ifAbsent: identityIndexOf: anObject startingAt: anIndex ifAbsent: exceptionBlock Answer the first index > anIndex which contains an object exactlyidentical to anObject.Invoke exceptionBlock and answer its result if no item is found includes: includes: anObject Answer whether we include anObject indexOf: indexOf: anElement Answer the index of the first occurrence of anElement in the receiver.Answer 0 if no item is found indexOf:ifAbsent: indexOf: anElement ifAbsent: exceptionBlock Answer the index of the first occurrence of anElement in the receiver.Invoke exceptionBlock and answer its result if no item is found indexOf:startingAt: indexOf: anElement startingAt: anIndex Answer the first index > anIndex which contains anElement.Answer 0 if no item is found indexOf:startingAt:ifAbsent: indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlock Answer the first index > anIndex which contains anElement.Invoke exceptionBlock and answer its result if no item is found indexOfSubCollection: indexOfSubCollection: aSubCollection Answer the first index > anIndex at which starts a sequence ofitems matching aSubCollection. Answer 0 if no such sequence is found. indexOfSubCollection:ifAbsent: indexOfSubCollection: aSubCollection ifAbsent: exceptionBlock Answer the first index > anIndex at which starts a sequence ofitems matching aSubCollection. Answer 0 if no such sequence is found. indexOfSubCollection:startingAt: indexOfSubCollection: aSubCollection startingAt: anIndex Answer the first index > anIndex at which starts a sequence ofitems matching aSubCollection. Answer 0 if no such sequence is found. indexOfSubCollection:startingAt:ifAbsent: indexOfSubCollection: aSubCollection startingAt: anIndex ifAbsent: exceptionBlock Answer the first index > anIndex at which starts a sequence ofitems matching aSubCollection.Invoke exceptionBlock and answer its result if no such sequence is found last last Answer the last item in the receiver second second Answer the second item in the receiver third third Answer the third item in the receiver SequenceableCollection: copying SequenceableCollections , add:, aSequenceableCollection Append aSequenceableCollection at the end of the receiver (using #add:),and answer a new collection copyFrom: copyFrom: start Answer a new collection containing all the items in the receiver from thestart-th. copyFrom:to: copyFrom: start to: stop Answer a new collection containing all the items in the receiver from thestart-th and to the stop-th copyReplaceAll:with: copyReplaceAll: oldSubCollection with: newSubCollection Answer a new collection in which all the sequences matchingoldSubCollection are replaced with newSubCollection copyReplaceFrom:to:with: copyReplaceFrom: start to: stop with: replacementCollection Answer 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 thereplacementCollection. Instead, If start = (stop + 1), like in`copyReplaceFrom: 4 to: 3 with: anArray', then every element of the receiverwill be present in the answered copy; the operation will be an append ifstop is equal to the size of the receiver or, if it is not, an insert beforeindex `start'. copyReplaceFrom:to:withObject: copyReplaceFrom: start to: stop withObject: anObject Answer 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 receiverwill be present in the answered copy; the operation will be an append ifstop is equal to the size of the receiver or, if it is not, an insert beforeindex `start'. copyUpTo: copyUpTo: anObject Answer a new collection holding all the elements of the receiverfrom the first up to the first occurrence of anObject, excluded. SequenceableCollection: enumerating anyOneanyOne Answer an unspecified element of the collection. do: do: aBlock Evaluate aBlock for all the elements in the sequenceable collection do:separatedBy: do: aBlock separatedBy: sepBlock Evaluate aBlock for all the elements in the sequenceable collection.Between each element, evaluate sepBlock without parameters. doWithIndex: keysAndValuesDo: doWithIndex: aBlock Evaluate aBlock for all the elements in the sequenceable collection,passing the index of each element as the second parameter. This methodis mantained for backwards compatibility and is not mandated by theANSI standard; use #keysAndValuesDo: findFirst: findFirst: aBlock Returns the index of the first element of the sequenceable collectionfor which aBlock returns true, or 0 if none findLast: findLast: aBlock Returns the index of the last element of the sequenceable collectionfor which aBlock returns true, or 0 if none does fold: fold: binaryBlock First, pass to binaryBlock the first and second elements of thereceiver; for each subsequent element, pass the result of the previousevaluation and an element. Answer the result of the last invocation,or the first element if the collection has size 1. Fail if the collectionis empty. from:to:do: from: startIndex to: stopIndex do: aBlock Evaluate aBlock for all the elements in the sequenceable collection whoseindices are in the range index to stopIndex from:to:doWithIndex: from:to:keysAndValuesDo: from: startIndex to: stopIndex doWithIndex: aBlock Evaluate aBlock for all the elements in the sequenceable collection whoseindices are in the range index to stopIndex, passing the index of eachelement as the second parameter. This method is mantained for backwardscompatibility and is not mandated by the ANSI standard; use#from:to:keysAndValuesDo: from:to:keysAndValuesDo: from: startIndex to: stopIndex keysAndValuesDo: aBlock Evaluate aBlock for all the elements in the sequenceable collection whoseindices are in the range index to stopIndex, passing the index of eachelement as the first parameter and the element as the second. keys keys Return an Interval corresponding to the valid indices in the receiver. keysAndValuesDo: keysAndValuesDo: aBlock Evaluate aBlock for all the elements in the sequenceable collection,passing the index of each element as the first parameter and theelement as the second. readStream readStream Answer a ReadStream streaming on the receiver readWriteStream readWriteStream Answer a ReadWriteStream which streams on the receiver reverse reverse Answer the receivers' contents in reverse order reverseDo: reverseDo: aBlock Evaluate aBlock for all elements in the sequenceable collection, from thelast to the first. with:collect: with: aSequenceableCollection collect: aBlock Evaluate aBlock for each pair of elements took respectively from the re-ceiver and from aSequenceableCollection; answer a collection of the samekind of the receiver, made with the block's return values. Fail if thereceiver has not the same size as aSequenceableCollection. with:do: with: aSequenceableCollection do: aBlock Evaluate aBlock for each pair of elements took respectively from the re-ceiver and from aSequenceableCollection. Fail if the receiver has notthe same size as aSequenceableCollection. writeStream writeStream Answer a WriteStream streaming on the receiver SequenceableCollection: replacing items replaceAll:with:replaceAll: anObject with: anotherObject In the receiver, replace every occurrence of anObject with anotherObject. replaceFrom:to:with: replaceFrom: start to: stop with: replacementCollection Replace the items from start to stop with replacementCollection's itemsfrom 1 to stop-start+1 (in unexpected order if the collection is notsequenceable). replaceFrom:to:with:startingAt: replaceFrom: start to: stop with: replacementCollection startingAt: repStart Replace the items from start to stop with replacementCollection's itemsfrom repStart to repStart+stop-start replaceFrom:to:withObject: replaceFrom: anIndex to: stopIndex withObject: replacementObject Replace every item from start to stop with replacementObject. SequenceableCollection: testing == aCollection Answer whether the receiver's items match those in aCollection hash hash Answer an hash value for the receiver inspect inspect Print all the instance variables and context of the receiver on theTranscript isSequenceable at:/#at:put: isSequenceable Answer whether the receiver can be accessed by a numeric index with#at:/#at:put:. Set Set Defined in namespace SmalltalkSuperclass: HashedCollectionCategory: Collections-Unordered I am the typical set object; I also known how to do arithmeticon my instances. 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. Set: awful ST-80 compatibility hacks findObjectIndex:findObjectIndex: object Tries to see if anObject exists as an indexed variable. As soon as nilor anObject is found, the index of that slot is answered 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 SharedQueue 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 iscontrolled with critical sections so that things proceed smoothly. SharedQueue class: instance creation newnew Create a new instance of the receiver sortBlock: sortBlock: sortBlock Create a new instance of the receiver which implements apriority queue with the given sort block SharedQueue: accessing isEmptyisEmpty Answer whether there is an object on the queue next next Wait for an object to be on the queue, then remove it and answer it nextPut: nextPut: value Put value on the queue and answer it peek next peek Wait for an object to be on the queue if necessary, then answer thesame object that #next would answer without removing it. Signal Signal Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Exceptions My instances describe an exception that has happened, and are passed toexception handlers. Apart from containing information on the generatedexception and its arguments, they contain methods that allow you to resumeexecution, leave the #on:do:... snippet, and pass the exception to an handlerwith a lower priority. Signal: accessing argumentargument Answer the first argument of the receiver argumentCount argumentCount Answer how many arguments the receiver has arguments arguments Answer the arguments of the receiver basicMessageText basicMessageText Answer an exception's message text. Do not override this method. description description Answer the description of the raised exception exception exception Answer the CoreException that was raised messageText messageText Answer an exception's message text. messageText: messageText: aString Set an exception's message text. tag tag Answer an exception's tag value. If not specified, itis the same as the message text. tag: tag: anObject Set an exception's tag value. If nil, the tag value willbe the same as the message text. Signal: exception handling defaultActiondefaultAction Execute the default handler for the raised exception isNested isNested Answer whether the current exception handler is within the scope ofanother handler for the same exception. isResumable isResumable Answer whether the exception that instantiated the receiver is resumable. outer outer outer pass outer Raise the exception that instantiated the receiver, passing the sameparameters.If the receiver is resumable and the evaluated exception action resumesthen the result returned from #outer will be the resumption value of theevaluated exception action. If the receiver is not resumable or if theexception action does not resume then this message will not return, and#outer will be equivalent to #pass. pass outer pass Yield control to the enclosing exception action for the receiver.Similar to #outer, but control does not return to the currently active exceptionhandler. resignalAs: resignalAs: replacementException Reinstate all handlers and execute the handler for `replacementException';control does not return to the currently active exception handler. Thenew Signal object that is created has the same arguments as the receiver(this might or not be correct – if it isn't you can use an idiom suchas `sig retryUsing: [ replacementException signal ]) resume resume If the exception is resumable, resume the execution of the block thatraised the exception; the method that was used to signal the exceptionwill answer the receiver.Use this method IF AND ONLY IF you know who caused the exception and ifit is possible to resume it in that particular case resume: resume: anObject If the exception is resumable, resume the execution of the block thatraised the exception; the method that was used to signal the exceptionwill answer anObject.Use this method IF AND ONLY IF you know who caused the exception and ifit is possible to resume it in that particular case retry on:do: retry Re-execute the receiver of the #on:do: message. All handlers arereinstated: watch out, this can easily cause an infinite loop. retryUsing: signal retryUsing: aBlock Execute aBlock reinstating all handlers, and return its result fromthe #signal method. return on:do: return Exit the #on:do: snippet, answering nil to its caller. return: on:do: return: anObject Exit the #on:do: snippet, answering anObject to its caller. SingletonProxy SingletonProxy Defined in namespace SmalltalkSuperclass: AlternativeObjectProxyCategory: Streams-Files I am a proxy that stores the class of anobject rather than the object itself, and pretends that a registeredinstance (which most likely is a singleton instance of the stored class)was stored instead. SingletonProxy class: accessing acceptUsageForClass:acceptUsageForClass: aClass The receiver was asked to be used as a proxy for the class aClass.The registration is fine if the class is actually a singleton. SingletonProxy class: instance creation on:on: anObject Answer a proxy to be used to save anObject. The proxystores the class and restores the object by looking intoa dictionary of class -> singleton objects. SingletonProxy: saving and restoring object reconstructOriginalObject postLoadobject Reconstruct the object stored in the proxy and answer it;the binaryRepresentationObject is sent the#reconstructOriginalObject message, and the resultingobject is sent the #postLoad message. SmallInteger SmallInteger Defined in namespace SmalltalkSuperclass: IntegerCategory: Language-Data types I am the integer class of the GNU Smalltalk system. My instances canrepresent signed 30 bit integers and are as efficient as possible. SmallInteger class: getting limits bitsbits Answer the number of bits (excluding the sign) that can be representeddirectly in an object pointer largest largest Answer the largest integer represented directly in an object pointer smallest smallest Answer the smallest integer represented directly in an object pointer SmallInteger class: testing isIdentityisIdentity Answer whether x = y implies x == y for instances of the receiver SmallInteger: bit arithmetic highBithighBit Return the index of the highest order 1 bit of the receiver lowBit lowBit Return the index of the lowest order 1 bit of the receiver. 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 // // arg Dividing receiver by arg (with truncation towards -infinity) and answerthe result < < 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 truncationtowards -infinity) and answer it asFloatD asFloatD Convert the receiver to a FloatD, answer the result asFloatE asFloatE Convert the receiver to a FloatE, answer the result asFloatQ asFloatQ Convert the receiver to a FloatQ, answer the result asObject asObject Answer the object whose index is in the receiver, nil if there is a freeobject, fail if index is out of bounds asObjectNoFail asObjectNoFail Answer the object whose index is in the receiver, or nil if no object isfound at that index bitAnd: bitAnd: arg Do a bitwise AND between the receiver and arg, answer the result bitOr: bitOr: arg Do a bitwise OR between the receiver and arg, answer the result bitShift: bitShift: arg Shift the receiver by arg places to the left if arg > 0,by arg places to the right if arg < 0, answer another Number bitXor: bitXor: arg Do a bitwise XOR between the receiver and arg, answer the result nextValidOop nextValidOop Answer the index of the first non-free OOP after the receiver. This isused internally; it is placed here to avoid polluting Object. quo: quo: arg Dividing receiver by arg (with truncation towards zero) and answerthe result ~= ~= arg Answer whether the receiver is not equal to arg ~~ ~~ arg Answer whether the receiver is not the same object as arg SmallInteger: builtins at:at: anIndex Answer the index-th indexed instance variable of the receiver.This method always fails. at:put: at: anIndex put: value Store value in the index-th indexed instance variable of the receiverThis method always fails. basicAt: basicAt: anIndex Answer the index-th indexed instance variable of the receiver.This method always fails. basicAt:put: basicAt: anIndex put: value Store value in the index-th indexed instance variable of the receiverThis method always fails. scramble scramble Answer the receiver with its bits mixed and matched. SmallInteger: coercion methods generalitygenerality Return the receiver's generality unity unity Coerce 1 to the receiver's class zero zero Coerce 0 to the receiver's class SmallInteger: testing functionality isSmallIntegerisSmallInteger Answer `true'. SortedCollection SortedCollection Defined in namespace SmalltalkSuperclass: OrderedCollectionCategory: Collections-Sequenceable I am a collection of objects, stored and accessed according to somesorting criteria. I store things using heap sort and quick sort. Myinstances have a comparison block associated with them; this blocktakes two arguments and is a predicate which returns true if the firstargument should be sorted earlier than the second. The default blockis [ :a :b | a <= b ], but I will accept any block that conforms to theabove criteria – actually any object which responds to #value:value:. SortedCollection class: hacking defaultSortBlockdefaultSortBlock Answer a default sort block for the receiver. SortedCollection class: instance creation newnew Answer a new collection with a default size and sort block new: new: aSize Answer a new collection with a default sort block and the given size sortBlock: sortBlock: aSortBlock Answer a new collection with a default size and the given sort block SortedCollection: basic lastlast Answer the last item of the receiver removeLast removeLast Remove an object from the end of the receiver. Fail if the receiveris empty sortBlock sortBlock Answer the receiver's sort criteria sortBlock: sortBlock: aSortBlock Change the sort criteria for a sorted collection, resort the elements ofthe collection, and return it. SortedCollection: copying copyEmpty:copyEmpty: newSize Answer an empty copy of the receiver, with the same sort block as thereceiver SortedCollection: disabled add:afterIndex:add: anObject afterIndex: i This method should not be called for instances of this class. addAll:afterIndex: addAll: aCollection afterIndex: i This method should not be called for instances of this class. addAllFirst: addAllFirst: aCollection This method should not be called for instances of this class. addAllLast: addAllLast: aCollection This method should not be called for instances of this class. addFirst: addFirst: anObject This method should not be called for instances of this class. addLast: addLast: anObject This method should not be called for instances of this class. at:put: at: index put: anObject This method should not be called for instances of this class. SortedCollection: enumerating beConsistent do:beConsistent Prepare the receiver to be walked through with #do: or anotherenumeration method. SortedCollection: saving and loading postLoadpostLoad Restore the default sortBlock if it is nil preStore preStore Store the default sortBlock as nil SortedCollection: searching includes:includes: anObject Private - Answer whether the receiver includes an item which isequal to anObject indexOf:startingAt:ifAbsent: indexOf: anObject startingAt: index ifAbsent: aBlock Answer the first index > anIndex which contains anElement.Invoke exceptionBlock and answer its result if no item is found occurrencesOf: occurrencesOf: anObject Answer how many occurrences of anObject can be found in the receiver Stream Stream Defined in namespace SmalltalkSuperclass: ObjectCategory: Streams I am an abstract class that provides interruptable sequential access toobjects. I can return successive objects from a source, or acceptsuccessive objects and store them sequentially on a sink. I providesome simple iteration over the contents of one of my instances, andprovide for writing collections sequentially. Stream: accessing-reading contentscontents Answer the whole contents of the receiver, from the next object tothe last next next Return the next object in the receiver next: next: anInteger Return the next anInteger objects in the receiver nextAvailable: nextAvailable: anInteger Return up to anInteger objects in the receiver, stopping ifthe end of the stream is reached nextLine nextLine Returns a collection of the same type that the stream accesses, containingthe next line up to the next new-line character. Returns the entire rest of thestream's contents if no new-line character is found. nextMatchFor: nextMatchFor: anObject Answer whether the next object is equal to anObject. Even if it doesnot, anObject is lost splitAt: = splitAt: anObject Answer an OrderedCollection of parts of the receiver. A new (possiblyempty) part starts at the start of the receiver, or after everyoccurrence of an object which is equal to anObject (as compared by#=). upTo: upTo: anObject Returns a collection of the same type that the stream accesses, up tobut not including the object anObject. Returns the entire rest of thestream's contents if anObject is not present. upToAll: upToAll: aCollection If there is a sequence of objects remaining in the stream that isequal to the sequence in aCollection, set the stream position justpast that sequence and answer the elements up to, but not including,the sequence. Else, set the stream position to its end and answerall the remaining elements. upToEnd upToEnd Answer every item in the collection on which the receiver isstreaming, from the next one to the last Stream: accessing-writing next:put:next: anInteger put: anObject Write anInteger copies of anObject to the receiver next:putAll:startingAt: next: n putAll: aCollection startingAt: start Write n objects to the stream, reading them from aCollectionand starting at the start-th item. nextPut: nextPut: anObject Write anObject to the receiver nextPutAll: nextPutAll: aCollection Write all the objects in aCollection to the receiver Stream: basic speciesspecies Answer `Array'. Stream: built ins fileInfileIn File in the contents of the receiver.During a file in operation, global variables (starting with anuppercase letter) that are not declared 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 a namespace (for example by creatinga class) the Association will be removed from Undeclared and reusedin the namespace, so that the old references will automagically pointto the new value. fileInLine:fileName:at: line fileInLine: lineNum fileName: aString at: charPosInt Private - Much like a preprocessor #line directive; it is usedby the Emacs Smalltalk mode. Stream: character writing crcr Store a cr on the receiver crTab crTab Store a cr and a tab on the receiver isUnicode isUnicode Answer whether the receiver is able to store Unicode characters.Note that if this method returns true, the stream may or may notbe able to store Characters (as opposed to UnicodeCharacters)whose value is above 127. nl nl Store a new line on the receiver nlTab nlTab Store a new line and a tab on the receiver space space Store a space on the receiver space: space: n Store n spaces on the receiver tab tab Store a tab on the receiver tab: tab: n Store n tabs on the receiver Stream: enumerating do:do: aBlock Evaluate aBlock once for every object in the receiver linesDo: linesDo: aBlock Evaluate aBlock once for every line in the receiver (assuming thereceiver is streaming on Characters). Stream: filing out fileOut:fileOut: aClass File out aClass on the receiver. If aClass is not a metaclass, file outclass and instance methods; if aClass is a metaclass, file out only theclass methods Stream: filtering ,, aStream Answer a new stream that concatenates the data in the receiver with thedata in aStream. Both the receiver and aStream should be readable. collect: collect: aBlock Answer a new stream that will pass the returned objects through aBlock,and return whatever object is returned by aBlock instead. Note that whenpeeking in the returned stream, the block will be invoked multiple times,with possibly surprising results. fold: fold: aBlock First, pass to binaryBlock the first and second elements of thereceiver; for each subsequent element, pass the result of the previousevaluation and an element. Answer the result of the last invocation,or the first element if the stream has a single element. inject:into: inject: value into: aBlock First, pass to binaryBlock value and the first element of thereceiver; for each subsequent element, pass the result of the previousevaluation and an element. Answer the result of the last invocation,or value if the stream is empty. lines lines Answer a new stream that answers lines from the receiver. peek peek Returns the next element of the stream without moving the pointer.Returns nil when at end of stream. Lookahead is implemented automaticallyfor streams that are not positionable but can be copied. peekFor: peekFor: aCharacter Returns true and gobbles the next element from the stream of it isequal to anObject, returns false and doesn't gobble the next elementif the next element is not equal to anObject. Lookahead is implementedautomatically for streams that are not positionable but can be copied. reject: reject: aBlock Answer a new stream that only returns those objects for which aBlockreturns false. Note that the returned stream will not be positionable. select: select: aBlock Answer a new stream that only returns those objects for which aBlockreturns true. Note that the returned stream will not be positionable. Stream: polymorphism closeclose Do nothing. This is provided for consistency with file streams flush flush Do nothing. This is provided for consistency with file streams pastEnd pastEnd The end of the stream has been reached. Signal a Notification. Stream: positioning isPositionable skip:isPositionable Answer true if the stream supports moving backwards with #skip:. nextHunk nextHunk Answer a more-or-less arbitrary amount of data. When used on files, thisdoes at most one I/O operation. For other kinds of stream, the definitionmay vary. This method is used by the VM when loading data from a Smalltalkstream, and by various kind of Stream decorators supplied with GNUSmalltalk (including zlib streams). skip: skip: anInteger Move the position forwards by anInteger places skipTo: skipTo: anObject Move the current position to after the next occurrence of anObjectand return true if anObject was found. If anObject doesn't exist, thepointer is atEnd, and false is returned. skipToAll: skipToAll: aCollection If there is a sequence of objects remaining in the stream that isequal to the sequence in aCollection, set the stream position justpast that sequence and answer true. Else, set the stream positionto its end and answer false. Stream: printing << display:<< anObject This method is a short-cut for #display:; it prints anObject on thereceiver by sending displayOn: to anObject. This method is providedso that you can use cascading and obtain better-looking code display: display: anObject Print anObject on the receiver by sending displayOn: to anObject. Thismethod is provided so that you can use cascading and obtainbetter-looking code print: print: anObject Print anObject on the receiver by sending printOn: to anObject. Thismethod is provided so that you can use cascading and obtainbetter-looking code Stream: storing store:store: anObject Print Smalltalk code compiling to anObject on the receiver, by sendingstoreOn: to anObject. This method is provided so that you can usecascading and obtain better-looking code Stream: testing atEndatEnd Answer whether the stream has got to an end isExternalStream isExternalStream Answer whether the receiver streams on a file or socket.By default, answer false. isSequenceable at:/#at:put: isSequenceable Answer whether the receiver can be accessed by a numeric index with#at:/#at:put:. readStream readStream As a wild guess, return the receiver. WriteStreams should overridethis method. String String Defined in namespace SmalltalkSuperclass: CharacterArrayCategory: Collections-Text My instances represent 8-bit character strings. Being a very commoncase, they are particularly optimized.Note that, if you care about multilingualization, you should treatString only as an encoded representation of a UnicodeString. The I18Npackage adds more Unicode-friendliness to the system so that encodingand decoding is performed automatically in more cases. In that case,String represents a case when the encoding is either unknown, irrelevant,or assumed to be the system default. String class: instance creation fromCData:fromCData: aCObject Answer a String containing the bytes starting at the location pointedto by aCObject, up to the first NUL character. fromCData:size: fromCData: aCObject size: anInteger Answer a String containing anInteger bytes starting at the location pointedto by aCObject String: accessing byteAt:byteAt: index Answer the ascii value of index-th character variable of the receiver byteAt:put: byteAt: index put: value Store (Character value: value) in the index-th indexed instance variableof the receiver String: basic ,, aString Answer a new instance of an ArrayedCollection containing all the elementsin the receiver, followed by all the elements in aSequenceableCollection = = aString Answer whether the receiver's items match those in aCollection String: built ins asCData:asCData: aCType Convert the receiver to a CObject with the given type at: at: anIndex Answer the index-th indexed instance variable of the receiver at:put: at: anIndex put: value Store value in the index-th indexed instance variable of the receiver basicAt: basicAt: anIndex Answer the index-th indexed instance variable of the receiver.This method must not be overridden, override at: instead basicAt:put: basicAt: anIndex put: value Store value in the index-th indexed instance variable of the receiverThis method must not be overridden, override at:put: instead hash hash Answer an hash value for the receiver primReplaceFrom:to:with:startingAt: primReplaceFrom: start to: stop with: replacementString startingAt: replaceStartPrivate - Replace the characters from start to stop with newcharacters contained in replacementString (which, actually, can beany variable byte class, starting at the replaceStart location ofreplacementString replaceFrom:to:with:startingAt: replaceFrom: start to: stop with: aString startingAt: replaceStart Replace the characters from start to stop with new characters whoseASCII codes are contained in aString, starting at the replaceStartlocation of aString replaceFrom:to:withByteArray:startingAt: replaceFrom: start to: stop withByteArray: byteArray startingAt: replaceStart Replace the characters from start to stop with new characters whoseASCII codes are contained in byteArray, starting at the replaceStartlocation of byteArray similarityTo: similarityTo: aString Answer a number that denotes the similarity between aString andthe receiver. 0 indicates equality, negative numbers indicatesome difference. Implemented as a primitive for speed. size size Answer the size of the receiver String: C call-outs lengthOfRegexMatch:from:to:lengthOfRegexMatch: pattern from: from to: to Not commented. searchRegexInternal:from:to: searchRegexInternal: pattern from: from to: to Not commented. String: converting asByteArrayasByteArray Return the receiver, converted to a ByteArray of ASCII values asString asString But I already am a String! Really! asSymbol asSymbol Returns the symbol corresponding to the receiver encoding encoding Answer the encoding of the receiver. This is not implemented unlessyou load the Iconv package. String: printing displayOn: printOn:displayOn: aStream Print a representation of the receiver on aStream. Unlike#printOn:, this method strips extra quotes. displayString printString displayString Answer a String representing the receiver. For most objectsthis is simply its #printString, but for CharacterArrays and characters,superfluous dollars or extra pair of quotes are stripped. printOn: printOn: aStream Print a representation of the receiver on aStream storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver on aStream String: regex =~=~ pattern Answer a RegexResults object for matching the receiver againstthe Regex or String object pattern. asRegex asRegex Answer the receiver, converted to a Regex object. copyFrom:to:replacingAllRegex:with: bindWithArguments: copyFrom: from to: to replacingAllRegex: pattern with: str Returns the substring of the receiver between from and to.Any match of pattern in that part of the string is replaced withstr after substituting %n sequences with the captured subexpressionsof the match (as in #bindWithArguments:). copyFrom:to:replacingRegex:with: bindWithArguments: copyFrom: from to: to replacingRegex: pattern with: str Returns the substring of the receiver between from and to.If pattern has a match in that part of the string, the matchis replaced with str after substituting %n sequences with thecaptured subexpressions of the match (as in #bindWithArguments:). copyReplacingAllRegex:with: bindWithArguments: copyReplacingAllRegex: pattern with: str Returns the receiver after replacing all the matches of pattern (ifany) with str. %n sequences present in str are substituted with thecaptured subexpressions of the match (as in #bindWithArguments:). copyReplacingRegex:with: bindWithArguments: copyReplacingRegex: pattern with: str Returns the receiver after replacing the first match of pattern (ifany) with str. %n sequences present in str are substituted with thecaptured subexpressions of the match (as in #bindWithArguments:). indexOfRegex: indexOfRegex: regexString If an occurrence of the regex is present in the receiver, return theInterval corresponding to the leftmost-longest match. Otherwise returnnil. indexOfRegex:from:to: indexOfRegex: regexString from: from to: to If an occurrence of the regex is present in the receiver, return theInterval corresponding to the leftmost-longest match occurring withinthe given range of indices. Otherwise return nil. indexOfRegex:from:to:ifAbsent: indexOfRegex: regexString from: from to: to ifAbsent: excBlock If an occurrence of the regex is present in the receiver, return theInterval corresponding to the leftmost-longest match occurring withinthe given indices. Otherwise, evaluate excBlock and return the result. indexOfRegex:ifAbsent: indexOfRegex: regexString ifAbsent: excBlock If an occurrence of the regex is present in the receiver, returnthe Interval corresponding to the leftmost-longest match. Otherwise,evaluate excBlock and return the result. indexOfRegex:startingAt: indexOfRegex: regexString startingAt: index If an occurrence of the regex is present in the receiver, return theInterval corresponding to the leftmost-longest match starting afterthe given index. Otherwise return nil. indexOfRegex:startingAt:ifAbsent: indexOfRegex: regexString startingAt: index ifAbsent: excBlock If an occurrence of the regex is present in the receiver, returnthe Interval corresponding to the leftmost-longest match starting afterthe given index. Otherwise, evaluate excBlock and return the result. matchRegex: matchRegex: pattern Answer whether the receiver is an exact match for the pattern.This means that the pattern is implicitly anchored at the beginningand the end. matchRegex:from:to: matchRegex: pattern from: from to: to Answer whether the given range of indices is an exact match for thepattern. This means that there is a match starting at from and endingat to (which is not necessarily the longest match starting at from). occurrencesOfRegex: occurrencesOfRegex: pattern Returns count of how many times pattern repeats in the receiver. occurrencesOfRegex:from:to: occurrencesOfRegex: pattern from: from to: to Return a count of how many times pattern repeats in the receiver withinthe given range of index. occurrencesOfRegex:startingAt: occurrencesOfRegex: pattern startingAt: index Returns count of how many times pattern repeats in the receiver, startingthe search at the given index. onOccurrencesOfRegex:do: onOccurrencesOfRegex: pattern do: body Find all the matches of pattern within the receiver and, for each match,pass the RegexResults object to aBlock. onOccurrencesOfRegex:from:to:do: onOccurrencesOfRegex: pattern from: from to: to do: aBlock Find all the matches of pattern within the receiver and within thegiven range of indices. For each match, pass the RegexResults objectto aBlock. searchRegex: =~ searchRegex: pattern A synonym for #=~. Answer a RegexResults object for matching the receiveragainst the Regex or String object pattern. searchRegex:from:to: searchRegex: pattern from: from to: to Answer a RegexResults object for matching the receiveragainst the Regex or String object pattern, restricting the matchto the specified range of indices. searchRegex:startingAt: searchRegex: pattern startingAt: anIndex Answer a RegexResults object for matching the receiveragainst the Regex or String object pattern, starting the matchat index anIndex. tokenize: tokenize: pattern Split the receiver at every occurrence of pattern. All parts that do notmatch pattern are separated and stored into an Array of Strings that isreturned. tokenize:from:to: tokenize: pattern from: from to: to Split the receiver at every occurrence of pattern (considering onlythe indices between from and to). All parts that do not match patternare separated and stored into an Array of Strings that is returned. ~ ~ pattern Answer whether the receiver matched against the Regex or Stringobject pattern. String: testing functionality isStringisString Answer `true'. String: useful functionality linesDo:linesDo: aBlock Send 'aBlock' a substring of the receiver for each newline delimitedline in the receiver Symbol Symbol Defined in namespace SmalltalkSuperclass: StringCategory: Language-Implementation My instances are unique throughout the Smalltalk system. My instancesbehave for the most part like strings, except that they print differently,and I guarantee that any two instances that have the same printedrepresentation are in fact the same instance. Symbol class: built ins intern:intern: aString Private - Same as 'aString asSymbol' Symbol class: instance creation internCharacter:internCharacter: aCharacter Answer the one-character symbol associated to the given character. new new This method should not be called for instances of this class. new: new: size This method should not be called for instances of this class. with: with: element1 Answer a collection whose only element is element1 with:with: with: element1 with: element2 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with: with: element1 with: element2 with: element3 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with: with: element1 with: element2 with: element3 with: element4 Answer a collection whose only elements are the parameters in the orderthey were passed with:with:with:with:with: with: element1 with: element2 with: element3 with: element4 with: element5 Answer a collection whose only elements are the parameters in the orderthey were passed Symbol class: symbol table hasInterned:ifTrue: hashhasInterned: aString ifTrue: aBlock If aString has not been interned yet, answer false. Else, pass theinterned version to aBlock and answer true. Note that this works becauseString>>#hash calculates the same hash value used by the VM when interningstrings into the SymbolTable. Changing one of the hashing methods withoutchanging the other will break this method. isSymbolString: hash isSymbolString: aString Answer whether aString has already been interned. Note that this worksbecause String>>#hash calculates the same hash value used by the VMwhen interning strings into the SymbolTable. Changing one of thehashing methods without changing the other will break this method. rebuildTable hashcalculates rebuildTable Rebuild the SymbolTable, thereby garbage-collecting unreferencedSymbols. While this process is done, preemption is disabledbecause it is not acceptable to leave the SymbolTable in apartially updated state. Note that this works because String>>#hashcalculates the same hash value used by the VM when interning stringsinto the SymbolTable. Changing one of the hashing methods withoutchanging the other will break this method. Symbol: basic deepCopydeepCopy Returns a deep copy of the receiver. As Symbols are identity objects, weactually return the receiver itself. keywords + not printOn: ifTrue:ifFalse: keywords Answer an array of keywords that compose the receiver, which is supposedto be a valid message name (#+, #not, #printOn:, #ifTrue:ifFalse:, etc.) numArgs + not printOn: ifTrue:ifFalse: numArgs Answer the number of arguments supported by the receiver, which is supposedto be a valid message name (#+, #not, #printOn:, #ifTrue:ifFalse:, etc.) shallowCopy shallowCopy Returns a deep copy of the receiver. As Symbols are identity objects, weactually return the receiver itself. Symbol: built ins == aSymbol Answer whether the receiver and aSymbol are the same object hash hash Answer an hash value for the receiver. Symbols are optimizedfor speed Symbol: converting asStringasString Answer a String with the same characters as the receiver asSymbol asSymbol But we are already a Symbol, and furthermore, Symbols are identity objects!So answer the receiver. Symbol: misc speciesspecies Answer `String'. Symbol: storing displayOn: printOn:displayOn: aStream Print a represention of the receiver on aStream. For most objectsthis is simply its #printOn: representation, but for strings andcharacters, superfluous dollars or extra pairs of quotes are stripped. displayString printString displayString Answer a String representing the receiver. For most objectsthis is simply its #printString, but for strings and characters,superfluous dollars or extra pair of quotes are stripped. printOn: printOn: aStream Print a represention of the receiver on aStream. storeOn: storeOn: aStream Print Smalltalk code on aStream that compilesto the same symbol as the receiver. Symbol: testing isSimpleSymbolisSimpleSymbol Answer whether the receiver must be represented in quoted-string(e.g. #'abc-def') form. Symbol: testing functionality isStringisString Answer `false'. isSymbol isSymbol Answer `true'. SymLink SymLink Defined in namespace SmalltalkSuperclass: LinkCategory: Language-Implementation I am used to implement the Smalltalk symbol table. My instances arelinks that contain symbols, and the symbol table basically a hash table thatpoints to chains of my instances. SymLink class: instance creation symbol:nextLink:symbol: aSymbol nextLink: aSymLink Answer a new SymLink, which refers to aSymbol and points toaSymLink as the next SymLink in the chain. SymLink: accessing symbolsymbol Answer the Symbol that the receiver refers to in the symbol table. symbol: symbol: aSymbol Set the Symbol that the receiver refers to in the symbol table. SymLink: iteration do:do: aBlock Evaluate aBlock for each symbol in the list SymLink: printing printOn:printOn: aStream Print a representation of the receiver on aStream. SystemDictionary SystemDictionary Defined in namespace SmalltalkSuperclass: RootNamespaceCategory: Language-Implementation I am a special namespace. I only have one instance, called "Smalltalk",which is known to the Smalltalk interpreter. I defineseveral methods that are "system" related, such as #quitPrimitive.My instance also helps keep track of dependencies between objects. SystemDictionary: basic halthalt Interrupt interpreter hash hash Smalltalk usually contains a reference to itself, avoid infiniteloops SystemDictionary: builtins basicBacktracebasicBacktrace Prints the method invocation stack backtrace, as an aid to debugging byteCodeCounter byteCodeCounter Answer the number of bytecodes executed by the VM debug 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 thinkthe bug happens. declarationTrace declarationTrace Answer whether compiled bytecodes are printed on stdout declarationTrace: declarationTrace: aBoolean Set whether compiled bytecodes are printed on stdout executionTrace "========================================================================== TheseNot commented. executionTrace: executionTrace: aBoolean Set whether executed bytecodes are printed on stdout getTraceFlag: getTraceFlag: anIndex Private - Returns a boolean value which is one of the interpreter'stracing flags setTraceFlag:to: setTraceFlag: anIndex to: aBoolean Private - Sets the value of one of the interpreter's tracing flags(indicated by 'anIndex') to the value aBoolean. verboseTrace verboseTrace Answer whether execution tracing prints the object on the stack top verboseTrace: verboseTrace: aBoolean Set whether execution tracing prints the object on the stack top SystemDictionary: c call-outs getArgcgetArgc Not commented. getArgv: getArgv: index Not commented. getenv: getenv: aString Not commented. putenv: putenv: aString Not commented. system: system: aString Not commented. SystemDictionary: command-line arguments:do: arguments:do:ifError:arguments: pattern do: actionBlock Parse the command-line arguments according to the syntax specified inpattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. Forfile names (or in general, other command-line arguments than options) theblock's first argument will be nil. For options without arguments, or withunspecified optional arguments, the block's second argument will be nil.The option name will be passed 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 syntaxof pattern, see #arguments:do:ifError:. arguments:do:ifError: arguments: pattern do: actionBlock ifError: errorBlock Parse the command-line arguments according to the syntax specified inpattern. For every command-line option found, the two-argument blockactionBlock is evaluated passing the option name and the argument. Forfile names (or in general, other command-line arguments than options) theblock's first argument will be nil. For options without arguments, or withunspecified optional arguments, the block's second argument will be nil.The option name will be passed 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 the returned 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' orlong names like `–long') can be specified. Before passing the option toactionBlock, 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 longeroption.Mandatory arguments can appear in the next argument, or in the same argument(separated by an = for arguments to long options). Optional arguments mustappear in the same argument. SystemDictionary: miscellaneous argumentsarguments Return the command line arguments after the -a switch backtrace backtrace Print a backtrace on the Transcript. hostSystem hostSystem Answer the triplet corresponding to the system for which GNUSmalltalk was built. SystemDictionary: printing nameIn:nameIn: aNamespace Answer `'Smalltalk”. printOn:in: printOn: aStream in: aNamespace Store Smalltalk code compiling to the receiver storeOn: storeOn: aStream Store Smalltalk code compiling to the receiver SystemDictionary: special accessing addFeature:addFeature: aFeature Add the aFeature feature to the Features set hasFeatures: hasFeatures: features Returns true if the feature or features in 'features' is one of theimplementation dependent features present removeFeature: removeFeature: aFeature Remove the aFeature feature to the Features set version version Answer the current version of the GNU Smalltalk environment SystemDictionary: testing isSmalltalkisSmalltalk Answer `true'. SystemExceptions.AlreadyDefined 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) thatis already defined. SystemExceptions.AlreadyDefined: accessing descriptiondescription Answer a description for the error SystemExceptions.ArgumentOutOfRange SystemExceptions.ArgumentOutOfRange Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions I am raised when one invokes a method with an argument outside of itsvalid range. SystemExceptions.ArgumentOutOfRange class: signaling signalOn:mustBeBetween:and:signalOn: value mustBeBetween: low and: high Raise the exception. The given value was not between low and high. SystemExceptions.ArgumentOutOfRange: accessing descriptiondescription Answer a textual description of the exception. high high Answer the highest value that was permitted. high: high: aMagnitude Set the highest value that was permitted. low low Answer the lowest value that was permitted. low: low: aMagnitude Set the lowest value that was permitted. SystemExceptions.BadReturn SystemExceptions.BadReturn Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am raised when one tries to return from an already-terminated method. SystemExceptions.BadReturn: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.CInterfaceError 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. SystemExceptions.CInterfaceError: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.EmptyCollection SystemExceptions.EmptyCollection Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am raised when one invokes a method on an empty collection. SystemExceptions.EmptyCollection: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.EndOfStream SystemExceptions.EndOfStream Defined in namespace Smalltalk.SystemExceptionsSuperclass: NotificationCategory: Language-Exceptions I am raised when a stream reaches its end. SystemExceptions.EndOfStream class: signaling signalOn:signalOn: stream Answer an exception reporting the parameter has reached its end. SystemExceptions.EndOfStream: accessing descriptiondescription Answer a textual description of the exception. stream stream Answer the stream whose end was reached. stream: stream: anObject Set the stream whose end was reached. SystemExceptions.FileError 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. SystemExceptions.FileError: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.IndexOutOfRange 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. SystemExceptions.IndexOutOfRange class: signaling signalOn:withIndex:signalOn: aCollection withIndex: value The given index was out of range in aCollection. SystemExceptions.IndexOutOfRange: accessing collectioncollection Answer the collection that triggered the error collection: collection: anObject Set the collection that triggered the error description description Answer a textual description of the exception. messageText messageText Answer an exception's message text. SystemExceptions.InvalidArgument SystemExceptions.InvalidArgument Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am raised when one invokes a method with an invalid argument. SystemExceptions.InvalidArgument: accessing messageTextmessageText Answer an exception's message text. SystemExceptions.InvalidProcessState SystemExceptions.InvalidProcessState Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am an error raised when trying to resume a terminated process, orstuff like that. SystemExceptions.InvalidProcessState: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.InvalidSize SystemExceptions.InvalidSize Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions I am raised when an argument has an invalid size. SystemExceptions.InvalidSize: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.InvalidValue SystemExceptions.InvalidValue Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions I am raised when one invokes a method with an invalid receiver or argument. SystemExceptions.InvalidValue class: signaling signalOn:signalOn: value Answer an exception reporting the parameter as invalid. signalOn:reason: signalOn: value reason: reason Answer an exception reporting `value' as invalid, for the givenreason. SystemExceptions.InvalidValue: accessing descriptiondescription Answer a textual description of the exception. messageText messageText Answer an exception's message text. value value Answer the object that was found to be invalid. value: value: anObject Set the object that was found to be invalid. SystemExceptions.MustBeBoolean SystemExceptions.MustBeBoolean Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.WrongClassCategory: Language-Exceptions I am raised when one invokes a boolean method on a non-boolean. SystemExceptions.MustBeBoolean class: signaling signalOn:signalOn: anObject Not commented. SystemExceptions.MutationError SystemExceptions.MutationError Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions I am an error raised when a class is mutated in an invalid way. SystemExceptions.MutationError: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.NoRunnableProcess SystemExceptions.NoRunnableProcess Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am raised when no runnable process can be found in the image. SystemExceptions.NoRunnableProcess: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.NotEnoughElements SystemExceptions.NotEnoughElements Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions I am raised when one invokes #next: but not enough items remain in thestream. SystemExceptions.NotEnoughElements class: signaling signalOn:signalOn: remainingCount Answer an exception reporting the parameter as invalid. SystemExceptions.NotEnoughElements: accessing descriptiondescription Answer a textual description of the exception. messageText messageText Answer an exception's message text. remainingCount remainingCount Answer the number of items that were to be read. remainingCount: remainingCount: anObject Set the number of items that were to be read. SystemExceptions.NotFound SystemExceptions.NotFound Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidArgumentCategory: Language-Exceptions I am raised when something is searched without success. SystemExceptions.NotFound class: accessing signalOn:what:signalOn: value what: aString Raise an exception; aString specifies what was not found (a key,an object, a class, and so on). SystemExceptions.NotFound: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.NotImplemented SystemExceptions.NotImplemented Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions I am raised when a method is called that has not been implemented. SystemExceptions.NotImplemented: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.NotIndexable SystemExceptions.NotIndexable Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am raised when an object is not indexable. SystemExceptions.NotIndexable: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.NotYetImplemented 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. SystemExceptions.NotYetImplemented: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.PrimitiveFailed SystemExceptions.PrimitiveFailed Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am raised when a primitive fails for some reason. SystemExceptions.PrimitiveFailed: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.ProcessBeingTerminated SystemExceptions.ProcessBeingTerminated Defined in namespace Smalltalk.SystemExceptionsSuperclass: NotificationCategory: Language-Exceptions SystemExceptions.ProcessBeingTerminated: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.ProcessTerminated SystemExceptions.ProcessTerminated Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am raised when somebody tries to resume or interrupt a terminated process. SystemExceptions.ProcessTerminated: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.ReadOnlyObject SystemExceptions.ReadOnlyObject Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.InvalidValueCategory: Language-Exceptions I am raised when one writes to a read-only object. SystemExceptions.ReadOnlyObject: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.SecurityError SystemExceptions.SecurityError Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am an error raised when an untrusted object tries to do an insecureoperation. SystemExceptions.SecurityError class: accessing signal:signal: aPermission Raise the exception, setting to aPermission the permissionthat was tested and failed. SystemExceptions.SecurityError: accessing descriptiondescription Answer a textual description of the exception. failedPermission failedPermission Answer the permission that was tested and that failed. failedPermission: failedPermission: anObject Set which permission was tested and failed. SystemExceptions.ShouldNotImplement 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 notcalled. SystemExceptions.ShouldNotImplement: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.SubclassResponsibility 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. SystemExceptions.SubclassResponsibility: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.UserInterrupt SystemExceptions.UserInterrupt Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am raised when one presses Ctrl-C. SystemExceptions.UserInterrupt: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.VerificationError SystemExceptions.VerificationError Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.VMErrorCategory: Language-Exceptions I am raised when the verification of a method fails. SystemExceptions.VerificationError: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.VMError SystemExceptions.VMError Defined in namespace Smalltalk.SystemExceptionsSuperclass: ErrorCategory: Language-Exceptions I am an error related to the innards of the system. SystemExceptions.VMError: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.WrongArgumentCount SystemExceptions.WrongArgumentCount Defined in namespace Smalltalk.SystemExceptionsSuperclass: SystemExceptions.PrimitiveFailedCategory: Language-Exceptions I am raised when one tries to evaluate a method (via #perform:...) or ablock but passes the wrong number of arguments. SystemExceptions.WrongArgumentCount: accessing descriptiondescription Answer a textual description of the exception. SystemExceptions.WrongClass 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. SystemExceptions.WrongClass class: signaling signalOn:mustBe:signalOn: anObject mustBe: aClassOrArray Raise an exception. The given object should have been an instanceof one of the classes indicated by aClassOrArray (which should bea single class or an array of classes). Whether instances ofsubclasses are allowed should be clear from the context, thoughin general (i.e. with the exception of a few system messages)they should be. SystemExceptions.WrongClass: accessing descriptiondescription Answer a textual description of the exception. messageText messageText Answer an exception's message text. validClasses validClasses Answer the list of classes whose instances would have been valid. validClasses: validClasses: aCollection Set the list of classes whose instances would have been valid. validClassesString validClassesString Answer the list of classes whose instances would have been valid,formatted as a string. SystemExceptions.WrongMessageSent 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 notcalled. This exception also includes a suggestion on which messageshould be sent instead SystemExceptions.WrongMessageSent class: signaling signalOn:useInstead:signalOn: selector useInstead: aSymbol Raise an exception, signaling which selector was sent and suggestinga valid alternative. SystemExceptions.WrongMessageSent: accessing messageTextmessageText Answer an exception's message text. selector selector Answer which selector was sent. selector: selector: aSymbol Set which selector was sent. suggestedSelector suggestedSelector Answer a valid alternative to the selector that was used. suggestedSelector: suggestedSelector: aSymbol Set a valid alternative to the selector that was used. TextCollector TextCollector Defined in namespace SmalltalkSuperclass: StreamCategory: Streams I am a thread-safe class that maps between standard Stream protocol anda single message to another object (its selector is pluggable and shouldroughly correspond to #nextPutAll:). I am, in fact, the class thatimplements the global Transcript object. TextCollector class: accessing message:message: receiverToSelectorAssociation Answer a new instance of the receiver, that uses the message identifiedby anAssociation to perform write operations. anAssociation'skey is the receiver, while its value is the selector. new new This method should not be called for instances of this class. TextCollector: accessing crcr Emit a new-line (carriage return) to the Transcript endEntry endEntry Emit two new-lines. This method is present for compatibility withVisualWorks. next:put: next: anInteger put: anObject Write anInteger copies of anObject to the Transcript nextPut: nextPut: aCharacter Emit aCharacter to the Transcript nextPutAll: nextPutAll: aString Write aString to the Transcript show: show: aString Write aString to the Transcript showCr: showCr: aString Write aString to the Transcript, followed by a new-line character showOnNewLine: showOnNewLine: aString Write aString to the Transcript, preceded by a new-line character TextCollector: printing print:print: anObject Print anObject's representation to the Transcript printOn: printOn: aStream Print a representation of the receiver onto aStream TextCollector: set up messagemessage Answer an association representing the message to be sentto perform write operations. The key is the receiver, the value is theselector message: message: receiverToSelectorAssociation Set the message to be sent to perform write operationsto the one represented by anAssociation. anAssociation's key is thereceiver, while its value is the selector TextCollector: storing store:store: anObject Print Smalltalk code which evaluates to anObject on the Transcript storeOn: storeOn: aStream Print Smalltalk code which evaluates to the receiver onto aStream Time Time Defined in namespace SmalltalkSuperclass: MagnitudeCategory: Language-Data types My instances represent times of the day. I provide methods for instancecreation, methods that access components (hours, minutes, and seconds) of atime value, and a block execution timing facility. Time class: basic (UTC) utcNowutcNow Answer a time representing the current time of day in CoordinatedUniversal Time (UTC) utcSecondClock secondClock utcSecondClock Answer the number of seconds since the midnight of 1/1/1901 (unlike#secondClock, the reference time is here expressed as UTC, that isas Coordinated Universal Time). Time class: builtins primMillisecondClockprimMillisecondClock Returns the number of milliseconds since midnight. primSecondClock primSecondClock Returns the number of seconds to/from 1/1/2000. timezone timezone Answer a String associated with the current timezone (either standardor daylight-saving) on this operating system. For example, the answercould be `EST' to indicate Eastern Standard Time; the answer can beempty and can't be assumed to be a three-character code such as `EST'. timezoneBias timezoneBias Specifies the current bias, in minutes, for local time translation forthe current time. The bias is the difference, in seconds, betweenCoordinated 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 thewest (e.g. America) Time class: clocks millisecondClockmillisecondClock Answer the number of milliseconds since startup. millisecondClockValue millisecondClockValue Answer the number of milliseconds since startup millisecondsPerDay millisecondsPerDay Answer the number of milliseconds in a day millisecondsToRun: millisecondsToRun: timedBlock Answer the number of milliseconds which timedBlock took to run secondClock secondClock Answer the number of seconds since the midnight of 1/1/1901 Time class: initialization initializeinitialize Initialize the Time class after the image has been bootstrapped update: update: aspect Private - Initialize the receiver's instance variables Time class: instance creation fromSeconds:fromSeconds: secondCount Answer a Time representing secondCount seconds past midnight hours: hours: h Answer a Time that is the given number of hours past midnight hours:minutes:seconds: hours: h minutes: m seconds: s Answer a Time that is the given number of hours, minutes andseconds past midnight minutes: minutes: m Answer a Time that is the given number of minutes past midnight new new Answer a Time representing midnight now now Answer a time representing the current time of day readFrom: readFrom: aStream Parse an instance of the receiver (hours/minutes/seconds) fromaStream seconds: seconds: s Answer a Time that is the given number of seconds past midnight Time: accessing (ANSI for DateAndTimes) hourhour Answer the number of hours in the receiver hour12 hour12 Answer the hour in a 12-hour clock hour24 hour24 Answer the hour in a 24-hour clock minute minute Answer the number of minutes in the receiver second second Answer the number of seconds in the receiver Time: accessing (non ANSI & for Durations) asSecondsasSeconds Answer `seconds'. hours hours Answer the number of hours in the receiver minutes minutes Answer the number of minutes in the receiver seconds seconds Answer the number of seconds in the receiver Time: arithmetic addTime:addTime: timeAmount Answer a new Time that is timeAmount seconds after the receiver printOn: printOn: aStream Print a representation of the receiver on aStream subtractTime: subtractTime: timeAmount Answer a new Time that is timeAmount seconds before the receiver Time: comparing << aTime Answer whether the receiver is less than aTime = = aTime Answer whether the receiver is equal to aTime hash hash Answer an hash value for the receiver TokenStream TokenStream Defined in namespace SmalltalkSuperclass: StreamCategory: Streams-Collections I am not a typical part of the Smalltalk kernel class hierarchy.I operate on a stream of characters and return distinct whitespace-delimitedgroups of characters; I am used to parse the parameters of class-creationmethods.Basically, I parse off whitespace separated tokens as substrings andreturn them (next). If the entire contents of the string are requested,I return them as an Array containing the individual strings. TokenStream class: instance creation on:on: aString Answer a TokenStream working on aString onStream: onStream: aStream Answer a TokenStream working on the collection on which aStreamis in turn streaming. TokenStream: basic atEndatEnd Answer whether the input stream has no more tokens. next next Answer a new whitespace-separated token from the input stream TokenStream: write methods nextPut:nextPut: anObject This method should not be called for instances of this class. TrappableEvent TrappableEvent Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Exceptions I am an abstract class for arguments passed to #on:do:... methods inBlockClosure. I define a bunch of methods that apply to CoreExceptionsand ExceptionSets: they allow you to create ExceptionSetsand examine all the exceptions to be trapped. TrappableEvent: enumerating allExceptionsDo:allExceptionsDo: aBlock Execute aBlock, passing it an Exception for every exception in thereceiver. goodness: goodness: exception Answer how good the receiver is at handling the given exception. Anegative value indicates that the receiver is not able to handlethe exception. handles: handles: exception Answer whether the receiver handles `exception'. TrappableEvent: instance creation ,, aTrappableEvent Answer an ExceptionSet containing all the exceptions in thereceiver and all the exceptions in aTrappableEvent True True Defined in namespace SmalltalkSuperclass: BooleanCategory: Language-Data types I represent truth and justice in the world. My motto is "semper veritatis". True: basic && aBoolean We are true – anded with anything, we always answer the other operand and: and: aBlock We are true – anded with anything, we always answer the other operand,so evaluate aBlock eqv: eqv: aBoolean Answer whether the receiver and aBoolean represent thesame boolean value ifFalse: ifFalse: falseBlock We are true – answer nil ifFalse:ifTrue: ifFalse: falseBlock ifTrue: trueBlock We are true – evaluate trueBlock ifTrue: ifTrue: trueBlock We are true – evaluate trueBlock ifTrue:ifFalse: ifTrue: trueBlock ifFalse: falseBlock We are true – evaluate trueBlock not not We are true – answer false or: or: aBlock We are true – ored with anything, we always answer true xor: xor: aBoolean Answer whether the receiver and aBoolean represent differentboolean values | | aBoolean We are true – ored with anything, we always answer true True: C hacks asCBooleanValueasCBooleanValue Answer `1'. True: printing printOn:printOn: aStream Print a representation of the receiver on aStream UndefinedObject UndefinedObject Defined in namespace SmalltalkSuperclass: ObjectCategory: Language-Implementation I have the questionable distinction of being a class with only oneinstance, which is the object "nil". UndefinedObject: basic copycopy Answer the receiver. deepCopy deepCopy Answer the receiver. shallowCopy shallowCopy Answer the receiver. UndefinedObject: class creation metaclassFor:metaclassFor: classNameString Create a Metaclass object for the given class name. The metaclassis a subclass of Class removeSubclass: removeSubclass: aClass Ignored – necessary to support disjoint class hierarchies subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a fixed subclass of the receiver with the given name, instancevariables, class variables, pool dictionaries and category. If theclass is already defined, if necessary, recompile everything needed. variable:subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: byte int8 character#short ushort int uint int64 uint64 utf32 float double pointer variable: shape subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a variable pointer subclass of the receiver with the givenname, instance variables, class variables, pool dictionaries andcategory. If the class is already defined, if necessary, recompileeverything needed. The shape can be one of #byte #int8 #character#short #ushort #int #uint #int64 #uint64 #utf32 #float #double or#pointer. variableByteSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableByteSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a byte variable subclass of the receiver with the givenname, instance variables, class variables, pool dictionariesand category. If the class is already defined, if necessary,recompile everything needed. variableSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a variable pointer subclass of the receiver with the givenname, instance variables, class variables, pool dictionaries andcategory. If the class is already defined, if necessary, recompileeverything needed. variableWordSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: variableWordSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameStringDefine a word variable subclass of the receiver with the givenname, instance variables, class variables, pool dictionaries andcategory. If the class is already defined, if necessary, recompileeverything needed. UndefinedObject: class creation - alternative subclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries:subclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk subclass:instanceVariableNames:classVariableNames:poolDictionaries: subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableByteSubclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries: variableByteSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableByteSubclass:instanceVariableNames:classVariableNames:poolDictionaries: variableByteSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableLongSubclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries: variableLongSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableLongSubclass:instanceVariableNames:classVariableNames:poolDictionaries: variableLongSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableSubclass:classInstanceVariableNames:instanceVariableNames:classVariableNames:poolDictionaries: variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk variableSubclass:instanceVariableNames:classVariableNames:poolDictionaries: variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames Don't use this, it is only present to file in from IBM Smalltalk UndefinedObject: CObject interoperability freefree Do nothing, a NULL pointer can be safely freed. narrow narrow Return the receiver: a NULL pointer is always nil, whatever its type. UndefinedObject: dependents access addDependent:addDependent: ignored Fail, nil does not support dependents. release release Ignore this call, nil does not support dependents. UndefinedObject: printing printOn:printOn: aStream Print a representation of the receiver on aStream. printOn:in: printOn: printOn: aStream in: aNamespace Print on aStream a representation of the receiver as it would be accessedfrom aNamespace: nil is the same everywhere, so print the same as#printOn: UndefinedObject: storing storeOn:storeOn: aStream Store Smalltalk code compiling to the receiver on aStream. UndefinedObject: testing ifNil:ifNil: nilBlock Evaluate nilBlock if the receiver is nil, else answer nil ifNil:ifNotNil: ifNil: nilBlock ifNotNil: notNilBlock Evaluate nilBlock if the receiver is nil, else evaluatenotNilBlock, passing the receiver. ifNotNil: ifNotNil: notNilBlock Evaluate notNilBlock if the receiver is not nil, passing the receiver.Else answer nil ifNotNil:ifNil: ifNotNil: notNilBlock ifNil: nilBlock Evaluate nilBlock if the receiver is nil, else evaluatenotNilBlock, passing the receiver. isNil isNil Answer whether the receiver is the undefined object nil. Alwaysanswer true. notNil notNil Answer whether the receiver is not the undefined object nil. Alwaysanswer false. UnicodeCharacter UnicodeCharacter Defined in namespace SmalltalkSuperclass: CharacterCategory: Language-Data types My instances represent the over one million characters of the Unicodecharacter set. It provides messages to translate between integers andcharacter objects.UnicodeCharacter objects are created when accessing UnicodeStrings,or with Character class>>#codePoint:. UnicodeCharacter class: built ins value: value:method codePoint:value: anInteger Returns the character object, possibly a Character, correspondingto anInteger. Error if anInteger is not an integer, or not in0..16r10FFFF.This is only a primitive for speed. UnicodeCharacter's #value:method is equivalent to #codePoint: (which is the same forCharacter and UnicodeCharacter). UnicodeString UnicodeString Defined in namespace SmalltalkSuperclass: CharacterArrayCategory: Collections-Text My instances represent Unicode string data types. Data is storedas 4-byte UTF-32 characters UnicodeString class: converting fromString:fromString: aString Return the String, aString, converted to its Unicode representation.Unless the I18N package is loaded, this is not implemented. UnicodeString class: multibyte encodings defaultEncodingdefaultEncoding Answer the encoding used by the receiver. Conventionally, weanswer 'Unicode' to ensure that two UnicodeStrings always havethe same encoding. UnicodeString: built-ins hashhash Answer an hash value for the receiver UnicodeString: converting asStringasString Returns the string corresponding to the receiver. Without theIconv package, unrecognized Unicode characters become $?characters. When it is loaded, an appropriate single- ormulti-byte encoding could be used. asSymbol asSymbol Returns the symbol corresponding to the receiver asUnicodeString asUnicodeString But I already am a UnicodeString! Really! displayOn: displayOn: aStream Print a representation of the receiver on aStream printOn: printOn: aStream Print a representation of the receiver on aStream UnicodeString: multibyte encodings encodingencoding Answer the encoding used by the receiver. Conventionally, weanswer 'Unicode' to ensure that two UnicodeStrings always havethe same encoding. numberOfCharacters size numberOfCharacters Answer the number of Unicode characters in the receiver. This isthe same as #size for UnicodeString. ValueAdaptor 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. ValueAdaptor class: creating instances newnew We don't know enough of subclasses to have a shared implementation of new ValueAdaptor: accessing valuevalue Retrive the value of the receiver. Must be implemented by ValueAdaptor'ssubclasses value: value: anObject Set the value of the receiver. Must be implemented by ValueAdaptor'ssubclasses ValueAdaptor: printing printOn:printOn: aStream Print a representation of the receiver ValueHolder ValueHolder Defined in namespace SmalltalkSuperclass: ValueAdaptorCategory: Language-Data types I store my value in a variable. For example, you can use me to pass num-bers by reference. Just instance me before calling a method and ask formy value after that method. There are a lot of other creative uses formy intances, though. ValueHolder class: creating instances newnew Create a ValueHolder whose starting value is nil null null Answer the sole instance of NullValueHolder with: with: anObject Create a ValueHolder whose starting value is anObject ValueHolder: accessing valuevalue Get the value of the receiver. value: value: anObject Set the value of the receiver. ValueHolder: initializing initializeinitialize Private - set the initial value of the receiver VariableBinding VariableBinding Defined in namespace SmalltalkSuperclass: HomedAssociationCategory: Language-Data types My instances represent a mapping between a key in a namespace andits value. I print different than a normal Association, and knowabout my parent namespace, otherwise my behavior is the same. VariableBinding: printing pathpath Print a dotted path that compiles to the receiver's value printOn: printOn: aStream Put on aStream a representation of the receiver VariableBinding: saving and loading binaryRepresentationObject at:tobinaryRepresentationObject This method is implemented to allow for a PluggableProxy to be usedwith VariableBindings. Answer a DirectedMessage which sends #at:to the environment that holds the receiver. VariableBinding: storing storeOn:storeOn: aStream Put on aStream some Smalltalk code compiling to the receiver VariableBinding: testing isDefinedisDefined Answer true if this VariableBinding lives outside theUndeclared dictionary VersionableObjectProxy VersionableObjectProxy Defined in namespace SmalltalkSuperclass: NullProxyCategory: Streams-Files I am a proxy that stores additionalinformation to allow different versions of an object's representationsto be handled by the program. VersionableObjectProxies are backwardscompatible, that is you can support versioning even if you did not usea VersionableObjectProxy for that class when the object was originarilydumped. VersionableObjectProxy does not support classes that changedshape across different versions. See the method comments for moreinformation. VersionableObjectProxy class: saving and restoring loadFrom: binaryRepresentationVersion convertFromVersion:withFixedVariables:instanceVariables:for: nonVersionedInstSizetoloadFrom: anObjectDumper Retrieve the object. If the version number doesn't match the#binaryRepresentationVersion answered by the class, call the class'#convertFromVersion:withFixedVariables:instanceVariables:for: method.The stored version number will be the first parameter to that method(or nil if the stored object did not employ a VersionableObjectProxy),the remaining parameters will be respectively the fixed instancevariables, the indexed instance variables (or nil if the class isfixed), and the ObjectDumper itself.If no VersionableObjectProxy, the class is sent #nonVersionedInstSizeto retrieve the number of fixed instance variables stored for thenon-versioned object. VersionableObjectProxy: saving and restoring dumpTo:dumpTo: anObjectDumper Save the object with extra versioning information. VFS.ArchiveFileHandler VFS.ArchiveFileHandler Defined in namespace Smalltalk.VFSSuperclass: VFS.RealFileHandlerCategory: Streams-Files ArchiveFileHandler handlesvirtual filesystems that have a directory structure oftheir own. The directories and files in the archive areinstances of ArchiveMemberHandler, but the functionalityresides entirely in ArchiveFileHandler because the memberswill still ask the archive to get directory informationon them, to extract them to a real file, and so on. VFS.ArchiveFileHandler class: registering isAccessibleisAccessible Answer whether a directory with the name contained in the receiver doesexist and can be accessed isDirectory isDirectory Answer true. The archive can always be considered as a directory. VFS.ArchiveFileHandler: ArchiveMemberHandler protocol extractMember:extractMember: anArchiveMemberHandler Extract the contents of anArchiveMemberHandler into a filethat resides on disk, and answer the name of the file. fillMember: size:stCtime:stMtime:stAtime:isDirectory: fillMember: anArchiveMemberHandler Extract the information on anArchiveMemberHandler. Answerfalse if it actually does not exist in the archive; otherwise,answer true after having told anArchiveMemberHandler about themby sending #size:stCtime:stMtime:stAtime:isDirectory: to it. member:do: member: anArchiveMemberHandler do: aBlock Evaluate aBlock once for each file in the directory represented byanArchiveMemberHandler, passing its name. newMemberHandlerFor: newMemberHandlerFor: aName Answer a new ArchiveMemberHandler for a file named aNameresiding inside the archive represented by the receiver. removeMember: removeMember: anArchiveMemberHandler Remove the member represented by anArchiveMemberHandler. updateMember: updateMember: anArchiveMemberHandler Update the member represented by anArchiveMemberHandler bycopying the file into which it was extracted back to thearchive. VFS.ArchiveFileHandler: directory operations at:at: aName Answer a VFSHandler for a file named `aName' residing in the directoryrepresented by the receiver. createDir: createDir: dirName Create a subdirectory of the receiver, naming it dirName. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. finalize finalize Upon finalization, we remove the file that was temporarily holding the filecontents release release Release the resources used by the receiver that don't survive whenreloading a snapshot. VFS.ArchiveFileHandler: file operations removeremove Remove the file with the given path name VFS.ArchiveMemberHandler VFS.ArchiveMemberHandler Defined in namespace Smalltalk.VFSSuperclass: VFS.VFSHandlerCategory: Streams-Files ArchiveMemberHandler is the handlerclass for members of archive files (instances of ArchiveFileHandler). VFS.ArchiveMemberHandler: accessing creationTimecreationTime Answer the creation time of the file identified by the receiver.On some operating systems, this could actually be the last change time(the `last change time' has to do with permissions, ownership and thelike). lastAccessTime lastAccessTime Answer the last access time of the file identified by the receiver lastChangeTime lastChangeTime Answer the last change time of the file identified by the receiver(the `last change time' has to do with permissions, ownership and thelike). On some operating systems, this could actually be thefile creation time. lastModifyTime lastModifyTime Answer the last modify time of the file identified by the receiver(the `last modify time' has to do with the actual file contents). parent parent Answer the archive of which the receiver is a member. refresh refresh Refresh the statistics for the receiver size size Answer the size of the file identified by the receiver VFS.ArchiveMemberHandler: directory operations at:at: aName Answer a VFSHandler for a file named `aName' residing in the directoryrepresented by the receiver. createDir: createDir: dirName Create a subdirectory of the receiver, naming it dirName. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. VFS.ArchiveMemberHandler: file operations open:mode:ifFail:open: class mode: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods) remove remove Remove the file with the given path name renameTo: renameTo: newFileName Rename the file with the given path name oldFileName to newFileName update: update: aspect Private - Update the in-archive version of the file before closing. VFS.ArchiveMemberHandler: finalization realFileNamerealFileName Answer the real file name which holds the file contents,or nil if it does not apply. release release Release the resources used by the receiver that don't survive whenreloading a snapshot. VFS.ArchiveMemberHandler: initializing parent:parent: anArchiveFileHandler Set the archive of which the receiver is a member. size:stCtime:stMtime:stAtime:isDirectory: size: bytes stCtime: ctime stMtime: mtime stAtime: atime isDirectory: isDir Called back by the receiver's parent when the ArchiveMemberHandlerasks for file information. VFS.ArchiveMemberHandler: testing existsexists Answer whether a file with the name contained in the receiver does exist. isAccessible isAccessible Answer whether a directory with the name contained in the receiver does existand is accessible isDirectory isDirectory Answer whether a file with the name contained in the receiver does existand identifies a directory. isExecutable isExecutable Answer whether a file with the name contained in the receiver does existand is executable isReadable isReadable Answer whether a file with the name contained in the receiver does existand is readable isWriteable isWriteable Answer whether a file with the name contained in the receiver does existand is writeable VFS.DecodedFileHandler VFS.DecodedFileHandler Defined in namespace Smalltalk.VFSSuperclass: VFS.RealFileHandlerCategory: Streams-Files DecodedFileHandler handlesvirtual filesystems that take a file that is on-disk, run acommand on it, and then read from the result. VFS.DecodedFileHandler class: registering fileSystems gz ugz Z uZ bz2 ubz2 tar tgz nop stringsfileSystems Answer the virtual file systems that can be processed by this subclass.These are #gz (gzip a file), #ugz (uncompress a gzipped file),#Z (compress a file via Unix compress), #uZ (uncompress a compressedfile), #bz2 (compress a file via bzip2), #ubz2 (uncompress a file viabzip2), #tar (make a tar archive out of a directory), #tgz (make agzipped tar archive out of a directory), #nop (do nothing, used fortesting) and #strings (use the `strings' utility to extract printablestrings from a file). initialize initialize Initialize the default virtual filesystems and the associatedfilter commands. vfsFor:name:subPath: vfsFor: file name: fsName subPath: subPath Create a temporary file and use it to construct the contents of the givenfile, under the virtual filesystem fsName. subPath must be nil becausethis class supports single-file virtual filesystems only. VFS.DecodedFileHandler: files finalizefinalize Upon finalization, we remove the file that was temporarily holding the filecontents name:realFileName: name: virtualFileName realFileName: temporaryFileName Private - Initialize a new object storing the contents of thevirtualFileName file into temporaryFileName. realFileName realFileName Answer the real file name which holds the file contents,or nil if it does not apply. release release Release the resources used by the receiver that don't survive whenreloading a snapshot. VFS.ExternalArchiveFileHandler VFS.ExternalArchiveFileHandler Defined in namespace Smalltalk.VFSSuperclass: VFS.ArchiveFileHandlerCategory: Streams-Files ExternalArchiveFileHandlerallows for easy implementation of archive files (for example,transparent unzipping and untarring) with a single shell script.It implements a protocol that that is compatible with the MidnightCommander and with GNOME VFS. VFS.ExternalArchiveFileHandler class: registering fileSystemsfileSystems Answer the virtual file systems that can be processed by this subclass.These are given by the names of the executable files in the vfssubdirectory of the image directory, of the parent of the kerneldirectory and of the parent of the system kernel directory. fileSystemsIn: fileSystemsIn: path Registers the executable files in the given directory to be usedto resolve a virtual file system. release release Avoid that paths stay in the image file vfsFor:name:subPath: vfsFor: file name: fsName subPath: subPath Create a temporary file and use it to construct the contents of the givenfile, under the virtual filesystem fsName. VFS.ExternalArchiveFileHandler: ArchiveMemberHandler protocol extractMember:extractMember: anArchiveMemberHandler Extract the contents of anArchiveMemberHandler into a filethat resides on disk, and answer the name of the file. fillMember: size:stCtime:stMtime:stAtime:isDirectory: fillMember: anArchiveMemberHandler Extract the information on anArchiveMemberHandler. Answerfalse if it actually does not exist in the archive; otherwise,answer true after having told anArchiveMemberHandler about themby sending #size:stCtime:stMtime:stAtime:isDirectory: to it. member:do: member: anArchiveMemberHandler do: aBlock Evaluate aBlock once for each file in the directory represented byanArchiveMemberHandler, passing its name. refresh refresh Extract the directory listing from the archive removeMember: removeMember: anArchiveMemberHandler Remove the member represented by anArchiveMemberHandler. updateMember: updateMember: anArchiveMemberHandler Update the member represented by anArchiveMemberHandler bycopying the file into which it was extracted back to thearchive. VFS.ExternalArchiveFileHandler: members createDir:createDir: dirName Create a subdirectory of the receiver, naming it dirName. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. VFS.ExternalArchiveFileHandler: releasing releaserelease Release the resources used by the receiver that don't survive whenreloading a snapshot. VFS.RealFileHandler VFS.RealFileHandler Defined in namespace Smalltalk.VFSSuperclass: VFS.VFSHandlerCategory: Streams-Files RealFileHandler is an handler forfiles that are on disk, as well as for virtual files that endup being on disk when they are opened for the first time. VFS.RealFileHandler class: C call-outs setTimeFor:atime:mtime:setTimeFor: file atime: atimeSeconds mtime: mtimeSeconds Not commented. working working Not commented. VFS.RealFileHandler class: initialization initializeinitialize Initialize the receiver's class variables VFS.RealFileHandler: accessing creationTimecreationTime Answer the creation time of the file identified by the receiver.On some operating systems, this could actually be the last change time(the `last change time' has to do with permissions, ownership and thelike). isDirectory isDirectory Answer whether the file is a directory. isSymbolicLink isSymbolicLink Answer whether the file is a symbolic link. lastAccessTime lastAccessTime Answer the last access time of the file identified by the receiver lastChangeTime lastChangeTime Answer the last change time of the file identified by the receiver(the `last change time' has to do with permissions, ownership and thelike). On some operating systems, this could actually be thefile creation time. lastModifyTime lastModifyTime Answer the last modify time of the file identified by the receiver(the `last modify time' has to do with the actual file contents). name: name: aName Private - Initialize the receiver's instance variables refresh refresh Refresh the statistics for the receiver size size Answer the size of the file identified by the receiver VFS.RealFileHandler: directory operations createDir:createDir: dirName Create a subdirectory of the receiver, naming it dirName. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. aBlock should not return. VFS.RealFileHandler: file operations lastAccessTime:lastModifyTime:lastAccessTime: accessDateTime lastModifyTime: modifyDateTime Set the receiver's timestamps to be accessDateTime and modifyDateTime. open:mode:ifFail: open: class mode: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods) remove remove Remove the file with the given path name renameTo: renameTo: newFileName Rename the file with the given path name oldFileName to newFileName VFS.RealFileHandler: testing existsexists Answer whether a file with the name contained in the receiver does exist. isExecutable isExecutable Answer whether a file with the name contained in the receiver does existand is executable isReadable isReadable Answer whether a file with the name contained in the receiver does existand is readable isWriteable isWriteable Answer whether a file with the name contained in the receiver does existand is writeable VFS.VFSHandler VFS.VFSHandler Defined in namespace Smalltalk.VFSSuperclass: ObjectCategory: Streams-Files VFSHandler is the abstract class forimplementations of File and Directory. These classes onlydelegate to the appropriate handler, which is in charge ofactually accessing or “molding” the filesystem. VFS.VFSHandler class: initializing fileSystems vfsFor:name:subPath:fileSystems Answer the virtual file systems that can be processed by this subclass.The default is to answer an empty array, but subclasses can overridethis. If you do so, you should override #vfsFor:name:subPath: as wellor you risk infinite loops. initialize initialize Register the receiver with ObjectMemory register:forClass: fileSystems register: fileSystem forClass: vfsHandlerClass Register the given file system to be handled by an instance ofvfsHandlerClass. This is automatically called if the class overrides#fileSystems. update: update: aspect Private - Remove the files before quitting, and register the virtualfilesystems specified by the subclasses upon image load. VFS.VFSHandler class: instance creation for:for: fileName Answer the (real or virtual) file handler for the file named fileName VFS.VFSHandler: accessing creationTimecreationTime Answer the creation time of the file identified by the receiver.On some operating systems, this could actually be the last change time(the `last change time' has to do with permissions, ownership and thelike). lastAccessTime lastAccessTime Answer the last access time of the file identified by the receiver lastChangeTime lastChangeTime Answer the last change time of the file identified by the receiver(the `last change time' has to do with permissions, ownership and thelike). On some operating systems, this could actually be thefile creation time. lastModifyTime lastModifyTime Answer the last modify time of the file identified by the receiver(the `last modify time' has to do with the actual file contents). name name Answer the name of the file identified by the receiver name: name: aName Private - Initialize the receiver's instance variables realFileName realFileName Answer the real file name which holds the file contents,or an empty string if it does not apply. refresh refresh Refresh the statistics for the receiver size size Answer the size of the file identified by the receiver VFS.VFSHandler: C call-outs closeDir:closeDir: dirObject Not commented. extractDirentName: extractDirentName: dirent Not commented. lstatOn:into: lstatOn: fileName into: statStruct Not commented. openDir: openDir: dirName Not commented. primCreateDir:mode: primCreateDir: dirName mode: mode Not commented. primIsExecutable: primIsExecutable: name Not commented. primIsReadable: primIsReadable: name Not commented. primIsWriteable: primIsWriteable: name Not commented. primRemoveDir: primRemoveDir: fileName Not commented. primRename:to: primRename: oldFileName to: newFileName Not commented. primUnlink: primUnlink: fileName Not commented. readDir: readDir: dirObject Not commented. rewindDir: rewindDir: dirObject Not commented. statOn:into: statOn: fileName into: statStruct Not commented. VFS.VFSHandler: directory operations at:at: aName Answer a VFSHandler for a file named `aName' residing in the directoryrepresented by the receiver. createDir: createDir: dirName Create a subdirectory of the receiver, naming it dirName. do: do: aBlock Evaluate aBlock once for each file in the directory represented by thereceiver, passing its name. aBlock should not return. VFS.VFSHandler: file operations lastAccessTime:lastModifyTime:lastAccessTime: accessDateTime lastModifyTime: modifyDateTime Set the receiver's timestamps to be accessDateTime and modifyDateTime.If your file system does not support distinct access and modificationtimes, you should discard accessDateTime. open:ifFail: open: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods) open:mode:ifFail: open: class mode: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods) openDescriptor:ifFail: openDescriptor: mode ifFail: aBlock Open the receiver in the given mode (as answered by FileStream'sclass constant methods) remove remove Remove the file with the given path name renameTo: renameTo: newFileName Rename the file with the given path name oldFileName to newFileName VFS.VFSHandler: testing existsexists Answer whether a file with the name contained in the receiver does exist. isAccessible isAccessible Answer whether a directory with the name contained in the receiver doesexist and can be accessed isDirectory isDirectory Answer whether a file with the name contained in the receiver does existand identifies a directory. isExecutable isExecutable Answer whether a file with the name contained in the receiver does existand is executable isReadable isReadable Answer whether a file with the name contained in the receiver does existand is readable isSymbolicLink isSymbolicLink Answer whether the file is a symbolic link. isWriteable isWriteable Answer whether a file with the name contained in the receiver does existand is writeable Warning Warning Defined in namespace SmalltalkSuperclass: NotificationCategory: Language-Exceptions Warning represents an `important' but resumable error. Warning: exception description descriptiondescription Answer a textual description of the exception. WeakArray 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 I track which of them are garbage collected. WeakArray class: instance creation new:new: size Private - Initialize the values array; plus, make it weak and createthe ByteArray used to track garbage collected values WeakArray: accessing aliveObjectsDo:aliveObjectsDo: aBlock Evaluate aBlock for all the elements in the array, excluding thegarbage collected ones. Note: a finalized object stays alive untilthe next collection (the collector has no means to see whether it wasresuscitated by the finalizer), so an object being alive does not meanthat it is usable. at: at: index Answer the index-th item of the receiver, or nil if it has beengarbage collected. at:put: at: index put: object Store the value associated to the given index; plus,store in nilValues whether the object is nil. nil objects whoseassociated item of nilValues is 1 were touched by the garbagecollector. atAll:put: atAll: indices put: object Put object at every index contained in the indices collection atAllPut: atAllPut: object Put object at every index in the receiver clearGCFlag: clearGCFlag: index Clear the `object has been garbage collected' flag for the itemat the given index do: do: aBlock Evaluate aBlock for all the elements in the array, including thegarbage collected ones (pass nil for those). isAlive: isAlive: index Answer whether the item at the given index is still alive or has beengarbage collected. Note: a finalized object stays alive until the nextcollection (the collector has no means to see whether it was resuscitatedby the finalizer), so an object being alive does not mean that it isusable. size size Answer the number of items in the receiver WeakArray: conversion asArrayasArray Answer a non-weak version of the receiver deepCopy deepCopy Returns a deep copy of the receiver (the instance variables arecopies of the receiver's instance variables) shallowCopy shallowCopy Returns a shallow copy of the receiver (the instance variables arenot copied) species copyEmpty: species Answer Array; this method is used in the #copyEmpty: message, which inturn is used by all collection-returning methods (collect:, select:,reject:, etc.). WeakArray: loading postLoadpostLoad Called after loading an object; must restore it to the state before`preStore' was called. Make it weak again WeakIdentitySet WeakIdentitySet Defined in namespace SmalltalkSuperclass: WeakSetCategory: Collections-Weak I am similar to a plain identity set, but my keys are stored in a weakarray; I track which of them are garbage collected and, as soon as Iencounter one of them, I swiftly remove all the garbage collected keys WeakKeyDictionary WeakKeyDictionary Defined in namespace SmalltalkSuperclass: DictionaryCategory: Collections-Weak I am similar to a plain Dictionary, but my keys are storedin a weak array; I track which of them are garbage collected and, assoon as I encounter one of them, I swiftly remove all the associationsfor the garbage collected keys WeakKeyDictionary: accessing add:add: anAssociation Store value as associated to the given key. If any, recycle Associationstemporarily stored by the compiler inside the `Undeclared' dictionary. at:put: at: key put: value Store value as associated to the given key. If any, recycle Associationstemporarily stored by the compiler inside the `Undeclared' dictionary. WeakKeyIdentityDictionary WeakKeyIdentityDictionary Defined in namespace SmalltalkSuperclass: WeakKeyDictionaryCategory: Collections-Weak I am similar to a plain identity dictionary, but my keys are storedin a weak array; I track which of them are garbage collected and, assoon as I encounter one of them, I swiftly remove all the associationsfor the garbage collected keys WeakSet 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 track which of them are garbage collected and, as soon as I encounterone of them, I swiftly remove all. WeakSet: accessing add:add: anObject Add newObject to the set, if and only if the set doesn't already containan occurrence of it. Don't fail if a duplicate is found. Answer anObject do: do: aBlock Enumerate all the non-nil members of the set remove:ifAbsent: remove: anObject ifAbsent: aBlock Remove oldObject to the set. If it is found, answer oldObject.Otherwise, evaluate aBlock and return its value. WeakValueIdentityDictionary WeakValueIdentityDictionary Defined in namespace SmalltalkSuperclass: WeakValueLookupTableCategory: Collections-Weak I am similar to a plain identity dictionary, but my values are storedin a weak array; I track which of the values are garbage collected and,as soon as one of them is accessed, I swiftly remove the associationsfor the garbage collected values WeakValueLookupTable WeakValueLookupTable Defined in namespace SmalltalkSuperclass: LookupTableCategory: Collections-Weak I am similar to a plain LookupTable, but my values are storedin a weak array; I track which of the values are garbage collected and,as soon as one of them is accessed, I swiftly remove the associationsfor the garbage collected values WeakValueLookupTable class: hacks primNew:primNew: realSize Answer a new, uninitialized instance of the receiver with the given size WeakValueLookupTable: hacks at:ifAbsent:at: key ifAbsent: aBlock Answer the value associated to the given key, or the result of evaluatingaBlock if the key is not found at:ifPresent: at: key ifPresent: aBlock If aKey is absent, answer nil. Else, evaluate aBlock passing theassociated value and answer the result of the invocation includesKey: includesKey: key Answer whether the receiver contains the given key. WeakValueLookupTable: rehashing rehashrehash Rehash the receiver WordArray WordArray Defined in namespace SmalltalkSuperclass: ArrayedCollectionCategory: Collections-Sequenceable I am similar to a plain array, but my items are 32-bit integers. WriteStream WriteStream Defined in namespace SmalltalkSuperclass: PositionableStreamCategory: Streams-Collections I am the class of writeable streams. I only allow write operations tomy instances; reading is strictly forbidden. WriteStream class: instance creation on:on: aCollection Answer a new instance of the receiver which streams on aCollection.Every item of aCollection is discarded. with: with: aCollection Answer a new instance of the receiver which streams from the endof aCollection. with:from:to: with: aCollection from: firstIndex to: lastIndex Answer a new instance of the receiver which streams from thefirstIndex-th item of aCollection to the lastIndex-th. Thepointer is moved to the last item in that range. WriteStream: accessing sizesize Answer how many objects have been written WriteStream: accessing-writing contentscontents Returns a collection of the same type that the stream accesses, up toand including the final element. nextPut: nextPut: anObject Store anObject as the next item in the receiver. Grow thecollection if necessary readStream readStream Answer a ReadStream on the same contents as the receiver reverseContents reverseContents Returns a collection of the same type that the stream accesses, up toand including the final element, but in reverse order. WriteStream: positioning emptyStreamemptyStream Extension - Reset the stream ZeroDivide ZeroDivide Defined in namespace SmalltalkSuperclass: ArithmeticErrorCategory: Language-Exceptions A ZeroDivide exception is raised by numeric classes when a program triesto divide by zero. Information on the dividend is available to thehandler. ZeroDivide class: instance creation dividend:dividend: aNumber Create a new ZeroDivide object remembering that the dividend wasaNumber. new new Create a new ZeroDivide object; the dividend is conventionallyset to zero. ZeroDivide: accessing dividenddividend Answer the number that was being divided by zero ZeroDivide: description descriptiondescription Answer a textual description of the exception.