This document describes the class libraries that are distributed together with the GNU Smalltalk programming language.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
• Base classes: | The class reference | |
• Class index: | Index to the classes in the class reference | |
• Method index: | Index to the method selectors in the class reference | |
• Cross-reference: | Cross-reference between selectors |
Next: Class index, Up: Top [Index]
Alphabetic list: | ||
---|---|---|
• AbstractNamespace: | ||
• AlternativeObjectProxy: | ||
• ArithmeticError: | ||
• Array: | ||
• ArrayedCollection: | ||
• Association: | ||
• Autoload: | ||
• Bag: | ||
• Behavior: | ||
• BindingDictionary: | ||
• BlockClosure: | ||
• BlockContext: | ||
• Boolean: | ||
• ByteArray: | ||
• CAggregate: | ||
• CallinProcess: | ||
• CArray: | ||
• CArrayCType: | ||
• CBoolean: | ||
• CByte: | ||
• CCallable: | ||
• CCallbackDescriptor: | ||
• CChar: | ||
• CCompound: | ||
• CDouble: | ||
• CFloat: | ||
• CFunctionDescriptor: | ||
• Character: | ||
• CharacterArray: | ||
• CInt: | ||
• Class: | ||
• ClassDescription: | ||
• CLong: | ||
• CLongDouble: | ||
• CLongLong: | ||
• CObject: | ||
• Collection: | ||
• CompiledBlock: | ||
• CompiledCode: | ||
• CompiledMethod: | ||
• ContextPart: | ||
• Continuation: | ||
• CPtr: | ||
• CPtrCType: | ||
• CScalar: | ||
• CScalarCType: | ||
• CShort: | ||
• CSmalltalk: | ||
• CString: | ||
• CStringCType: | ||
• CStruct: | ||
• CType: | ||
• CUChar: | ||
• CUInt: | ||
• CULong: | ||
• CULongLong: | ||
• CUnion: | ||
• CUShort: | ||
• Date: | ||
• DateTime: | ||
• DeferredVariableBinding: | ||
• Delay: | ||
• DelayedAdaptor: | ||
• Dictionary: | ||
• DirectedMessage: | ||
• Directory: | ||
• DLD: | ||
• DumperProxy: | ||
• Duration: | ||
• DynamicVariable: | ||
• Error: | ||
• Exception: | ||
• ExceptionSet: | ||
• False: | ||
• File: | ||
• FileDescriptor: | ||
• FilePath: | ||
• FileSegment: | ||
• FileStream: | ||
• Float: | ||
• FloatD: | ||
• FloatE: | ||
• FloatQ: | ||
• Fraction: | ||
• Generator: | ||
• Getopt: | ||
• Halt: | ||
• HashedCollection: | ||
• HomedAssociation: | ||
• IdentityDictionary: | ||
• IdentitySet: | ||
• Integer: | ||
• Interval: | ||
• Iterable: | ||
• LargeArray: | ||
• LargeArrayedCollection: | ||
• LargeByteArray: | ||
• LargeInteger: | ||
• LargeNegativeInteger: | ||
• LargePositiveInteger: | ||
• LargeWordArray: | ||
• LargeZeroInteger: | ||
• Link: | ||
• LinkedList: | ||
• LookupKey: | ||
• LookupTable: | ||
• Magnitude: | ||
• MappedCollection: | ||
• Memory: | ||
• Message: | ||
• MessageNotUnderstood: | ||
• Metaclass: | ||
• MethodContext: | ||
• MethodDictionary: | ||
• MethodInfo: | ||
• Namespace: | ||
• NetClients.URIResolver: | ||
• NetClients.URL: | ||
• Notification: | ||
• NullProxy: | ||
• NullValueHolder: | ||
• Number: | ||
• Object: | ||
• ObjectDumper: | ||
• ObjectMemory: | ||
• OrderedCollection: | ||
• Package: | ||
• PackageLoader: | ||
• Permission: | ||
• PluggableAdaptor: | ||
• PluggableProxy: | ||
• Point: | ||
• PositionableStream: | ||
• Process: | ||
• ProcessEnvironment: | ||
• ProcessorScheduler: | ||
• ProcessVariable: | ||
• Promise: | ||
• Random: | ||
• ReadStream: | ||
• ReadWriteStream: | ||
• Rectangle: | ||
• RecursionLock: | ||
• Regex: | ||
• RegexResults: | ||
• RootNamespace: | ||
• RunArray: | ||
• ScaledDecimal: | ||
• SecurityPolicy: | ||
• Semaphore: | ||
• SequenceableCollection: | ||
• Set: | ||
• SharedQueue: | ||
• SingletonProxy: | ||
• SmallInteger: | ||
• SortedCollection: | ||
• Stream: | ||
• String: | ||
• Symbol: | ||
• SymLink: | ||
• SystemDictionary: | ||
• SystemExceptions.AlreadyDefined: | ||
• SystemExceptions.ArgumentOutOfRange: | ||
• SystemExceptions.BadReturn: | ||
• SystemExceptions.CInterfaceError: | ||
• SystemExceptions.EmptyCollection: | ||
• SystemExceptions.EndOfStream: | ||
• SystemExceptions.FileError: | ||
• SystemExceptions.IndexOutOfRange: | ||
• SystemExceptions.InvalidArgument: | ||
• SystemExceptions.InvalidProcessState: | ||
• SystemExceptions.InvalidSize: | ||
• SystemExceptions.InvalidState: | ||
• SystemExceptions.InvalidValue: | ||
• SystemExceptions.MustBeBoolean: | ||
• SystemExceptions.MutationError: | ||
• SystemExceptions.NoRunnableProcess: | ||
• SystemExceptions.NotEnoughElements: | ||
• SystemExceptions.NotFound: | ||
• SystemExceptions.NotImplemented: | ||
• SystemExceptions.NotIndexable: | ||
• SystemExceptions.NotYetImplemented: | ||
• SystemExceptions.PackageNotAvailable: | ||
• SystemExceptions.PrimitiveFailed: | ||
• SystemExceptions.ProcessBeingTerminated: | ||
• SystemExceptions.ProcessTerminated: | ||
• SystemExceptions.ReadOnlyObject: | ||
• SystemExceptions.SecurityError: | ||
• SystemExceptions.ShouldNotImplement: | ||
• SystemExceptions.SubclassResponsibility: | ||
• SystemExceptions.UnhandledException: | ||
• SystemExceptions.UserInterrupt: | ||
• SystemExceptions.VerificationError: | ||
• SystemExceptions.VMError: | ||
• SystemExceptions.WrongArgumentCount: | ||
• SystemExceptions.WrongClass: | ||
• SystemExceptions.WrongMessageSent: | ||
• TextCollector: | ||
• Time: | ||
• True: | ||
• UndefinedObject: | ||
• UnicodeCharacter: | ||
• UnicodeString: | ||
• ValueAdaptor: | ||
• ValueHolder: | ||
• VariableBinding: | ||
• VersionableObjectProxy: | ||
• VFS.ArchiveFile: | ||
• VFS.ArchiveMember: | ||
• VFS.FileWrapper: | ||
• VFS.StoredZipMember: | ||
• VFS.TmpFileArchiveMember: | ||
• VFS.ZipFile: | ||
• Warning: | ||
• WeakArray: | ||
• WeakIdentitySet: | ||
• WeakKeyDictionary: | ||
• WeakKeyIdentityDictionary: | ||
• WeakSet: | ||
• WeakValueIdentityDictionary: | ||
• WeakValueLookupTable: | ||
• WordArray: | ||
• WriteStream: | ||
• ZeroDivide: | ||
Classes documented in this manual are boldfaced. Autoload Object Behavior ClassDescription Class Metaclass BlockClosure Boolean False True CObject CAggregate CArray CPtr CString CCallable CCallbackDescriptor CFunctionDescriptor CCompound CStruct CUnion CScalar CChar CDouble CFloat CInt CLong CLongDouble CLongLong CShort CSmalltalk CUChar CByte CBoolean CUInt CULong CULongLong CUShort ContextPart BlockContext MethodContext Continuation CType CPtrCType CArrayCType CScalarCType CStringCType Delay Directory DLD DumperProxy AlternativeObjectProxy NullProxy VersionableObjectProxy PluggableProxy SingletonProxy DynamicVariable Exception Error ArithmeticError ZeroDivide MessageNotUnderstood SystemExceptions.InvalidValue SystemExceptions.EmptyCollection SystemExceptions.InvalidArgument SystemExceptions.AlreadyDefined SystemExceptions.ArgumentOutOfRange SystemExceptions.IndexOutOfRange SystemExceptions.InvalidSize SystemExceptions.NotFound SystemExceptions.PackageNotAvailable SystemExceptions.InvalidProcessState SystemExceptions.InvalidState SystemExceptions.NotIndexable SystemExceptions.ProcessTerminated SystemExceptions.ReadOnlyObject SystemExceptions.WrongClass SystemExceptions.MustBeBoolean SystemExceptions.MutationError SystemExceptions.NotEnoughElements SystemExceptions.NotImplemented SystemExceptions.NotYetImplemented SystemExceptions.ShouldNotImplement SystemExceptions.SubclassResponsibility SystemExceptions.WrongMessageSent SystemExceptions.VMError SystemExceptions.BadReturn SystemExceptions.NoRunnableProcess SystemExceptions.PrimitiveFailed SystemExceptions.CInterfaceError SystemExceptions.FileError SystemExceptions.WrongArgumentCount SystemExceptions.SecurityError SystemExceptions.UserInterrupt SystemExceptions.VerificationError Halt Notification SystemExceptions.EndOfStream SystemExceptions.ProcessBeingTerminated Warning SystemExceptions.UnhandledException ExceptionSet FilePath File VFS.ArchiveMember VFS.TmpFileArchiveMember VFS.StoredZipMember VFS.FileWrapper VFS.ArchiveFile VFS.ZipFile FileSegment Getopt Iterable Collection Bag HashedCollection Dictionary BindingDictionary AbstractNamespace Namespace RootNamespace SystemDictionary LookupTable IdentityDictionary MethodDictionary WeakValueLookupTable WeakValueIdentityDictionary WeakKeyDictionary WeakKeyIdentityDictionary Set IdentitySet WeakSet WeakIdentitySet MappedCollection SequenceableCollection ArrayedCollection Array WeakArray ByteArray CharacterArray String Symbol UnicodeString CompiledCode CompiledBlock CompiledMethod Interval LargeArrayedCollection LargeArray LargeByteArray LargeWordArray WordArray LinkedList Semaphore OrderedCollection RunArray SortedCollection Stream FileDescriptor FileStream Generator ObjectDumper PositionableStream ReadStream WriteStream ReadWriteStream Random TextCollector Kernel.PackageInfo Package Link Process CallinProcess SymLink Magnitude Character UnicodeCharacter Date DateTime LookupKey Association HomedAssociation VariableBinding DeferredVariableBinding ProcessVariable Number Float FloatD FloatE FloatQ Fraction Integer LargeInteger LargeNegativeInteger LargePositiveInteger LargeZeroInteger SmallInteger ScaledDecimal Time Duration Memory Message DirectedMessage MethodInfo NetClients.URIResolver NetClients.URL ObjectMemory PackageLoader Permission Point ProcessEnvironment ProcessorScheduler Rectangle RecursionLock Regex RegexResults SecurityPolicy SharedQueue UndefinedObject ValueAdaptor NullValueHolder PluggableAdaptor DelayedAdaptor ValueHolder Promise |
Next: AlternativeObjectProxy, Up: Base classes [Index]
I am a special form of dictionary. Classes hold on an instance of me; it is called their ‘environment’.
• AbstractNamespace class-instance creation: | (class) | |
• AbstractNamespace-accessing: | (instance) | |
• AbstractNamespace-compiling: | (instance) | |
• AbstractNamespace-copying: | (instance) | |
• AbstractNamespace-namespace hierarchy: | (instance) | |
• AbstractNamespace-overrides for superspaces: | (instance) | |
• AbstractNamespace-printing: | (instance) | |
• AbstractNamespace-testing: | (instance) |
Next: AbstractNamespace-accessing, Up: AbstractNamespace [Index]
Disabled - use #new to create instances
Private - Create a new namespace with the given name and parent, and add to the parent a key that references it.
Next: AbstractNamespace-compiling, Previous: AbstractNamespace class-instance creation, Up: AbstractNamespace [Index]
Answer a Dictionary with all of the associations in the receiver and each of its superspaces (duplicate keys are associated to the associations that are deeper in the namespace hierarchy)
Evaluate aBlock once for each class and metaclass in the namespace.
Evaluate aBlock once for each class and metaclass in the namespace.
Evaluate aBlock once for each class in the namespace.
Evaluate aBlock once for each metaclass in the namespace.
Answer the value corrisponding to aKey if it is a class. Fail if either aKey is not found or it is associated to something different from a class.
Answer the value corrisponding to aKey if it is a class. Evaluate aBlock and answer its result if either aKey is not found or it is associated to something different from a class.
Next: AbstractNamespace-copying, Previous: AbstractNamespace-accessing, Up: AbstractNamespace [Index]
Import the given bindings for classes compiled with me as environment.
Import the given bindings for classes compiled with me as environment.
Remove aDictionary from my list of direct pools.
Answer the shared pools (not names) imported for my classes.
Next: AbstractNamespace-namespace hierarchy, Previous: AbstractNamespace-compiling, Up: AbstractNamespace [Index]
Answer an empty copy of the receiver whose size is newSize
Evaluate aBlock with the current namespace set to the receiver. Answer the result of the evaluation.
Next: AbstractNamespace-overrides for superspaces, Previous: AbstractNamespace-copying, Up: AbstractNamespace [Index]
Create a namespace named aSymbol, add it to the receiver’s subspaces, and answer it.
Invokes aBlock once for every association in each of the receiver’s subspaces.
Answer the direct and indirect subspaces of the receiver in a Set
Invokes aBlock for all subspaces, both direct and indirect.
Evaluate aBlock once for each of the receiver’s superspaces
Answer whether the receiver or any of its superspaces include the given class – note that this method (unlike #includesKey:) does not require aString to be interned and (unlike #includesGlobalNamed:) only returns true if the global is a class object.
Answer whether the receiver or any of its superspaces include the given key – note that this method (unlike #includesKey:) does not require aString to be interned but (unlike #includesClassNamed:) returns true even if the global is not a class object.
Remove my subspace named aSymbol from the hierarchy.
Return a Set of subspaces of the receiver satisfying aBlock.
Return a Set of superspaces of the receiver satisfying aBlock.
Answer all the other children of the same namespace as the receiver.
Evaluate aBlock once for each of the other root namespaces, passing the namespace as a parameter.
Answer the receiver’s direct subspaces
Invokes aBlock for all direct subspaces.
Answer the receiver’s superspace.
Set the superspace of the receiver to be ’aNamespace’. Also adds the receiver as a subspace of it.
Answer a Set containing the receiver together with its direct and indirect subspaces
Invokes aBlock for the receiver and all subclasses, both direct and indirect.
Next: AbstractNamespace-printing, Previous: AbstractNamespace-namespace hierarchy, Up: AbstractNamespace [Index]
Answer a Set of all the keys in the receiver and its superspaces
Assign newValue to the variable named as specified by ‘key’. This method won’t define a new variable; instead if the key is not found it will search in superspaces and raising an error if the variable cannot be found in any of the superspaces. Answer newValue.
Assign newValue to the variable named as specified by ‘key’. This method won’t define a new variable; instead if the key is not found it will search in superspaces and evaluate aBlock if it is not found. Answer newValue.
Answer a Bag containing the values of the receiver
Next: AbstractNamespace-testing, Previous: AbstractNamespace-overrides for superspaces, Up: AbstractNamespace [Index]
Answer the receiver’s name
Change the receiver’s name to aSymbol
Answer Smalltalk code compiling to the receiver when the current namespace is aNamespace
Print a representation of the receiver
Store Smalltalk code compiling to the receiver
Previous: AbstractNamespace-printing, Up: AbstractNamespace [Index]
Answer ‘true’.
Answer ‘false’.
Next: ArithmeticError, Previous: AbstractNamespace, Up: Base classes [Index]
I am a proxy that uses the same ObjectDumper to store an object which is not the object to be dumped, but from which the dumped object can be reconstructed. I am an abstract class, using me would result in infinite loops because by default I try to store the same object again and again. See the method comments for more information
• AlternativeObjectProxy class-instance creation: | (class) | |
• AlternativeObjectProxy-accessing: | (instance) |
Next: AlternativeObjectProxy-accessing, Up: AlternativeObjectProxy [Index]
The receiver was asked to be used as a proxy for the class aClass. Answer whether the registration is fine. By default, answer true except if AlternativeObjectProxy itself is being used.
Answer a proxy to be used to save anObject. IMPORTANT: this method MUST be overridden so that the overridden version sends #on: to super passing an object that is NOT the same as anObject (alternatively, you can override #dumpTo:, which is what NullProxy does), because that would result in an infinite loop! This also means that AlternativeObjectProxy must never be used directly – only as a superclass.
Previous: AlternativeObjectProxy class-instance creation, Up: AlternativeObjectProxy [Index]
Reconstruct the object stored in the proxy and answer it. A subclass will usually override this
Set the object to be dumped to theObject. This should not be overridden.
Reconstruct the object stored in the proxy and answer it. This method must not be overridden
Next: Array, Previous: AlternativeObjectProxy, Up: Base classes [Index]
An ArithmeticError exception is raised by numeric classes when a program tries to do something wrong, such as extracting the square root of a negative number.
• ArithmeticError-description: | (instance) |
Up: ArithmeticError [Index]
Answer a textual description of the exception.
Answer true. Arithmetic exceptions are by default resumable.
Next: ArrayedCollection, Previous: ArithmeticError, Up: Base classes [Index]
My instances are objects that have array-like properties: they are directly indexable by integers starting at 1, and they are fixed in size. I inherit object creation behavior messages such as #with:, as well as iteration and general access behavior from SequenceableCollection.
• Array class-instance creation: | (class) | |
• Array-built ins: | (instance) | |
• Array-mutating objects: | (instance) | |
• Array-printing: | (instance) | |
• Array-testing: | (instance) |
Next: Array-built ins, Up: Array [Index]
Answer anArray, which is expected to be an array specified with a brace-syntax expression per my inherited protocol.
Next: Array-mutating objects, Previous: Array class-instance creation, Up: Array [Index]
Answer the index-th indexed instance variable of the receiver
Replace the characters from start to stop with new characters whose ASCII codes are contained in byteArray, starting at the replaceStart location of byteArray
Next: Array-printing, Previous: Array-built ins, Up: Array [Index]
Transform every object in the receiver in each corresponding object in anArray. anArray and the receiver must have the same size
Next: Array-testing, Previous: Array-mutating objects, Up: Array [Index]
Answer whether the receiver is expressible as a Smalltalk literal.
Print a representation for the receiver on aStream
Store a Smalltalk literal compiling to the receiver on aStream
Store Smalltalk code compiling to the receiver on aStream
Previous: Array-printing, Up: Array [Index]
Answer ‘true’.
Next: Association, Previous: Array, Up: Base classes [Index]
My instances are objects that are generally fixed size, and are accessed by an integer index. The ordering of my instance’s elements is determined externally; I will not rearrange the order of the elements.
• ArrayedCollection class-instance creation: | (class) | |
• ArrayedCollection-basic: | (instance) | |
• ArrayedCollection-built ins: | (instance) | |
• ArrayedCollection-compiler: | (instance) | |
• ArrayedCollection-copying Collections: | (instance) | |
• ArrayedCollection-enumerating the elements of a collection: | (instance) | |
• ArrayedCollection-sorting: | (instance) | |
• ArrayedCollection-storing: | (instance) | |
• ArrayedCollection-streams: | (instance) |
Next: ArrayedCollection-basic, Up: ArrayedCollection [Index]
Where aCollection is a collection of SequenceableCollections, answer a new instance with all the elements therein, in order.
Where aCollection is a collection of SequenceableCollections, answer a new instance with all the elements therein, in order, each separated by an occurrence of sepCollection.
Answer a collection with the given size, whose elements are all set to anObject
Create a ReadWriteStream on an empty instance of the receiver; pass the stream to aBlock, then retrieve its contents and answer them.
Answer a collection whose only element is element1
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose elements are the same as those in aCollection
Next: ArrayedCollection-built ins, Previous: ArrayedCollection class-instance creation, Up: ArrayedCollection [Index]
Answer a new instance of an ArrayedCollection containing all the elements in the receiver, followed by all the elements in aSequenceableCollection
This method should not be called for instances of this class.
Answer a collection of the same kind returned by #collect:, that only includes the values at the given indices. Fail if any of the values in keyCollection is out of bounds for the receiver.
Answer a new collection containing all the items in the receiver from the start-th and to the stop-th
Answer a new instance of an ArrayedCollection containing all the elements in the receiver, followed by the single item anElement
Answer a copy of the receiver to which all occurrences of oldElement are removed
Next: ArrayedCollection-compiler, Previous: ArrayedCollection-basic, Up: ArrayedCollection [Index]
Answer the size of the receiver
Next: ArrayedCollection-copying Collections, Previous: ArrayedCollection-built ins, Up: ArrayedCollection [Index]
Not commented.
Not commented.
Next: ArrayedCollection-enumerating the elements of a collection, Previous: ArrayedCollection-compiler, Up: ArrayedCollection [Index]
Answer a new collection in which all the sequences matching oldSubCollection are replaced with newSubCollection
Answer a new collection of the same class as the receiver that contains the same elements as the receiver, in the same order, except for elements from index ‘start’ to index ‘stop’.
If start < stop, these are replaced by the contents of the replacementCollection. Instead, If start = (stop + 1), like in ‘copyReplaceFrom: 4 to: 3 with: anArray’, then every element of the receiver will be present in the answered copy; the operation will be an append if stop is equal to the size of the receiver or, if it is not, an insert before index ‘start’.
Answer a new collection of the same class as the receiver that contains the same elements as the receiver, in the same order, except for elements from index ‘start’ to index ‘stop’.
If start < stop, these are replaced by stop-start+1 copies of anObject. Instead, If start = (stop + 1), then every element of the receiver will be present in the answered copy; the operation will be an append if stop is equal to the size of the receiver or, if it is not, an insert before index ‘start’.
Answer the receivers’ contents in reverse order
Next: ArrayedCollection-sorting, Previous: ArrayedCollection-copying Collections, Up: ArrayedCollection [Index]
Answer a new instance of an ArrayedCollection containing all the results of evaluating aBlock passing each of the receiver’s elements
Answer a new instance of an ArrayedCollection containing all the elements in the receiver which, when passed to aBlock, answer false
Answer a new instance of an ArrayedCollection containing all the elements in the receiver which, when passed to aBlock, answer true
Evaluate aBlock for each pair of elements took respectively from the receiver and from aSequenceableCollection; answer a collection of the same kind of the receiver, made with the block’s return values. Fail if the receiver has not the same size as aSequenceableCollection.
Next: ArrayedCollection-storing, Previous: ArrayedCollection-enumerating the elements of a collection, Up: ArrayedCollection [Index]
Return a copy of the receiver sorted according to the default sort block, which uses #<= to compare items.
Return a copy of the receiver sorted according to the given sort block, which accepts pair of items and returns true if the first item is less than the second one.
Next: ArrayedCollection-streams, Previous: ArrayedCollection-sorting, Up: ArrayedCollection [Index]
Store Smalltalk code compiling to the receiver on aStream
Previous: ArrayedCollection-storing, Up: ArrayedCollection [Index]
Answer a WriteStream streaming on the receiver
Next: Autoload, Previous: ArrayedCollection, Up: Base classes [Index]
My instances represent a mapping between two objects. Typically, my "key" object is a symbol, but I don’t require this. My "value" object has no conventions associated with it; it can be any object at all.
• Association class-basic: | (class) | |
• Association-accessing: | (instance) | |
• Association-finalization: | (instance) | |
• Association-printing: | (instance) | |
• Association-storing: | (instance) | |
• Association-testing: | (instance) |
Next: Association-accessing, Up: Association [Index]
Answer a new association with the given key and value
Next: Association-finalization, Previous: Association class-basic, Up: Association [Index]
Answer nil. This is present to achieve polymorphism with instances of VariableBinding.
Do nothing. This is present to achieve polymorphism with instances of VariableBinding.
Set the association’s key to aKey, and its value to aValue
Answer the association’s value
Set the association’s value to aValue
Next: Association-printing, Previous: Association-accessing, Up: Association [Index]
Finalize the receiver
Next: Association-storing, Previous: Association-finalization, Up: Association [Index]
Put on aStream a representation of the receiver
Next: Association-testing, Previous: Association-printing, Up: Association [Index]
Put on aStream some Smalltalk code compiling to the receiver
Previous: Association-storing, Up: Association [Index]
Answer whether the association’s key and value are the same as anAssociation’s, or false if anAssociation is not an Association. As a special case, identical values are considered equal even if #= returns false (as is the case for NaN floating-point values).
Answer an hash value for the receiver
Next: Bag, Previous: Association, Up: Base classes [Index]
I am not a part of the normal Smalltalk kernel class system. I provide the ability to do late ("on-demand") loading of class definitions. Through me, you can define any class to be loaded when any message is sent to the class itself (such as to create an instance) or to its metaclass (such as #methodsFor: to extend it with class-side methods).
• Autoload class-instance creation: | (class) | |
• Autoload-accessing: | (instance) |
Next: Autoload-accessing, Up: Autoload [Index]
Make Smalltalk automatically load the class named nameSymbol from fileNameString when needed
Make Smalltalk automatically load the class named nameSymbol and residing in aNamespace from fileNameString when needed
Make Smalltalk automatically load the class named nameSymbol and residing in aNamespace. When the class is needed, anObject will be sent #autoload. By default, instances of FilePath and Package can be used.
Make Smalltalk automatically load the class named nameSymbol. When the class is needed, anObject will be sent #autoload. By default, instances of FilePath and Package can be used.
Previous: Autoload class-instance creation, Up: Autoload [Index]
We need it to access the metaclass instance, because that’s what will load the file.
Load the class and resend the message to it
Next: Behavior, Previous: Autoload, Up: Base classes [Index]
My instances are unordered collections of objects. You can think of me as a set with a memory; that is, if the same object is added to me twice, then I will report that that element has been stored twice.
• Bag class-basic: | (class) | |
• Bag-adding: | (instance) | |
• Bag-enumerating the elements of a collection: | (instance) | |
• Bag-extracting items: | (instance) | |
• Bag-printing: | (instance) | |
• Bag-removing: | (instance) | |
• Bag-storing: | (instance) | |
• Bag-testing collections: | (instance) |
Next: Bag-adding, Up: Bag [Index]
Answer a new instance of the receiver
Answer a new instance of the receiver, with space for size distinct objects
Next: Bag-enumerating the elements of a collection, Previous: Bag class-basic, Up: Bag [Index]
Add an occurrence of newObject to the receiver. Answer newObject. Fail if newObject is nil.
If anInteger > 0, add anInteger occurrences of newObject to the receiver. If anInteger < 0, remove them. Answer newObject. Fail if newObject is nil.
Next: Bag-extracting items, Previous: Bag-adding, Up: Bag [Index]
Answer a set with the elements of the receiver
Evaluate the block for all members in the collection.
Next: Bag-printing, Previous: Bag-enumerating the elements of a collection, Up: Bag [Index]
Answer a collection of counts with elements, sorted by decreasing count.
Next: Bag-removing, Previous: Bag-extracting items, Up: Bag [Index]
Put on aStream a representation of the receiver
Next: Bag-storing, Previous: Bag-printing, Up: Bag [Index]
Remove oldObject from the collection and return it. If can’t be found, answer instead the result of evaluationg anExceptionBlock
Next: Bag-testing collections, Previous: Bag-removing, Up: Bag [Index]
Put on aStream some Smalltalk code compiling to the receiver
Previous: Bag-storing, Up: Bag [Index]
Answer whether the receiver and aBag contain the same objects
Answer an hash value for the receiver
Answer whether we include anObject
Answer the number of occurrences of anObject found in the receiver
Answer the total number of objects found in the receiver
Next: BindingDictionary, Previous: Bag, Up: Base classes [Index]
I am the parent class of all "class" type methods. My instances know about the subclass/superclass relationships between classes, contain the description that instances are created from, and hold the method dictionary that’s associated with each class. I provide methods for compiling methods, modifying the class inheritance hierarchy, examining the method dictionary, and iterating over the class hierarchy.
Next: Behavior-accessing instances and variables, Up: Behavior [Index]
Answer the direct and indirect subclasses of the receiver in a Set
Answer all the receiver’s superclasses in a collection
Answer the direct subclasses of the receiver in a Set
Answer the receiver’s superclass (if any, otherwise answer nil)
Answer a Set containing the receiver together with its direct and indirect subclasses
Answer the receiver and all of its superclasses in a collection
Next: Behavior-accessing the method dictionary, Previous: Behavior-accessing class hierarchy, Up: Behavior [Index]
Return all the class variables understood by the receiver
Answer the names of every instance variables the receiver contained in the receiver’s instances
Returns a set of all instances of the receiver
Return the shared pools defined by the class and any of its superclasses, in the correct search order.
Return the names of the shared pools defined by the class and any of its superclasses, in the correct search order.
Answer the class pool dictionary. Since Behavior does not support classes with class variables, we answer an empty one; adding variables to it results in an error.
Answer all the class variables for instances of the receiver
Answer the index of aString in the fixed instance variables of the instances of the receiver, or 0 if the variable is missing.
Answer the index of aString in the fixed instance variables of the instances of the receiver, or 0 if the variable is missing.
Answer an Array containing the instance variables defined by the receiver
Return a count of all the instances of the receiver
Return the names of the shared pools defined by the class
Answer the names of the instance variables the receiver inherited from its superclass
Next: Behavior-built ins, Previous: Behavior-accessing instances and variables, Up: Behavior [Index]
Return the compiled method associated with selector, from the local method dictionary. Error if not found.
Answer a Set of all the selectors understood by the receiver
Return the compiled method associated with selector, from the local method dictionary. Error if not found.
Return the compiled method associated with selector, from the local method dictionary. Evaluate aBlock if not found.
Answer the method source code as a formatted string (if available) for the given selector. Requires package Parser.
Answer a Set of all the compiled method associated with selector. from the local method dictionary and all of the superclasses.
Return the compiled method associated with selector, from the local method dictionary or one of a superclass; return nil if not found.
Answer the parse tree for the given selector, or nil if there was an error. Requires the Parser package to be loaded.
Return selector for the given CompiledMethod
Answer a Set of the receiver’s selectors
Answer source code (if available) for the given selector.
Answer source code (if available) for the given selector.
This is too dependent on the original implementation
Next: Behavior-builtin, Previous: Behavior-accessing the method dictionary, Up: Behavior [Index]
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.
Create a new instance of a class with indexed instance variables. The instance has numInstanceVariables indexed instance variables. The instance is guaranteed not to move across garbage collections. Like #basicNew:, this method should not be overridden.
Invalidate the method cache kept by the virtual machine. This message should not need to be called by user programs.
Compile the following code inside the receiver, with the given category, if condition is true; else ignore it
Compile the code, a string or readable stream, with no category. Fail if the code does not obey Smalltalk syntax. Answer the generated CompiledMethod if it does.
Do not send this in user code; use #compile: or related methods instead.
As with #primCompile:, but evaluate aBlock (passing the file name, line number and description of the error) if the code does not obey Smalltalk syntax.
Do not send this in user code; use #compile:ifError: or related methods instead.
Private - Answer the first instance of the receiver in the object table
Next: Behavior-compilation, Previous: Behavior-built ins, Up: Behavior [Index]
Create a new instance of a class with no indexed instance variables; this method must not be overridden.
Create a new instance of a class with indexed instance variables. The instance has numInstanceVariables indexed instance variables; this method must not be overridden.
Create a new instance of a class with no indexed instance variables
Create a new instance of a class with indexed instance variables. The instance has numInstanceVariables indexed instance variables.
Next: Behavior-compilation (alternative), Previous: Behavior-builtin, Up: Behavior [Index]
Answer the dictionary that is used when the receiver is before a period in Smalltalk source code.
Next: Behavior-compiling, Previous: Behavior-compilation, Up: Behavior [Index]
Don’t use this, it’s only present to file in from Smalltalk/V
Don’t use this, it’s only present to file in from Dolphin Smalltalk
Start compiling methods in the receiver if this implementation of Smalltalk has the given features, else skip the section
Don’t use this, it’s only present to file in from Squeak
Don’t use this, it’s only present to file in from IBM Smalltalk
Don’t use this, it’s only present to file in from IBM Smalltalk
Next: Behavior-compiling methods, Previous: Behavior-compilation (alternative), Up: Behavior [Index]
Return the class that will be used to compile the parse nodes into bytecodes.
Next: Behavior-creating a class hierarchy, Previous: Behavior-compiling, Up: Behavior [Index]
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.
Answer a PoolResolution class to be used for resolving pool variables while compiling methods on this class.
Next: Behavior-enumerating, Previous: Behavior-compiling methods, Up: Behavior [Index]
Add aClass asone of the receiver’s subclasses.
Remove aClass from the list of the receiver’s subclasses
Set the receiver’s superclass.
Next: Behavior-evaluating, Previous: Behavior-creating a class hierarchy, Up: Behavior [Index]
Invokes aBlock for all instances of the receiver
Invokes aBlock for all subclasses, both direct and indirect.
Invokes aBlock for all instances of each of the receiver’s subclasses.
Invokes aBlock for all superclasses, both direct and indirect.
Return a Set of subclasses of the receiver satisfying aBlock.
Return a Set of superclasses of the receiver satisfying aBlock.
Invokes aBlock for all direct subclasses.
Invokes aBlock for the receiver and all subclasses, both direct and indirect.
Invokes aBlock for the receiver and all superclasses, both direct and indirect.
Next: Behavior-instance creation, Previous: Behavior-enumerating, Up: Behavior [Index]
Answer the stack top at the end of the evaluation of the code in aString. The code is executed as part of anObject
Answer the stack top at the end of the evaluation of the code in aString. If aString cannot be parsed, evaluate aBlock (see compile:ifError:). The code is executed as part of anObject
Evaluate Smalltalk expression in ’code’ and return result.
Evaluate ’code’. If a parsing error is detected, invoke ’block’
Evaluate Smalltalk expression in ’code’. If a parsing error is encountered, send #error: to requestor
Evaluate Smalltalk expression as part of anObject’s method definition
Evaluate Smalltalk expression as part of anObject’s method definition. This method is used to support Inspector expression evaluation. If a parsing error is encountered, invoke error block, ’block’
Next: Behavior-instance variables, Previous: Behavior-evaluating, Up: Behavior [Index]
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.
Create a new instance of a class with indexed instance variables. The instance has numInstanceVariables 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.
Next: Behavior-method dictionary, Previous: Behavior-instance creation, Up: Behavior [Index]
Add the given instance variable to instance of the receiver
Set the instance variables for the receiver to be those in instVarNames
Remove the given instance variable from the receiver and recompile all of the receiver’s subclasses
Next: Behavior-parsing class declarations, Previous: Behavior-instance variables, Up: Behavior [Index]
Add the given compiledMethod to the method dictionary, giving it the passed selector. Answer compiledMethod
Compile method source. If there are parsing errors, answer nil. Else, return a CompiledMethod result of compilation
Compile method source. If there are parsing errors, invoke exception block, ’block’ passing file name, line number and error. Return a CompiledMethod result of compilation
Compile method source. If there are parsing errors, send #error: to the requestor object, else return a CompiledMethod result of compilation
Recompile all selectors in the receiver. Ignore errors.
Recompile all selectors in the receiver. Notify aNotifier by sending #error: messages if something goes wrong.
Recompile all selector of all subclasses. Notify aNotifier by sending #error: messages if something goes wrong.
Recompile all selector of all subclasses. Notify aNotifier by sending #error: messages if something goes wrong.
Create a method accessing the variable ‘what’.
Create a method accessing the variable ‘what’, with a default value of ‘value’, using lazy initialization
Create a method which sets the variable ‘what’.
Decompile the bytecodes for the given selector.
Please lookup the part on the C interface in the manual. This method is deprecated, you should use the asyncCCall:args: attribute.
Please lookup the part on the C interface in the manual. This method is deprecated, you should use the cCall:returning:args: attribute.
Open Emacs to edit the method with the passed selector, then compile it
Answer the receiver’s method dictionary. Don’t modify the method dictionary unless you exactly know what you’re doing
Set the receiver’s method dictionary to aDictionary
Recompile the given selector, answer nil if something goes wrong or the new CompiledMethod if everything’s ok.
Recompile the given selector. If there are parsing errors, send #error: to the aNotifier object, else return a CompiledMethod result of compilation
Remove the given selector from the method dictionary, answer the CompiledMethod attached to that selector
Remove the given selector from the method dictionary, answer the CompiledMethod attached to that selector. If the selector cannot be found, answer the result of evaluating aBlock.
Evaluate aBlock, passing for each evaluation a selector that’s defined in the receiver and the corresponding method.
Next: Behavior-pluggable behavior (not yet implemented), Previous: Behavior-method dictionary, Up: Behavior [Index]
As with #parseVariableString:, but answer symbols that name the variables instead of strings.
Answer an array of instance variable names. aString should specify these in traditional file-in ‘instanceVariableNames’ format. Signal an error if aString contains something other than valid Smalltalk variables.
Next: Behavior-printing hierarchy, Previous: Behavior-parsing class declarations, Up: Behavior [Index]
Answer which class is to be used to debug a chain of contexts which includes the receiver. nil means ’do not debug’; other classes are sent #debuggingPriority and the one with the highest priority is picked.
Answer the class that can be used to decompile methods, or nil if there is none (as is the case now).
Answer the class that can be used to evaluate doits, or nil if there is none (as is the case now).
Answer the class that can be used to parse methods, or nil if there is none (as is the case now).
Next: Behavior-source code, Previous: Behavior-pluggable behavior (not yet implemented), Up: Behavior [Index]
Answer the indent to be used by #printHierarchy - 4 by default
Print my full hierarchy (i.e. all my superclasses and subclasses) on the terminal.
Print my entire subclass hierarchy on the terminal.
Next: Behavior-still unclassified, Previous: Behavior-printing hierarchy, Up: Behavior [Index]
Answer the method source code as a formatted string. Requires package Parser.
Next: Behavior-support for lightweight classes, Previous: Behavior-source code, Up: Behavior [Index]
Answer the shared pools visible from methods in the metaclass, in the correct search order.
Available only when the Parser package is loaded–Answer an RBMethodNode that compiles to my method named by selector.
Update instance variables and instance spec of the class and all its subclasses. variableArray lists the new variables, including inherited ones.
Next: Behavior-testing functionality, Previous: Behavior-still unclassified, Up: Behavior [Index]
Answer an article (‘a’ or ‘an’) which is ok for the receiver’s name
Answer the first superclass that is a full-fledged Class object
Answer the namespace that this class belongs to - the same as the superclass, since Behavior does not support namespaces yet.
Answer the class name; this prints to the name of the superclass enclosed in braces. This class name is used, for example, to print the receiver.
Answer the class name when the class is referenced from aNamespace - a dummy one, since Behavior does not support names.
Answer the class name when the class is referenced from aNamespace - a dummy one, since Behavior does not support names.
Not commented.
This method should not be called for instances of this class.
Next: Behavior-testing the class hierarchy, Previous: Behavior-support for lightweight classes, Up: Behavior [Index]
Answer ‘true’.
Next: Behavior-testing the form of the instances, Previous: Behavior-testing functionality, Up: Behavior [Index]
Returns true if aClass is the receiver or a superclass of the receiver.
Returns true if aClass is a superclass of the receiver
Return a string indicating the type of class the receiver is
Answer the symbolic shape of my instances.
Give the provided shape to the receiver’s instances. The shape can be nil, or one of #byte #int8 #character #short #word #ushort #int #uint #int64 #uint64 #utf32 #float #double or #pointer. In addition, the special value #inherit means to use the shape of the superclass; note however that this is a static setting, and subclasses that used #inherit are not mutated when the superclass adopts a different shape.
Next: Behavior-testing the method dictionary, Previous: Behavior-testing the class hierarchy, Up: Behavior [Index]
Answer how many fixed instance variables are reserved to each of the receiver’s instances
Answer whether my instances’ variables are immediate, non-OOP values.
Answer whether the receiver’s instances have no indexed instance variables
Answer whether x = y implies x == y for instances of the receiver
Answer whether, if x is an instance of the receiver, x copy == x
Answer whether the instance variables of the receiver’s instances are objects
Answer whether the receiver’s instances have indexed instance variables
Previous: Behavior-testing the form of the instances, Up: Behavior [Index]
Returns true if the instances of the receiver understand the given selector
Return whether the receiver has any methods defined
Returns true if the local method dictionary contains the given selector
If methods understood by the receiver’s instances have access to a symbol named ’name’, evaluate aBlock
Answer which class in the receiver’s hierarchy contains the implementation of selector used by instances of the class (nil if none does)
Answer a Set of selectors which access the given instance variable
Answer a Set of selectors which read the given instance variable
Answer a Set of selectors which read the given instance variable
Returns a Set of selectors that refer to anObject
Return the collection of selectors in the class which reference the byte code, aByteCode
Next: BlockClosure, Previous: Behavior, Up: Base classes [Index]
I am a special form of dictionary that provides special ways to access my keys, which typically begin with an uppercase letter; also, my associations are actually VariableBinding instances.
My keys are (expected to be) symbols, so I use == to match searched keys to those in the dictionary – this is done expecting that it brings a bit more speed.
• BindingDictionary-accessing: | (instance) | |
• BindingDictionary-basic & copying: | (instance) | |
• BindingDictionary-copying: | (instance) | |
• BindingDictionary-forward declarations: | (instance) | |
• BindingDictionary-printing: | (instance) | |
• BindingDictionary-testing: | (instance) |
Next: BindingDictionary-basic & copying, Up: BindingDictionary [Index]
Define aSymbol as equal to nil inside the receiver. Fail if such a variable already exists (use #at:put: if you don’t want to fail)
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 an uppercase first letter; and b) ‘aNamespace Variable: value’ is the same as ‘aNamespace set: #Variable to: value’, not the same as ‘aNamespace at: #Variable put: value’ — the latter always refers to the current namespace, while the former won’t define a new variable, instead searching in superspaces (and raising an error if the variable cannot be found).
Answer the environment to which the receiver is connected. This can be the class for a dictionary that holds class variables, or the super-namespace. In general it is used to compute the receiver’s name.
Set the environment to which the receiver is connected. This can be the class for a dictionary that holds class variables, or the super-namespace. In general it is used to compute the receiver’s name.
Add to the receiver the symbol aSymbol, associated to the same value as in aNamespace. Fail if aNamespace does not contain the given key.
Answer the receiver’s name, which by default is the same as the name of the receiver’s environment.
Answer the receiver’s name when referred to from aNamespace; by default the computation is deferred to the receiver’s environment.
Next: BindingDictionary-copying, Previous: BindingDictionary-accessing, Up: BindingDictionary [Index]
Answer whether the receiver is equal to arg. The equality test is by default the same as that for equal objects. = must not fail; answer false if the receiver cannot be compared to arg
Answer an hash value for the receiver. This is the same as the object’s #identityHash.
Next: BindingDictionary-forward declarations, Previous: BindingDictionary-basic & copying, Up: BindingDictionary [Index]
Answer the receiver.
Answer an empty copy of the receiver whose size is newSize
Answer an empty copy of the receiver which is filled in to compute the result of #collect:
Answer an empty copy of the receiver which is filled in to compute the result of #collect:
Answer the receiver.
Answer the receiver.
Next: BindingDictionary-printing, Previous: BindingDictionary-copying, Up: BindingDictionary [Index]
Store value as associated to the given key. If any, recycle Associations temporarily stored by the compiler inside the ‘Undeclared’ dictionary.
Next: BindingDictionary-testing, Previous: BindingDictionary-forward declarations, Up: BindingDictionary [Index]
Print the receiver’s name when referred to from aNamespace; by default the computation is deferred to the receiver’s environment.
Previous: BindingDictionary-printing, Up: BindingDictionary [Index]
Answer ‘IdentityDictionary’.
Next: BlockContext, Previous: BindingDictionary, Up: Base classes [Index]
I am a factotum class. My instances represent Smalltalk blocks, portions of executeable code that have access to the environment that they were declared in, take parameters, and can be passed around as objects to be executed by methods outside the current class. Block closures are sent a message to compute their value and create a new execution context; this property can be used in the construction of control flow methods. They also provide some methods that are used in the creation of Processes from blocks.
• BlockClosure class-instance creation: | (class) | |
• BlockClosure class-testing: | (class) | |
• BlockClosure-accessing: | (instance) | |
• BlockClosure-built ins: | (instance) | |
• BlockClosure-control structures: | (instance) | |
• BlockClosure-exception handling: | (instance) | |
• BlockClosure-multiple process: | (instance) | |
• BlockClosure-overriding: | (instance) | |
• BlockClosure-testing: | (instance) | |
• BlockClosure-unwind protection: | (instance) |
Next: BlockClosure class-testing, Up: BlockClosure [Index]
Answer a BlockClosure that activates the passed CompiledBlock.
Answer a BlockClosure that activates the passed CompiledBlock with the given receiver.
Answer a BlockClosure that activates the passed CompiledBlock with the given receiver.
Answer a BlockClosure for a new CompiledBlock that is created using the passed parameters. To make it work, you must put the BlockClosure into a CompiledMethod’s literals.
Next: BlockClosure-accessing, Previous: BlockClosure class-instance creation, Up: BlockClosure [Index]
Answer whether, if x is an instance of the receiver, x copy == x
Next: BlockClosure-built ins, Previous: BlockClosure class-testing, Up: BlockClosure [Index]
Answer the number of arguments passed to the receiver
Answer the CompiledBlock which contains the receiver’s bytecodes
Set the CompiledBlock which contains the receiver’s bytecodes
Answer the last instruction that can be executed by the receiver
This should fix the values of the temporary variables used in the block that are ordinarily shared with the method in which the block is defined. Not defined yet, but it is not harmful that it isn’t. Answer the receiver.
Answer the initial instruction pointer into the receiver.
Answer the CompiledMethod in which the receiver lies
Answer the number of arguments passed to the receiver
Answer the number of temporary variables used by the receiver
Answer the method/block context which is the immediate outer of the receiver
Set the method/block context which is the immediate outer of the 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...)
Set the object that is used as ‘self’ when executing the receiver
Answer the number of stack slots needed for the receiver
Next: BlockClosure-control structures, Previous: BlockClosure-accessing, Up: BlockClosure [Index]
Evaluate the receiver, passing arg1 as the only parameter if the receiver has parameters.
Evaluate the receiver, passing arg1 and arg2 as parameters if the receiver accepts them.
Evaluate the receiver, passing arg1, arg2 and arg3 as parameters if the receiver accepts them.
Evaluate the receiver passing no parameters
Evaluate the receiver passing arg1 as the only parameter
Evaluate the receiver passing arg1 and arg2 as the parameters
Evaluate the receiver passing arg1, arg2 and arg3 as the parameters
Evaluate the receiver passing argArray’s elements as the parameters
Next: BlockClosure-exception handling, Previous: BlockClosure-built ins, Up: BlockClosure [Index]
Evaluate the receiver ’forever’ (actually until a return is executed or the process is terminated).
Evaluate the receiver until it returns true
Evaluate the receiver. If it returns false, evaluate aBlock and restart
Evaluate the receiver until it returns false
Evaluate the receiver. If it returns true, evaluate aBlock and restart
Next: BlockClosure-multiple process, Previous: BlockClosure-control structures, Up: BlockClosure [Index]
Evaluate the receiver; when #error: is called, pass to aBlock the receiver and the parameter, and answer the result of evaluating aBlock. If another exception is raised, it is passed to an outer handler; if no exception is raised, the result of evaluating the receiver is returned.
Evaluate the receiver; when anException is signaled, evaluate aBlock passing a Signal describing the exception. Answer either the result of evaluating the receiver or the parameter of a Signal>>#return:
Evaluate the receiver; when e1 or e2 are signaled, evaluate respectively b1 or b2, passing a Signal describing the exception. Answer either the result of evaluating the receiver or the argument of a Signal>>#return:
Evaluate the receiver; when e1, e2 or e3 are signaled, evaluate respectively b1, b2 or b3, passing a Signal describing the exception. Answer either the result of evaluating the receiver or the parameter of a Signal>>#return:
Evaluate the receiver; when e1, e2, e3 or e4 are signaled, evaluate respectively b1, b2, b3 or b4, passing a Signal describing the exception. Answer either the result of evaluating the receiver or the parameter of a Signal>>#return:
Evaluate the receiver; when e1, e2, e3, e4 or e5 are signaled, evaluate respectively b1, b2, b3, b4 or b5, passing a Signal describing the exception. Answer either the result of evaluating the receiver or the parameter of a Signal>>#return:
Next: BlockClosure-overriding, Previous: BlockClosure-exception handling, Up: BlockClosure [Index]
Create a new process executing the receiver and start it
Create a new process executing the receiver with given priority and start it
Evaluate the receiver in a process that cannot be preempted. If the receiver expect a parameter, pass the current process.
Create a new process executing the receiver in suspended state. The priority is the same as for the calling process. The receiver must not contain returns
Create a new process executing the receiver with the passed arguments, and leave it in suspended state. The priority is the same as for the calling process. The receiver must not contain returns
Evaluate aBlock and delay all interrupts that are requested to the active process during its execution to after aBlock returns.
Evaluate the receiver with external interrupts disabled. This effectively disables preemption as long as the block does not explicitly yield control, wait on semaphores, and the like.
Next: BlockClosure-testing, Previous: BlockClosure-multiple process, Up: BlockClosure [Index]
Answer the receiver.
Answer a shallow copy.
Next: BlockClosure-unwind protection, Previous: BlockClosure-overriding, Up: BlockClosure [Index]
Answer whether the block contains a method return
Previous: BlockClosure-testing, Up: BlockClosure [Index]
Evaluate the receiver; when any exception is signaled exit returning the result of evaluating aBlock; if no exception is raised, return the result of evaluating aBlock when the receiver has ended
Evaluate the receiver; if its execution triggers an unwind which truncates the execution of the block (‘curtails’ the block), evaluate aBlock. The three cases which can curtail the execution of the receiver are: a non-local return in the receiver, a non-local return in a block evaluated by the receiver which returns past the receiver itself, and an exception raised and not resumed during the execution of the receiver.
Evaluate the receiver. Any errors caused by the block will cause a backtrace, 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 in very special cases (as a rule of thumb, use it only when the corresponding C code uses the _gst_prepare_execution_environment and _gst_finish_execution_environment functions). You should usually rely on #ensure: and #on:do:.
Next: Boolean, Previous: BlockClosure, Up: Base classes [Index]
My instances represent executing Smalltalk blocks, which are portions of executeable code that have access to the environment that they were declared in, take parameters, and result from BlockClosure objects created to be executed by methods outside the current class. Block contexts are created by messages sent to compute a closure’s value. They contain a stack and also provide some methods that can be used in inspection or debugging.
• BlockContext-accessing: | (instance) | |
• BlockContext-debugging: | (instance) | |
• BlockContext-printing: | (instance) |
Next: BlockContext-debugging, Up: BlockContext [Index]
Answer the context that called the receiver
Answer the MethodContext to which the receiver refers, or nil if it has been optimized away
Answer whether the receiver is a block context
Answers false, because contexts that are skipped when doing a return are always MethodContexts. BlockContexts are removed from the chain whenever a non-local return is done, while MethodContexts need to stay there in case there is a non-local return from the #ensure: block.
To create a valid execution environment for the interpreter even before it starts, GST creates a fake context whose selector is nil and which can be used as a marker for the current execution environment. Answer whether the receiver is that kind of context (always false, since those contexts are always MethodContexts).
Answers whether the context must continue execution even after a non-local return (a return from the enclosing method of a block, or a call to the #continue: method of ContextPart). Such contexts are created only by #ensure: and are always MethodContexts.
Answer the n-th outer block/method context for the receiver
Answer the outer block/method context for the receiver
Next: BlockContext-printing, Previous: BlockContext-accessing, Up: BlockContext [Index]
Answer whether the receiver is a context that should be hidden to the user when presenting a backtrace. Such contexts are never blocks, but check the rest of the chain.
Previous: BlockContext-debugging, Up: BlockContext [Index]
Print a representation for the receiver on aStream
Next: ByteArray, Previous: BlockContext, Up: Base classes [Index]
I have two instances in the Smalltalk system: true and false. I provide methods that are conditional on boolean values, such as conditional execution and loops, and conditional testing, such as conditional and and conditional or. I should say that I appear to provide those operations; my subclasses True and False actually provide those operations.
• Boolean class-testing: | (class) | |
• Boolean-basic: | (instance) | |
• Boolean-C hacks: | (instance) | |
• Boolean-overriding: | (instance) | |
• Boolean-storing: | (instance) |
Next: Boolean-basic, Up: Boolean [Index]
Answer whether x = y implies x == y for instances of the receiver
Answer whether, if x is an instance of the receiver, x copy == x
Next: Boolean-C hacks, Previous: Boolean class-testing, Up: Boolean [Index]
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
This method’s functionality should be implemented by subclasses of Boolean
Next: Boolean-overriding, Previous: Boolean-basic, Up: Boolean [Index]
This method’s functionality should be implemented by subclasses of Boolean
Next: Boolean-storing, Previous: Boolean-C hacks, Up: Boolean [Index]
Answer the receiver.
Answer the receiver.
Previous: Boolean-overriding, Up: Boolean [Index]
Answer whether the receiver is expressible as a Smalltalk literal.
Store on aStream some Smalltalk code which compiles to the receiver
Store on aStream some Smalltalk code which compiles to the receiver
Next: CAggregate, Previous: Boolean, Up: Base classes [Index]
My instances are similar to strings in that they are both represented as a sequence of bytes, but my individual elements are integers, where as a String’s elements are characters.
• ByteArray class-instance creation: | (class) | |
• ByteArray-basic: | (instance) | |
• ByteArray-built ins: | (instance) | |
• ByteArray-CObject: | (instance) | |
• ByteArray-converting: | (instance) | |
• ByteArray-more advanced accessing: | (instance) | |
• ByteArray-storing: | (instance) |
Next: ByteArray-basic, Up: ByteArray [Index]
Answer a ByteArray containing anInteger bytes starting at the location pointed to by aCObject
Next: ByteArray-built ins, Previous: ByteArray class-instance creation, Up: ByteArray [Index]
Answer whether the receiver’s items match those in aCollection
Answer the first index > anIndex which contains anElement. Invoke exceptionBlock and answer its result if no item is found
Answer the first index > anIndex which contains anElement. Invoke exceptionBlock and answer its result if no item is found
Next: ByteArray-CObject, Previous: ByteArray-basic, Up: ByteArray [Index]
Allocate memory with malloc for a copy of the receiver, and return it converted to a CObject with the given type
Answer the index-th indexed instance variable of the receiver
Answer the index-th indexed instance variable of the receiver
Store the ‘value’ byte in the index-th indexed instance variable of the receiver
Answer an hash value for the receiver
Replace the characters from start to stop with the bytes contained in aByteArray (which, actually, can be any variable byte class), starting at the replaceStart location of aByteArray
Replace the characters from start to stop with the ASCII codes contained in aString (which, actually, can be any variable byte class), starting at the replaceStart location of aString
Next: ByteArray-converting, Previous: ByteArray-built ins, Up: ByteArray [Index]
Allocate memory with malloc for a copy of the receiver, and return a pointer to it as a CByte.
Give access to the receiver as a value with the given CType.
Next: ByteArray-more advanced accessing, Previous: ByteArray-CObject, Up: ByteArray [Index]
Answer a String whose character’s ASCII codes are the receiver’s contents
Answer a UnicodeString whose character’s codes are the receiver’s contents. This is not implemented unless you load the I18N package.
Next: ByteArray-storing, Previous: ByteArray-converting, Up: ByteArray [Index]
Access the C 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.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.
Access the C double at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Float object identified by ‘value’, at the given index in the receiver, writing it like a C double. Indices are 1-based just like for other Smalltalk access.
Access the C float at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Float object identified by ‘value’, at the given index in the receiver, writing it like a C float. Indices are 1-based just like for other Smalltalk access.
Access the C int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C long double at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Float object identified by ‘value’, at the given index in the receiver, writing it like a C double. Indices are 1-based just like for other Smalltalk access.
Access the Smalltalk object (OOP) at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store a pointer (OOP) to the Smalltalk object identified by ‘value’, at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Access the C short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.
Access the string pointed by the C ‘char *’ at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk String object identified by ‘value’, at the given index in the receiver, writing it like a *FRESHLY ALLOCATED* C string. It is the caller’s responsibility to free it if necessary. Indices are 1-based just like for other Smalltalk access.
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.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.
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.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.
Access the C unsigned short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.
Store the Smalltalk Integer object identified by ‘value’, at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.
Previous: ByteArray-more advanced accessing, Up: ByteArray [Index]
Answer whether the receiver is expressible as a Smalltalk literal.
Put a Smalltalk literal evaluating to the receiver on aStream.
Put Smalltalk code evaluating to the receiver on aStream.
Next: CallinProcess, Previous: ByteArray, Up: Base classes [Index]
• CAggregate class-accessing: | (class) | |
• CAggregate-accessing: | (instance) |
Next: CAggregate-accessing, Up: CAggregate [Index]
Answer the receiver’s instances required aligment
Answer the receiver’s instances size
Previous: CAggregate class-accessing, Up: CAggregate [Index]
Answer the type over which the receiver is constructed.
Next: CArray, Previous: CAggregate, Up: Base classes [Index]
I represent a unit of computation for which external C code requested execution, so I must store the returned value once my computation terminates and I must not survive across image saves (since those who invoked me no longer exist). I am otherwise equivalent to a Process.
• CallinProcess-debugging: | (instance) |
Up: CallinProcess [Index]
Continue running the receiver as a normal Process, and return nil from the callin.
Next: CArrayCType, Previous: CallinProcess, Up: Base classes [Index]
• CArray-accessing: | (instance) |
Answer the receiver’s required aligment
Answer the receiver’s size
Next: CBoolean, Previous: CArray, Up: Base classes [Index]
• CArrayCType class-instance creation: | (class) | |
• CArrayCType-accessing: | (instance) | |
• CArrayCType-basic: | (instance) | |
• CArrayCType-storing: | (instance) |
Next: CArrayCType-accessing, Up: CArrayCType [Index]
This method should not be called for instances of this class.
Answer a new instance of CPtrCType that maps an array whose elements are of the given CType, and whose size is exactly anInteger elements (of course, anInteger only matters for allocation, not for access, since no out-of-bounds protection is provided for C objects).
Private - Called by CType>>from: for arrays
Next: CArrayCType-basic, Previous: CArrayCType class-instance creation, Up: CArrayCType [Index]
Answer the alignment of the receiver’s instances
Answer the number of elements in the receiver’s instances
Answer the size of the receiver’s instances
Next: CArrayCType-storing, Previous: CArrayCType-accessing, Up: CArrayCType [Index]
Return whether the receiver and anObject are equal.
Return a hash code for the receiver.
Previous: CArrayCType-basic, Up: CArrayCType [Index]
As with super.
Next: CByte, Previous: CArrayCType, Up: Base classes [Index]
I return true if a byte is not zero, false otherwise.
• CBoolean class-conversion: | (class) | |
• CBoolean-accessing: | (instance) |
Next: CBoolean-accessing, Up: CBoolean [Index]
Answer a CType for the receiver
Previous: CBoolean class-conversion, Up: CBoolean [Index]
Get the receiver’s value - answer true if it is != 0, false if it is 0.
Set the receiver’s value - it’s the same as for CBytes, but we get a Boolean, not a Character
Next: CCallable, Previous: CBoolean, Up: Base classes [Index]
You know what a byte is, don’t you?!?
• CByte class-conversion: | (class) | |
• CByte-accessing: | (instance) |
Next: CByte-accessing, Up: CByte [Index]
Nothing special in the default case - answer a CType for the receiver
Answer a CType for the receiver
Previous: CByte class-conversion, Up: CByte [Index]
Nothing special in the default case - answer the receiver’s CType
Answer the value the receiver is pointing to. The returned value is a SmallInteger
Set the receiver to point to the value, aValue (a SmallInteger).
Next: CCallbackDescriptor, Previous: CByte, Up: Base classes [Index]
I am not part of the Smalltalk definition. My instances contain information about C functions that can be called from within Smalltalk, such as number and type of parameters. This information is used by the C callout mechanism to perform the actual call-out to C routines.
• CCallable class-instance creation: | (class) | |
• CCallable-accessing: | (instance) | |
• CCallable-calling: | (instance) | |
• CCallable-restoring: | (instance) |
Next: CCallable-accessing, Up: CCallable [Index]
Answer a CFunctionDescriptor with the given address, return type and arguments. The address will be reset to NULL upon image save (and it’s the user’s task to figure out a way to reinitialize it!)
Next: CCallable-calling, Previous: CCallable class-instance creation, Up: CCallable [Index]
Answer whether the object represents a valid function.
Not commented.
Next: CCallable-restoring, Previous: CCallable-accessing, Up: CCallable [Index]
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 the function calls back into Smalltalk the process that started the call-out is not suspended.
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 of aContext. Asynchronous call-outs don’t return a value, but if the function calls back into Smalltalk the process that started the call-out is not suspended. Unlike #asyncCallFrom:, this method does not attempt to find functions in shared objects.
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, and the the result is stored into aValueHolder. aValueHolder is also returned.
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 of aContext, and the result is stored into aValueHolder. aValueHolder is also returned. Unlike #callFrom:into:, this method does not attempt to find functions in shared objects.
Previous: CCallable-calling, Up: CCallable [Index]
Rebuild the object after the image is restarted.
Next: CChar, Previous: CCallable, Up: Base classes [Index]
I am not part of the Smalltalk definition. My instances are able to convert blocks into C functions that can be passed to C.
• CCallbackDescriptor class-instance creation: | (class) | |
• CCallbackDescriptor-accessing: | (instance) | |
• CCallbackDescriptor-restoring: | (instance) |
Next: CCallbackDescriptor-accessing, Up: CCallbackDescriptor [Index]
Answer a CCallbackDescriptor with the given block, return type and arguments.
Next: CCallbackDescriptor-restoring, Previous: CCallbackDescriptor class-instance creation, Up: CCallbackDescriptor [Index]
Answer the block of the function represented by the receiver.
Set the block of the function represented by the receiver.
Previous: CCallbackDescriptor-accessing, Up: CCallbackDescriptor [Index]
Make the address of the function point to the registered address.
Next: CCompound, Previous: CCallbackDescriptor, Up: Base classes [Index]
• CChar class-accessing: | (class) | |
• CChar-accessing: | (instance) | |
• CChar-conversion: | (instance) |
Next: CChar-accessing, Up: CChar [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Next: CChar-conversion, Previous: CChar class-accessing, Up: CChar [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Previous: CChar-accessing, Up: CChar [Index]
Convert size bytes pointed to by the receiver to a String
Convert the data pointed to by the receiver, up to the first NULL byte, to a String
Convert size bytes pointed to by the receiver to a String
Next: CDouble, Previous: CChar, Up: Base classes [Index]
• CCompound class-instance creation: | (class) | |
• CCompound class-subclass creation: | (class) | |
• CCompound-debugging: | (instance) |
Next: CCompound class-subclass creation, Up: CCompound [Index]
Allocate a new instance of the receiver, backed by garbage-collected storage.
Allocate a new instance of the receiver. To free the memory after GC, remember to call #addToBeFinalized.
Next: CCompound-debugging, Previous: CCompound class-instance creation, Up: CCompound [Index]
Answer 1, the alignment of an empty struct
Return the pragmas that are written in the file-out of this class.
Private - Compile sizeof and alignof methods
Return the description of the fields in the receiver class.
This method’s functionality should be implemented by subclasses of CCompound
Compile methods that implement the declaration in array. To compute the offset after each field, the value of the old offset plus the new field’s size is passed to aBlock, together with the new field’s alignment requirements.
Private - Emit onto the given stream the code for adding the given selector to the CCompound’s #examineOn: method.
The old way to create a CStruct. Superseded by #subclass:declaration:...
Answer 0, the size of an empty struct
Create a new class with the given name that contains code to 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
Previous: CCompound class-subclass creation, Up: CCompound [Index]
Print the contents of the receiver’s fields on aStream
Answer a list of selectors whose return values should be printed by #examineOn:.
Next: CFloat, Previous: CCompound, Up: Base classes [Index]
• CDouble class-accessing: | (class) | |
• CDouble-accessing: | (instance) |
Next: CDouble-accessing, Up: CDouble [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CDouble class-accessing, Up: CDouble [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CFunctionDescriptor, Previous: CDouble, Up: Base classes [Index]
• CFloat class-accessing: | (class) | |
• CFloat-accessing: | (instance) |
Next: CFloat-accessing, Up: CFloat [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CFloat class-accessing, Up: CFloat [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: Character, Previous: CFloat, Up: Base classes [Index]
I am not part of the Smalltalk definition. My instances contain information about C functions that can be called from within Smalltalk, such as number and type of parameters. This information is used by the C callout mechanism to perform the actual call-out to C routines.
• CFunctionDescriptor class-instance creation: | (class) | |
• CFunctionDescriptor class-testing: | (class) | |
• CFunctionDescriptor-accessing: | (instance) | |
• CFunctionDescriptor-printing: | (instance) | |
• CFunctionDescriptor-restoring: | (instance) |
Next: CFunctionDescriptor class-testing, Up: CFunctionDescriptor [Index]
Answer a CFunctionDescriptor with the given function name, return type and arguments. funcName must be a String.
Next: CFunctionDescriptor-accessing, Previous: CFunctionDescriptor class-instance creation, Up: CFunctionDescriptor [Index]
Answer whether a function is registered (on the C side) with the given name or is dynamically loadable.
Answer whether a function is registered (on the C side) with the given name.
Next: CFunctionDescriptor-printing, Previous: CFunctionDescriptor class-testing, Up: CFunctionDescriptor [Index]
Answer the name of the function (on the C side) represented by the receiver
Set the name of the function (on the C side) represented by the receiver
Next: CFunctionDescriptor-restoring, Previous: CFunctionDescriptor-accessing, Up: CFunctionDescriptor [Index]
Print a representation of the receiver onto aStream
Previous: CFunctionDescriptor-printing, Up: CFunctionDescriptor [Index]
Make the address of the function point to the registered address.
Next: CharacterArray, Previous: CFunctionDescriptor, Up: Base classes [Index]
My instances represent the 256 characters of the character set. I provide messages to translate between integers and character objects, and provide names for some of the common unprintable characters.
Character is always used (mostly for performance reasons) when referring to 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 of encoding of a character, while UnicodeCharacter refers to the character itself.
• Character class-built ins: | (class) | |
• Character class-constants: | (class) | |
• Character class-initializing lookup tables: | (class) | |
• Character class-instance creation: | (class) | |
• Character class-testing: | (class) | |
• Character-built ins: | (instance) | |
• Character-coercion methods: | (instance) | |
• Character-comparing: | (instance) | |
• Character-converting: | (instance) | |
• Character-printing: | (instance) | |
• Character-storing: | (instance) | |
• Character-testing: | (instance) | |
• Character-testing functionality: | (instance) |
Next: Character class-constants, Up: Character [Index]
Returns the character object corresponding to anInteger. Error if anInteger is not an integer, or not in 0..127.
Returns the character object, possibly an UnicodeCharacter, corresponding to anInteger. Error if anInteger is not an integer, or not in 0..16r10FFFF.
Returns the character object corresponding to anInteger. Error if anInteger is not an integer, or not in 0..255.
Next: Character class-initializing lookup tables, Previous: Character class-built ins, Up: Character [Index]
Returns the character ’backspace’
Returns the character ’bel’
Returns the character ’cr’
Returns the character ’eof’, also known as ’sub’
Returns the character ’eot’, also known as ’Ctrl-D’
Returns the character ’esc’
Returns the character ’ff’, also known as ’newPage’
Returns the character ’lf’, also known as ’nl’
Returns the character ’newPage’, also known as ’ff’
Returns the character ’nl’, also known as ’lf’
Returns the character ’nul’
Returns the character ’space’
Returns the character ’tab’
Next: Character class-instance creation, Previous: Character class-constants, Up: Character [Index]
Initialize the lookup table which is used to make case and digit-to-char conversions faster. Indices in Table are ASCII values incremented by one. Indices 1-256 classify 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.
Next: Character class-testing, Previous: Character class-initializing lookup tables, Up: Character [Index]
Returns a character that corresponds to anInteger. 0-9 map to $0-$9, 10-35 map to $A-$Z
Next: Character-built ins, Previous: Character class-instance creation, Up: Character [Index]
Answer whether, if x is an instance of the receiver, x copy == x
Next: Character-coercion methods, Previous: Character class-testing, Up: Character [Index]
Boolean return value; true if the characters are equal
Returns the integer value corresponding to self. #codePoint, #asciiValue, #value, and #asInteger are synonyms.
Returns the integer value corresponding to self. #codePoint, #asciiValue, #value, and #asInteger are synonyms.
Returns the integer value corresponding to self. #codePoint, #asciiValue, #value, and #asInteger are synonyms.
Returns the integer value corresponding to self. #codePoint, #asciiValue, #value, and #asInteger are synonyms.
Next: Character-comparing, Previous: Character-built ins, Up: Character [Index]
Returns a String with aNumber occurrences of the receiver.
Returns self as a lowercase character if it’s an uppercase letter, otherwise returns the character unchanged.
Returns the character self as a string. Only valid if the character is between 0 and 255.
Returns the character self as a symbol.
Returns the character self as a Unicode string.
Returns self as a uppercase character if it’s an lowercase letter, otherwise returns the character unchanged.
Next: Character-converting, Previous: Character-coercion methods, Up: Character [Index]
Compare the character’s ASCII value. Answer whether the receiver’s is the least.
Compare the character’s ASCII value. Answer whether the receiver’s is the least or their equal.
Compare the character’s ASCII value. Answer whether the receiver’s is the greatest.
Compare the character’s ASCII value. Answer whether the receiver’s is the greatest or their equal.
Next: Character-printing, Previous: Character-comparing, Up: Character [Index]
Return the receiver, since it is already a character.
Returns the value of self interpreted as a digit. Here, ’digit’ means either 0-9, or A-Z, which maps to 10-35.
Next: Character-storing, Previous: Character-converting, Up: Character [Index]
Print a representation of the receiver on aStream. Unlike #printOn:, this method strips the leading dollar.
Print a representation of the receiver on aStream
Store on aStream some Smalltalk code which compiles to the receiver
Next: Character-testing, Previous: Character-printing, Up: Character [Index]
Answer whether the receiver is expressible as a Smalltalk literal.
Store Smalltalk code compiling to the receiver on aStream
Next: Character-testing functionality, Previous: Character-storing, Up: Character [Index]
True if self is a letter or a digit
True if self is a 0-9 digit
Answer whether the receiver is a valid character in the given radix.
True if self is an upper- or lowercase letter
True if self is a lowercase letter
Returns true if self is a path separator ($/ or $\ under Windows, $/ only under Unix systems including Mac OS X).
Returns true if self is one of ’.,:;!?’
Returns true if self is a space, cr, tab, nl, or newPage
True if self is uppercase
Returns true if self is a, e, i, o, or u; case insensitive
Previous: Character-testing, Up: Character [Index]
Answer True. We’re definitely characters
Next: CInt, Previous: Character, Up: Base classes [Index]
My instances represent a generic textual (string) data type. I provide accessing and manipulation methods for strings.
• CharacterArray class-basic: | (class) | |
• CharacterArray class-multibyte encodings: | (class) | |
• CharacterArray-basic: | (instance) | |
• CharacterArray-built ins: | (instance) | |
• CharacterArray-comparing: | (instance) | |
• CharacterArray-converting: | (instance) | |
• CharacterArray-multibyte encodings: | (instance) | |
• CharacterArray-still unclassified: | (instance) | |
• CharacterArray-string processing: | (instance) | |
• CharacterArray-testing functionality: | (instance) |
Next: CharacterArray class-multibyte encodings, Up: CharacterArray [Index]
Make up an instance of the receiver containing the same characters as aCharacterArray, and answer it.
Answer a CharacterArray which one can use as a line delimiter. This is meant to be used on subclasses of CharacterArray.
Next: CharacterArray-basic, Previous: CharacterArray class-basic, Up: CharacterArray [Index]
Answer whether the receiver stores bytes (i.e. an encoded form) or characters (if true is returned).
Next: CharacterArray-built ins, Previous: CharacterArray class-multibyte encodings, Up: CharacterArray [Index]
Answer the ascii value of the anIndex-th character of the receiver, or evaluate aBlock and answer the result if the index is out of range.
Next: CharacterArray-comparing, Previous: CharacterArray-basic, Up: CharacterArray [Index]
Answer the ascii value of index-th character variable of the receiver
Store (Character value: value) in the index-th indexed instance variable of the receiver
Next: CharacterArray-converting, Previous: CharacterArray-built ins, Up: CharacterArray [Index]
Return true if the receiver is less than aCharacterArray, ignoring case differences.
Returns true if the receiver is less than or equal to aCharacterArray, ignoring case differences. If is receiver is an initial substring of aCharacterArray, it is considered to be less than aCharacterArray.
Answer whether the receiver’s items match those in aCollection
Return true if the receiver is greater than aCharacterArray, ignoring case differences.
Returns true if the receiver is greater than or equal to aCharacterArray, ignoring case differences. If is aCharacterArray is an initial substring of the receiver, it is considered to be less than the receiver.
Answer an Interval of indices in the receiver which match the aCharacterArray pattern. # in aCharacterArray means ’match any character’, * in aCharacterArray means ’match any sequence of characters’. The first item of the returned interval is >= anIndex. If aBoolean is false, the search is case-insensitive, else it is case-sensitive. If no Interval matches the pattern, answer nil.
Answer whether aCharacterArray matches the pattern contained in the receiver. # in the receiver means ’match any character’, * in receiver means ’match any sequence of characters’.
Answer whether aCharacterArray matches the pattern contained in the receiver. # in the receiver means ’match any character’, * in receiver means ’match any sequence of characters’. The case of alphabetic characters is ignored if aBoolean is true.
Returns true if the receiver is the same CharacterArray as aCharacterArray, ignoring case differences.
Next: CharacterArray-multibyte encodings, Previous: CharacterArray-comparing, Up: CharacterArray [Index]
Return the receiver, converted to a ByteArray of ASCII values
Return the receiver, ready to be put in a class pool dictionary
Return the receiver, ready to be put in the Smalltalk dictionary
Parse an Integer number from the receiver until the input character is invalid and answer the result at this point
Returns a copy of self as a lowercase CharacterArray
Parse a Number from the receiver until the input character is invalid and answer the result at this point
Return the receiver, ready to be put in a pool dictionary
But I already am a String! Really!
Returns the symbol corresponding to the CharacterArray
Answer a UnicodeString whose character’s codes are the receiver’s contents This is not implemented unless you load the I18N package.
Returns a copy of self as an uppercase CharacterArray
But I don’t HAVE a file name!
But I don’t HAVE a file position!
Answer whether the receiver denotes a number
Return a copy of the reciever without any spaces on front or back. The implementation is protected against the ‘all blanks’ case.
Next: CharacterArray-still unclassified, Previous: CharacterArray-converting, Up: CharacterArray [Index]
Answer the encoding used by the receiver.
Answer whether the receiver stores bytes (i.e. an encoded form) or characters (if true is returned).
Answer the number of Unicode characters in the receiver. This is not implemented unless you load the I18N package.
Next: CharacterArray-string processing, Previous: CharacterArray-multibyte encodings, Up: CharacterArray [Index]
Answer the receiver with special shell characters converted to a backslash sequence.
Answer the receiver with Windows shell characters escaped properly.
Next: CharacterArray-testing functionality, Previous: CharacterArray-still unclassified, Up: CharacterArray [Index]
Answer the receiver with special escape sequences replaced by elements of aCollection. %n (1<=n<=9, A<=n<=Z) are replaced by the n-th element of aCollection (A being the 10-th element and so on until the 35th). %(string) sequences are accessed as strings, which makes sense only if aCollection is a Dictionary or LookupTable. In addition, the special pattern %<trueString|falseString>n or %<trueString|falseString>(string) is replaced with one of the two strings depending on the element of aCollection being true or false. The replaced elements are ‘displayed’ (i.e. their displayString is used).
Answer the receiver with every %1 replaced by the displayString of s1
Answer the receiver with every %1 or %2 replaced by s1 or s2, respectively. s1 and s2 are ‘displayed’ (i.e. their displayString is used) upon replacement.
Answer the receiver with every %1, %2 or %3 replaced by s1, s2 or s3, respectively. s1, s2 and s3 are ‘displayed’ (i.e. their displayString is used) upon replacement.
Answer the receiver with every %1, %2, %3 or %4 replaced by s1, s2, s3 or s4, respectively. s1, s2, s3 and s4 are ‘displayed’ (i.e. their displayString is used) upon replacement.
Answer the receiver with special escape sequences replaced by elements of aCollection. %n (1<=n<=9, A<=n<=Z) are replaced by the n-th element of aCollection (A being the 10-th element and so on until the 35th). %(string) sequences are accessed as strings, which makes sense only if aCollection is a Dictionary or LookupTable. In addition, the special pattern %<trueString|falseString>n or %<trueString|falseString>(string) is replaced with one of the two strings depending on the element of aCollection being true or false. The replaced elements are ‘displayed’ (i.e. their displayString is used).
Either return myself, or a copy shortened to smallSize characters by inserting an ellipsis (three dots: ...)
Answer an Array of Strings each representing one line in the receiver.
Evaluate aBlock once for every newline delimited line in the receiver, passing the line to the block.
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of white space characters
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every occurrence of one of the characters in sep
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of white space characters. This message is preserved for backwards compatibility; the ANSI standard mandates ‘subStrings’, with an uppercase s.
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every occurrence of one of the characters in sep. This message is preserved for backwards compatibility; the ANSI standard mandates ‘subStrings:’, with an uppercase s.
Answer the receiver with special shell characters converted to a backslash sequence.
Previous: CharacterArray-string processing, Up: CharacterArray [Index]
Answer ‘true’.
Next: Class, Previous: CharacterArray, Up: Base classes [Index]
• CInt class-accessing: | (class) | |
• CInt-accessing: | (instance) |
Next: CInt-accessing, Up: CInt [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s size
Previous: CInt class-accessing, Up: CInt [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s instances size
Next: ClassDescription, Previous: CInt, Up: Base classes [Index]
I am THE class object. My instances are the classes of the system. I provide information commonly attributed to classes: namely, the class name, class comment (you wouldn’t be reading this if it weren’t for me), a list of the instance variables of the class, and the class category.
• Class class-initialize: | (class) | |
• Class-accessing instances and variables: | (instance) | |
• Class-filing: | (instance) | |
• Class-instance creation: | (instance) | |
• Class-instance creation - alternative: | (instance) | |
• Class-pragmas: | (instance) | |
• Class-printing: | (instance) | |
• Class-saving and loading: | (instance) | |
• Class-security: | (instance) | |
• Class-still unclassified: | (instance) | |
• Class-testing: | (instance) | |
• Class-testing functionality: | (instance) |
Next: Class-accessing instances and variables, Up: Class [Index]
Perform the special initialization of root classes.
Next: Class-filing, Previous: Class class-initialize, Up: Class [Index]
Add a class variable with the given name to the class pool dictionary.
Add a class variable with the given name to the class pool dictionary, and evaluate valueBlock as its initializer.
Add the given shared pool to the list of the class’ pool dictionaries
Answer the names of the variables in the receiver’s class pool dictionary and in each of the superclasses’ class pool dictionaries
Answer the variable binding for the class variable with the given name
Answer the class category
Change the class category to aString
Answer the class pool dictionary
Return the pragmas that are written in the file-out of this class.
Answer the names of the variables in the class pool dictionary
Answer the class comment
Change the class name
Answer ‘environment’.
Set the receiver’s environment to aNamespace and recompile everything
redefined in children (?)
Perform special initialization reserved to root classes.
Answer the class name
Removes the class variable from the class, error if not present, or still in use.
Remove the given dictionary to the list of the class’ pool dictionaries
Return the names of the shared pools defined by the class
Set the receiver’s superclass.
Next: Class-instance creation, Previous: Class-accessing instances and variables, Up: Class [Index]
File out class definition to aFileStream. Requires package Parser.
File out complete class description: class definition, class and instance methods. Requires package Parser.
Next: Class-instance creation - alternative, Previous: Class-filing, Up: Class [Index]
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 the problems you can encounter.
Answer whether subclasses will have by default the same shape as this class. The default is false.
Define a subclass of the receiver with the given name. If the class is already defined, don’t modify its instance or class variables but still, if necessary, recompile everything needed.
Define a fixed subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.
Define a variable subclass of the receiver with the given name, shape, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed. The shape can be one of #byte #int8 #character #short #ushort #int #uint #int64 #uint64 #utf32 #float #double or #pointer.
Define a byte variable subclass of the receiver with the given name, instance variables (must be ”), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.
Define a variable pointer subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.
Define a word variable subclass of the receiver with the given name, instance variables (must be ”), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.
Next: Class-pragmas, Previous: Class-instance creation, Up: Class [Index]
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Don’t use this, it is only present to file in from IBM Smalltalk
Next: Class-printing, Previous: Class-instance creation - alternative, Up: Class [Index]
Answer the (possibly inherited) registered handler for pragma aSymbol, or nil if not found.
While compiling methods, on every encounter of the pragma with the given name, call aBlock with the CompiledMethod and an array of pragma argument values.
Next: Class-saving and loading, Previous: Class-pragmas, Up: Class [Index]
Answer an article (‘a’ or ‘an’) which is ok for the receiver’s name
Print a representation of the receiver on aStream
Store Smalltalk code compiling to the receiver on aStream
Next: Class-security, Previous: Class-printing, Up: Class [Index]
Answer a number >= 0 which represents the current version of the object’s representation. The default implementation answers zero.
This method is called if a VersionableObjectProxy is attached to a class. It receives the version number that was stored for the object (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 fills in an instance of the receiver with the given fixed and indexed instance variables (nil if the class instances are of fixed size). If instance variables were removed from the class, extras are ignored; if the class is now fixed and used to be indexed, indexed is not used.
Answer the number of instance variables that the class used to have when objects were stored without using a VersionableObjectProxy. The default implementation answers the current instSize.
Next: Class-still unclassified, Previous: Class-saving and loading, Up: Class [Index]
Not commented.
Answer ‘securityPolicy’.
Not commented.
Next: Class-testing, Previous: Class-security, Up: Class [Index]
Answer the shared pools visible from methods in the metaclass, in the correct search order.
Not commented.
Next: Class-testing functionality, Previous: Class-still unclassified, Up: Class [Index]
Returns true if the two class objects are to be considered equal.
Previous: Class-testing, Up: Class [Index]
Answer the receiver.
Answer ‘true’.
Next: CLong, Previous: Class, Up: Base classes [Index]
My instances provide methods that access classes by category, and allow whole categories of classes to be filed out to external disk files.
• ClassDescription-compiling: | (instance) | |
• ClassDescription-conversion: | (instance) | |
• ClassDescription-copying: | (instance) | |
• ClassDescription-filing: | (instance) | |
• ClassDescription-organization of messages and classes: | (instance) | |
• ClassDescription-parsing class declarations: | (instance) | |
• ClassDescription-printing: | (instance) | |
• ClassDescription-still unclassified: | (instance) |
Next: ClassDescription-conversion, Up: ClassDescription [Index]
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 method source and install in method category, categoryName. If there are parsing errors, invoke exception block, ’block’ (see compile:ifError:). Return the method
Compile method source and install in method category, categoryName. If there are parsing errors, send an error message to requestor
Next: ClassDescription-copying, Previous: ClassDescription-compiling, Up: ClassDescription [Index]
This method’s functionality should be implemented by subclasses of ClassDescription
Answer the metaclass associated to the receiver
Answer a VariableBinding object whose value is the receiver
Next: ClassDescription-filing, Previous: ClassDescription-conversion, Up: ClassDescription [Index]
Copy the given selector from aClass, assigning it the same category
Copy the given selector from aClass, assigning it the given category
Copy all the selectors in arrayOfSelectors from class, assigning them the same category they have in class
Copy all the selectors in arrayOfSelectors from aClass, assigning them the given category
Copy all the selectors in aClass, assigning them the original category
Copy all the selectors in from aClass that belong to the given category
Copy all the selectors in from aClass that belong to the given category, reclassifying them as belonging to the given category
Next: ClassDescription-organization of messages and classes, Previous: ClassDescription-copying, Up: ClassDescription [Index]
Open the given file and to file out a complete class description to it. Requires package Parser.
File out all the methods belonging to the method category, categoryName, to the fileName file. Requires package Parser.
File out complete class description: class definition, class and instance methods. Requires package Parser.
File out the given selector to fileName. Requires package Parser.
Next: ClassDescription-parsing class declarations, Previous: ClassDescription-filing, Up: ClassDescription [Index]
Put the method identified by the selector aSelector under the category given by aString.
Create a method accessing the variable ‘what’.
Create a method accessing the variable ‘what’, with a default value of ‘value’, using lazy initialization
Create a method which sets the variable ‘what’.
See documentation. This function is deprecated, you should use the <asyncCCall: ... > special syntax instead.
See documentation. This function is deprecated, you should use the <asyncCCall: ... > special syntax instead.
Remove from the receiver every method belonging to the given category
Answer the category for the given selector, or nil if the selector is not found
Next: ClassDescription-printing, Previous: ClassDescription-organization of messages and classes, Up: ClassDescription [Index]
Add the given shared pool to the list of the class’ pool dictionaries
Add the given shared pool to the list of the class’ pool dictionaries
Next: ClassDescription-still unclassified, Previous: ClassDescription-parsing class declarations, Up: ClassDescription [Index]
This method’s functionality should be implemented by subclasses of ClassDescription
Answer a string containing the name of the receiver’s instance variables.
Answer the class name when the class is referenced from aNamespace
Print on aStream the class name when the class is referenced from aNamespace
This method’s functionality should be implemented by subclasses of ClassDescription
Previous: ClassDescription-printing, Up: ClassDescription [Index]
File out all the methods belonging to the method category, category, to aFileStream. Requires package Parser.
File out all the methods belonging to the method category, category, to aFileStream. Requires package Parser.
Next: CLongDouble, Previous: ClassDescription, Up: Base classes [Index]
• CLong class-accessing: | (class) | |
• CLong-accessing: | (instance) |
Next: CLong-accessing, Up: CLong [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CLong class-accessing, Up: CLong [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CLongLong, Previous: CLong, Up: Base classes [Index]
• CLongDouble class-accessing: | (class) | |
• CLongDouble-accessing: | (instance) |
Next: CLongDouble-accessing, Up: CLongDouble [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CLongDouble class-accessing, Up: CLongDouble [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CObject, Previous: CLongDouble, Up: Base classes [Index]
• CLongLong class-accessing: | (class) | |
• CLongLong-accessing: | (instance) |
Next: CLongLong-accessing, Up: CLongLong [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CLongLong class-accessing, Up: CLongLong [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: Collection, Previous: CLongLong, Up: Base classes [Index]
I am not part of the standard Smalltalk kernel class hierarchy. My instances contain values that are not interpreted by the Smalltalk system; they frequently hold "pointers" to data outside of the Smalltalk environment. The C callout mechanism allows my instances to be transformed into their corresponding C values for use in external routines.
• CObject class-conversion: | (class) | |
• CObject class-instance creation: | (class) | |
• CObject class-primitive allocation: | (class) | |
• CObject class-subclass creation: | (class) | |
• CObject-accessing: | (instance) | |
• CObject-basic: | (instance) | |
• CObject-C data access: | (instance) | |
• CObject-conversion: | (instance) | |
• CObject-finalization: | (instance) | |
• CObject-pointer-like behavior: | (instance) | |
• CObject-testing: | (instance) | |
• CObject-testing functionality: | (instance) |
Next: CObject class-instance creation, Up: CObject [Index]
Nothing special in the default case - answer a CType for the receiver
Next: CObject class-primitive allocation, Previous: CObject class-conversion, Up: CObject [Index]
Answer a new object pointing to the passed address, anInteger
Allocate nBytes bytes and return an instance of the receiver
Allocate nBytes bytes and return an instance of the receiver
Allocate nBytes bytes and return an instance of the receiver
Answer a new object pointing to NULL.
Allocate nBytes bytes and return an instance of the receiver
Next: CObject class-subclass creation, Previous: CObject class-instance creation, Up: CObject [Index]
Allocate nBytes bytes and return a CObject of the given type
Allocate nBytes bytes and return a CObject of the given type
Next: CObject-accessing, Previous: CObject class-primitive allocation, Up: CObject [Index]
Answer whether subclasses will have by default the same shape as this class. The default is true for the CObject hierarchy.
Next: CObject-basic, Previous: CObject class-subclass creation, Up: CObject [Index]
Answer the address the receiver is pointing to. The address can be absolute if the storage is nil, or relative to the Smalltalk object in #storage. In this case, an address of 0 corresponds to the first instance variable.
Set the receiver to point to the passed address, anInteger
Answer whether the object points into a garbage-collected Smalltalk storage, or it is an absolute address.
Print a representation of the receiver
Answer the storage that the receiver is pointing into, or nil if the address is absolute.
Change the receiver to point to the storage of anObject.
Set the receiver’s type to aCType.
Next: CObject-C data access, Previous: CObject-accessing, Up: CObject [Index]
Return true if the receiver and aCObject are equal.
Return a hash value for anObject.
Next: CObject-conversion, Previous: CObject-basic, Up: CObject [Index]
Store aValue as data of the given type from byteOffset bytes after the pointer stored in the receiver
Answer some data of the given type from byteOffset bytes after the pointer stored in the receiver
Free the receiver’s pointer and set it to null. Big trouble hits you if the receiver doesn’t point to the base of a malloc-ed area.
Next: CObject-finalization, Previous: CObject-C data access, Up: CObject [Index]
Answer another CObject, pointing to the same address as the receiver, but belonging to the aType CType.
This method is called on CObjects returned by a C call-out whose return type is specified as a CType; it mostly allows one to change the class of the returned CObject. By default it does nothing, and that’s why it is not called when #cObject is used to specify the return type.
Answer a CType for the receiver
Next: CObject-pointer-like behavior, Previous: CObject-conversion, Up: CObject [Index]
To make the VM call this, use #addToBeFinalized. It frees automatically any memory pointed to by the CObject. It is not automatically enabled because big trouble hits you if you use #free and the receiver doesn’t point to the base of a malloc-ed area.
Next: CObject-testing, Previous: CObject-finalization, Up: CObject [Index]
Return another instance of the receiver’s class which points at &receiver[anInteger] (or, if you prefer, what ‘receiver + anInteger’ does in C).
If intOrPtr is an integer, return another instance of the receiver’s class 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 in chars, i.e. in bytes, between the two pointed addresses (or, if you prefer, what ‘receiver - anotherCharPtr’ does in C)
Return a new CObject of the element type, corresponding to an object that is anIndex places past the receiver (remember that CObjects represent pointers and that C pointers behave like arrays). anIndex is zero-based, just like with all other C-style accessing.
Dereference a pointer that is anIndex places past the receiver (remember that CObjects represent pointers and that C pointers behave like arrays). anIndex is zero-based, just like with all other C-style accessing.
Store anIndex places past the receiver the passed Smalltalk object or CObject ‘aValue’; if it is a CObject is dereferenced: that is, this method is equivalent either to cobj[anIndex]=aValue or cobj[anIndex]=*aValue. anIndex is zero-based, just like with all other C-style accessing.
In both cases, aValue should be of the element type or of the corresponding Smalltalk type (that is, a String is ok for an array of CStrings) to avoid typing problems which however will not be signaled because C is untyped.
Adjust the pointer by sizeof(dereferencedType) bytes down (i.e. –receiver)
Adjust the pointer by anInteger elements down (i.e. receiver -= anInteger)
Adjust the pointer by sizeof(dereferencedType) bytes up (i.e. ++receiver)
Adjust the pointer by anInteger elements up (i.e. receiver += anInteger)
Next: CObject-testing functionality, Previous: CObject-pointer-like behavior, Up: CObject [Index]
Return true if the receiver points to NULL.
Previous: CObject-testing, Up: CObject [Index]
Answer ‘true’.
Next: CompiledBlock, Previous: CObject, Up: Base classes [Index]
I am an abstract class. My instances are collections of objects. My subclasses may place some restrictions or add some definitions to how the objects are stored or organized; I say nothing about this. I merely provide some object creation and access routines for general collections of objects.
• Collection class-instance creation: | (class) | |
• Collection class-multibyte encodings: | (class) | |
• Collection-adding: | (instance) | |
• Collection-compiler: | (instance) | |
• Collection-concatenating: | (instance) | |
• Collection-converting: | (instance) | |
• Collection-copying Collections: | (instance) | |
• Collection-copying SequenceableCollections: | (instance) | |
• Collection-enumeration: | (instance) | |
• Collection-finalization: | (instance) | |
• Collection-printing: | (instance) | |
• Collection-removing: | (instance) | |
• Collection-sorting: | (instance) | |
• Collection-storing: | (instance) | |
• Collection-testing collections: | (instance) |
Next: Collection class-multibyte encodings, Up: Collection [Index]
Convert anArray to an instance of the receiver. anArray is structured such that the instance can be conveniently and fully specified using brace-syntax, possibly by imposing some additional structure on anArray.
Answer a collection formed by treating each element in aCollection as a ‘withAll:’ argument collection to be added to a new instance.
Answer a collection whose only element is anObject
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose only elements are the parameters in the order they were passed
Answer a collection whose elements are all those in aCollection
Next: Collection-adding, Previous: Collection class-instance creation, Up: Collection [Index]
Answer true; the receiver is able to store arbitrary Unicode characters.
Next: Collection-compiler, Previous: Collection class-multibyte encodings, Up: Collection [Index]
Add newObject to the receiver, answer it
Adds all the elements of ’aCollection’ to the receiver, answer aCollection
Next: Collection-concatenating, Previous: Collection-adding, Up: Collection [Index]
Not commented.
Not commented.
Next: Collection-converting, Previous: Collection-compiler, Up: Collection [Index]
Answer a new collection like my first element, with all the elements (in order) of all my elements, which should be collections.
I use my first element instead of myself as a prototype because my elements are more likely to share the desired properties than I am, such as in:
#(’hello, ’ ’world’) join => ’hello, world’
Next: Collection-copying Collections, Previous: Collection-concatenating, Up: Collection [Index]
Answer an Array containing all the elements in the receiver
Answer a Bag containing all the elements in the receiver
Answer a ByteArray containing all the elements in the receiver
Answer an OrderedCollection containing all the elements in the receiver
Answer the receiver converted to a RunArray. If the receiver is not ordered the order of the elements in the RunArray might not be the #do: order.
Answer a Set containing all the elements in the receiver with no duplicates
Answer a SortedCollection containing all the elements in the receiver with the default sort block - [ :a :b | a <= b ]
Answer a SortedCollection whose elements are the elements of the receiver, sorted according to the sort block aBlock
Answer a String containing all the elements in the receiver
Answer a UnicodeString containing all the elements in the receiver
Next: Collection-copying SequenceableCollections, Previous: Collection-converting, Up: Collection [Index]
Copy replacing each object which is = to targetObject with newObject
Answer a copy of the receiver to which newElement is added
Answer a copy of the receiver to which all occurrences of oldElement are removed
Next: Collection-enumeration, Previous: Collection-copying Collections, Up: Collection [Index]
Append anIterable at the end of a copy of the receiver (using #add:), and answer a new collection
Next: Collection-finalization, Previous: Collection-copying SequenceableCollections, Up: Collection [Index]
Answer an unspecified element of the collection.
This method is private, but it is quite interesting so it is documented. It ensures that a collection is in a consistent state before attempting to iterate on it; its presence reduces the number of overrides needed by collections who try to amortize their execution times. The default implementation does nothing, so it is optimized out by the virtual machine and so it loses very little on the performance side. Note that descendants of Collection have to call it explicitly since #do: is abstract in Collection.
Answer a new instance of a Collection containing all the results of evaluating aBlock passing each of the receiver’s elements
Answer a new instance of a Collection containing all the results of evaluating aBlock, joined together. aBlock should return collections. The result is the same kind as the first collection, returned by aBlock (as for #join).
Answer a stream that gives elements of the receiver
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, don’t answer true
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, answer true
Next: Collection-printing, Previous: Collection-enumeration, Up: Collection [Index]
Private - anObject has been found to have a weak key, remove it and possibly finalize the key.
Next: Collection-removing, Previous: Collection-finalization, Up: Collection [Index]
Print each element of the receiver to a line on standard output.
Print all the instance variables and objects in the receiver on aStream
Print a representation of the receiver on aStream
Next: Collection-sorting, Previous: Collection-printing, Up: Collection [Index]
Remove everything from the receiver.
Remove oldObject from the receiver. If absent, fail, else answer oldObject.
Remove oldObject from the receiver. If absent, evaluate anExceptionBlock and answer the result, else answer oldObject.
Remove each object in aCollection, answer aCollection, fail if some of them is absent. Warning: this could leave the collection in a semi-updated state.
Remove each object in aCollection, answer aCollection; if some element is absent, pass it to aBlock.
Remove from the receiver all objects for which aBlock returns true.
Next: Collection-storing, Previous: Collection-removing, Up: Collection [Index]
Return a sequenceable collection with the contents of the receiver sorted according to the default sort block, which uses #<= to compare items.
Return a sequenceable collection with the contents of the receiver sorted according to the given sort block, which accepts pair of items and returns true if the first item is less than the second one.
Next: Collection-testing collections, Previous: Collection-sorting, Up: Collection [Index]
Store Smalltalk code compiling to the receiver on aStream
Previous: Collection-storing, Up: Collection [Index]
Answer how many elements the receiver can hold before having to grow.
Answer whether we include the anObject object
Answer whether we include anObject
Answer whether we include all of the objects in aCollection
Answer whether we include any of the objects in aCollection
Answer whether we are (still) empty
Answer whether the receiver can be accessed by a numeric index with #at:/#at:put:.
Answer whether we include at least one object
Answer how many occurrences of anObject we include
Answer how many objects we include
Next: CompiledCode, Previous: Collection, Up: Base classes [Index]
I represent a block that has been compiled.
• CompiledBlock class-instance creation: | (class) | |
• CompiledBlock-accessing: | (instance) | |
• CompiledBlock-basic: | (instance) | |
• CompiledBlock-printing: | (instance) | |
• CompiledBlock-saving and loading: | (instance) |
Next: CompiledBlock-accessing, Up: CompiledBlock [Index]
Answer a new instance of the receiver with room for the given number of bytecodes and the given header.
Answer an (almost) full fledged CompiledBlock. To make it complete, you must either set the new object’s ‘method’ variable, or put it into a BlockClosure and put the BlockClosure into a CompiledMethod’s literals. The clean-ness of the block is automatically computed.
Next: CompiledBlock-basic, Previous: CompiledBlock class-instance creation, Up: CompiledBlock [Index]
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
Answer the CompiledMethod in which the receiver lies
Answer the class in which the receiver is installed.
Set the receiver’s class instance variable
Answer the number of arguments passed to the receiver
Answer the number of literals for the receiver
Answer the number of temporary variables used by the receiver
Answer the selector through which the method is called
Set the selector through which the method is called
Answer the delta from the numbers in LINE_NUMBER bytecodes to source code line numbers.
Answer an array which maps bytecode indices to source code line numbers. 0 values represent invalid instruction pointer indices.
Answer the number of stack slots needed for the receiver
Next: CompiledBlock-printing, Previous: CompiledBlock-accessing, Up: CompiledBlock [Index]
Answer whether the receiver and aMethod are equal
Answer the method category
Set the method category to the given string
Answer the method source code (a FileSegment or String or nil)
Answer the file where the method source code is stored
Answer the location where the method source code is stored in the methodSourceFile
Answer the method source code as a string
Next: CompiledBlock-saving and loading, Previous: CompiledBlock-basic, Up: CompiledBlock [Index]
Print the receiver’s class and selector on aStream
Previous: CompiledBlock-printing, Up: CompiledBlock [Index]
This method is implemented to allow for a PluggableProxy to be used with CompiledBlocks. Answer a DirectedMessage which sends #blockAt: to the CompiledMethod containing the receiver.
Next: CompiledMethod, Previous: CompiledBlock, Up: Base classes [Index]
I represent code that has been compiled. I am an abstract superclass for blocks and methods
• CompiledCode class-cache flushing: | (class) | |
• CompiledCode class-instance creation: | (class) | |
• CompiledCode class-tables: | (class) | |
• CompiledCode-accessing: | (instance) | |
• CompiledCode-basic: | (instance) | |
• CompiledCode-copying: | (instance) | |
• CompiledCode-debugging: | (instance) | |
• CompiledCode-decoding bytecodes: | (instance) | |
• CompiledCode-literals - iteration: | (instance) | |
• CompiledCode-security: | (instance) | |
• CompiledCode-testing accesses: | (instance) | |
• CompiledCode-translation: | (instance) |
Next: CompiledCode class-instance creation, Up: CompiledCode [Index]
Answer any kind of cache mantained by a just-in-time code translator in the virtual machine (if any). Do nothing for now.
Next: CompiledCode class-tables, Previous: CompiledCode class-cache flushing, Up: CompiledCode [Index]
Answer a new instance of the receiver with room for the given number of bytecodes and the given header
Answer a new instance of the receiver with room for the given number of bytecodes and the given header
Next: CompiledCode-accessing, Previous: CompiledCode class-instance creation, Up: CompiledCode [Index]
Return a ByteArray which defines some properties of the bytecodes. For each bytecode, 4 bytes are reserved. The fourth byte is a flag byte: bit 7 means that the argument is a line number to be used in creating the bytecode->line number map.
The first three have a meaning only for those bytecodes that represent a combination of operations: the combination can be BC1 ARG BC2 OPERAND if the fourth byte’s bit 0 = 0 or BC1 OPERAND BC2 ARG if the fourth byte’s bit 0 = 1
where BC1 is the first byte, BC2 is the second, ARG is the third and OPERAND is the bytecode argument as it appears in the bytecode stream.
Answer an array of message names that don’t need to be in literals to be sent in a method. Their position here reflects their integer code in bytecode.
Answer a harmoniously-indexed array of arities for the messages answered by #specialSelectors.
Next: CompiledCode-basic, Previous: CompiledCode class-tables, Up: CompiledCode [Index]
Store aBytecode as the anIndex-th bytecode
Answer the CompiledBlock attached to the anIndex-th literal, assuming that the literal is a CompiledBlock or a BlockClosure.
Answer the anIndex-th bytecode
Store aBytecode as the anIndex-th bytecode
Private - Answer the optimization flags for the receiver
Answer ‘false’.
Answer the anIndex-th literal
Store aValue as the anIndex-th literal
Answer the literals referenced by my code or any CompiledCode instances I own.
Answer the parent method for the receiver, or self if it is a method.
Answer the class in which the receiver is installed.
Set the receiver’s class instance variable
Answer the number of arguments for the receiver
Answer the number of literals for the receiver
Answer the number of temporaries for the receiver
Answer the primitive called by the receiver
Answer the selector through which the method is called
Set the selector through which the method is called
Answer the delta from the numbers in LINE_NUMBER bytecodes to source code line numbers.
Answer the number of stack slots needed for the receiver
Next: CompiledCode-copying, Previous: CompiledCode-accessing, Up: CompiledCode [Index]
Answer whether the receiver is the same object as arg. Testing for equality could break the browser, since it’s possible to put arbitrary objects via ##(...), so this is safer.
Answer an hash value for the receiver
Answer the method category
Set the method category to the given string
Answer the method source code (a FileSegment or String or nil)
Answer the file where the method source code is stored
Answer the location where the method source code is stored in the methodSourceFile
Answer the method source code as a string
Next: CompiledCode-debugging, Previous: CompiledCode-basic, Up: CompiledCode [Index]
Answer a deep copy of the receiver
Next: CompiledCode-decoding bytecodes, Previous: CompiledCode-copying, Up: CompiledCode [Index]
Print the contents of the receiver in a verbose way.
Next: CompiledCode-literals - iteration, Previous: CompiledCode-debugging, Up: CompiledCode [Index]
Disassemble the bytecodes and tell anObject about them in the form of message sends. param is given as an argument to every message send.
Next: CompiledCode-security, Previous: CompiledCode-decoding bytecodes, Up: CompiledCode [Index]
As with #allLiteralsDo:, but only call aBlock with found Symbols.
Walk my literals, descending into Arrays and Messages, invoking aBlock with each touched object.
Invoke aBlock with each object immediately in my list of literals.
Next: CompiledCode-testing accesses, Previous: CompiledCode-literals - iteration, Up: CompiledCode [Index]
Verify the bytecodes for the receiver, and raise an exception if the verification process failed.
Next: CompiledCode-translation, Previous: CompiledCode-security, Up: CompiledCode [Index]
Answer whether the receiver accesses the instance variable with the given index
Answer whether the receiver writes to the instance variable with the given index
Answer if the receiver contains a literal which is equal to anObject.
Answer whether the receiver includes the ‘byte’ bytecode in any of the indices between firstIndex and lastIndex.
Answer where the jump at bytecode index ‘anIndex’ lands
Answer whether the receiver reads the instance variable with the given index
Answer whether the receiver refers to the given object
Answer whether the receiver includes a send to super.
Answer an array which maps bytecode indices to source code line numbers. 0 values represent invalid instruction pointer indices.
Previous: CompiledCode-testing accesses, Up: CompiledCode [Index]
Flush the just-in-time translated code for the receiver (if any).
Next: ContextPart, Previous: CompiledCode, Up: Base classes [Index]
I represent methods that have been compiled. I can recompile methods from their source code, I can invoke Emacs to edit the source code for one of my instances, and I know how to access components of my instances.
• CompiledMethod class-c call-outs: | (class) | |
• CompiledMethod class-instance creation: | (class) | |
• CompiledMethod class-lean images: | (class) | |
• CompiledMethod-accessing: | (instance) | |
• CompiledMethod-attributes: | (instance) | |
• CompiledMethod-basic: | (instance) | |
• CompiledMethod-c call-outs: | (instance) | |
• CompiledMethod-compiling: | (instance) | |
• CompiledMethod-invoking: | (instance) | |
• CompiledMethod-printing: | (instance) | |
• CompiledMethod-saving and loading: | (instance) | |
• CompiledMethod-source code: | (instance) | |
• CompiledMethod-testing: | (instance) |
Next: CompiledMethod class-instance creation, Up: CompiledMethod [Index]
Return a CompiledMethod corresponding to a #asyncCCall:args: pragma with the given arguments.
Return a CompiledMethod corresponding to a #cCall:returning:args: pragma with the given arguments.
Next: CompiledMethod class-lean images, Previous: CompiledMethod class-c call-outs, Up: CompiledMethod [Index]
Answer a full fledged CompiledMethod. Construct the method header from the parameters, and set the literals and bytecodes to the provided ones. Also, the bytecodes are optimized and any embedded CompiledBlocks modified to refer to these literals and to the newly created CompiledMethod.
Create a user-defined method (one that is sent #valueWithReceiver:withArguments: when it is invoked) with numArgs arguments. This only makes sense when called for a subclass of CompiledMethod.
Next: CompiledMethod-accessing, Previous: CompiledMethod class-instance creation, Up: CompiledMethod [Index]
Remove all the references to method source code from the system
Next: CompiledMethod-attributes, Previous: CompiledMethod class-lean images, Up: CompiledMethod [Index]
Evaluate aBlock, passing to it all the CompiledBlocks it holds
Answer the literals referred to by the receiver and all the blocks in it
Private - Answer the optimization flags for the receiver
Answer whether the method was written with the old (chunk-format) syntax
Answer the receiver, since it is already a method.
Answer the method category
Set the method category to the given string
Answer the class in which the receiver is installed.
Set the receiver’s class instance variable
Remember that the method is written with the old (chunk-format) syntax
Answer the number of arguments for the receiver
Answer the number of temporaries for the receiver
Answer the primitive called by the receiver
Answer the selector through which the method is called
Set the selector through which the method is called
Answer the delta from the numbers in LINE_NUMBER bytecodes to source code line numbers.
Answer the number of stack slots needed for the receiver
Evaluate aBlock, passing the receiver and all the CompiledBlocks it holds
Answer either the receiver or a copy of it, with the method class set to class
Answer either the receiver or a copy of it, with the method class set to class
Next: CompiledMethod-basic, Previous: CompiledMethod-accessing, Up: CompiledMethod [Index]
Return a Message for the first attribute named aSymbol defined by the receiver, or answer an error if none was found.
Return a Message for the first attribute named aSymbol defined by the receiver, or evaluate aBlock is none was found.
Return an Array of Messages, one for each attribute defined by the receiver.
Evaluate aBlock once for each attribute defined by the receiver, passing a Message each time.
If the receiver has any attributes, answer true.
If the receiver defines a primitive, return a Message resembling the attribute that was used to define it.
Next: CompiledMethod-c call-outs, Previous: CompiledMethod-attributes, Up: CompiledMethod [Index]
Answer whether the receiver and aMethod are equal
Answer an hash value for the receiver
Next: CompiledMethod-compiling, Previous: CompiledMethod-basic, Up: CompiledMethod [Index]
Answer whether I appear to have the valid flags, information, and ops to invoke a C function and answer its result.
Not commented.
Not commented.
Not commented.
Next: CompiledMethod-invoking, Previous: CompiledMethod-c call-outs, Up: CompiledMethod [Index]
Answer the method source code as a string, formatted using the RBFormatter. Requires package Parser.
Answer the parse tree for the receiver, or nil if there is an error. Requires package Parser.
Answer a parser class, similar to Behavior>>parserClass, that can parse my source code. Requires package Parser.
Recompile the method in the scope of the class where it leaves.
Recompile the method in the scope of the class where it leaves, notifying errors to aNotifier by sending it #error:.
Next: CompiledMethod-printing, Previous: CompiledMethod-compiling, Up: CompiledMethod [Index]
Execute the method within anObject, passing the elements of the args Array as parameters. The method need not reside on the hierarchy from the receiver’s class to Object – it need not reside at all in a MethodDictionary, in fact – but doing bad things will compromise stability of the Smalltalk virtual machine (and don’t blame anybody but yourself).
If the flags field of the method header is 6, this method instead provides a hook from which the virtual machine can call back whenever execution of the method is requested. In this case, invoking the method would cause an infinite loop (the VM asks the method to run, the method asks the VM to invoke it, and so on), so this method fails with a #subclassResponsibility error.
Next: CompiledMethod-saving and loading, Previous: CompiledMethod-invoking, Up: CompiledMethod [Index]
Print the receiver’s class and selector on aStream
Print code to create the receiver on aStream
Next: CompiledMethod-source code, Previous: CompiledMethod-printing, Up: CompiledMethod [Index]
This method is implemented to allow for a PluggableProxy to be used with CompiledMethods. Answer a DirectedMessage which sends #>> to the class object containing the receiver.
Next: CompiledMethod-testing, Previous: CompiledMethod-saving and loading, Up: CompiledMethod [Index]
Answer the method source code as a string, ensuring that it is in new syntax (it has brackets).
Answer the method source code (a FileSegment or String or nil)
Answer the file where the method source code is stored
Answer the location where the method source code is stored in the methodSourceFile
Answer the method source code as a string
Previous: CompiledMethod-source code, Up: CompiledMethod [Index]
Answer whether the receiver or the blocks it contains accesses the instance variable with the given index
Answer whether the receiver or the blocks it contains writes to the instance variable with the given index
Answer whether the receiver is abstract.
Answer whether the receiver or the blocks it contains reads to the instance variable with the given index
Answer whether the receiver or the blocks it contains have sends to super
Next: Continuation, Previous: CompiledMethod, Up: Base classes [Index]
My instances represent executing Smalltalk code, which represent the local environment of executable code. They contain a stack and also provide some methods that can be used in inspection or debugging.
• ContextPart class-built ins: | (class) | |
• ContextPart class-exception handling: | (class) | |
• ContextPart-accessing: | (instance) | |
• ContextPart-built ins: | (instance) | |
• ContextPart-copying: | (instance) | |
• ContextPart-debugging: | (instance) | |
• ContextPart-enumerating: | (instance) | |
• ContextPart-printing: | (instance) | |
• ContextPart-security checks: | (instance) |
Next: ContextPart class-exception handling, Up: ContextPart [Index]
Return the value of the thisContext variable. Called internally when the variable is accessed.
Next: ContextPart-accessing, Previous: ContextPart class-built ins, Up: ContextPart [Index]
Print a backtrace from the caller to the bottom of the stack on the Transcript
Print a backtrace from the caller to the bottom of the stack on aStream
Next: ContextPart-built ins, Previous: ContextPart class-exception handling, Up: ContextPart [Index]
Answer the index-th slot in the receiver. Any read access from (self size + 1) to (self basicSize) will give nil.
Answer the index-th slot in the receiver. Any write access from (self size + 1) to (self basicSize) will give an error unless nil is being written. This is because doing such an access first, and then updating sp, is racy: the garbage collector may trigger in the middle and move anObject, but the slot in the context won’t be adjusted.
Answer the client of this context, that is, the object that sent the message that created this context. Fail if the receiver has no parent
Answer the name of the file where the method source code is
To create a valid execution environment for the interpreter even before it starts, GST creates a fake context whose selector is nil and which can be used as a marker for the current execution environment. This method answers that context. For processes, it answers the process block itself
Answer the MethodContext to which the receiver refers
Answer the value of the instruction pointer when execution starts in the current context
Answer the current instruction pointer into the receiver
Set the instruction pointer for the receiver
Answer whether the receiver is a block context
Answers whether the context is skipped when doing a return. Contexts are marked as disabled whenever a non-local return is done (either by returning from the enclosing method of a block, or with the #continue: method of ContextPart) and there are unwind contexts such as those created by #ensure:. All non-unwind contexts are then marked as disabled.
To create a valid execution environment for the interpreter even before it starts, GST creates a fake context which invokes a special “termination” method. Such a context can be used as a marker for the current execution environment. Answer whether the receiver is that kind of context.
Answer whether the receiver represents a process context, i.e. a context created by BlockClosure>>#newProcess. Such a context can be recognized because it has no parent but its flags are different from those of the contexts created by the VM’s prepareExecutionEnvironment function.
Answers whether the context must continue execution even after a non-local return (a return from the enclosing method of a block, or a call to the #continue: method of ContextPart). Such contexts are created by #ensure:.
Return the CompiledMethod being executed
Return the class in which the CompiledMethod being executed is defined
Answer the number of arguments passed to the receiver
Answer the number of temporaries used by the receiver
Answer the context that called the receiver
Set the context to which the receiver will return
Push an object on the receiver’s stack.
Return the receiver (self) for the method being executed
Return the selector for the method being executed
Answer the number of valid fields for the receiver. Any read access from (self size + 1) to (self basicSize) will give nil.
Answer the current stack pointer into the receiver
Set the stack pointer for the receiver.
Answer how many elements in the receiver should be inspected
Next: ContextPart-copying, Previous: ContextPart-accessing, Up: ContextPart [Index]
Resume execution from the receiver, faking that the context on top of it in the execution chain has returned anObject. The receiver must belong to the same process as the executing context, otherwise the results are not predictable. All #ensure: (and possibly #ifCurtailed:) blocks between the currently executing context and the receiver are evaluated (which is not what would happen if you directly bashed at the parent context of thisContext).
Next: ContextPart-debugging, Previous: ContextPart-built ins, Up: ContextPart [Index]
Answer a copy of the entire stack.
Answer a copy of the entire stack, but don’t copy any of the other instance variables of the context.
Next: ContextPart-enumerating, Previous: ContextPart-copying, Up: ContextPart [Index]
Answer the 1-based number of the line that is pointed to by the receiver’s instruction pointer. The DebugTools package caches information, thus making the implementation faster.
Answer the 1-based number of the line that is pointed to by the receiver’s instruction pointer, relative to the method’s file. The implementation is slow unless the DebugTools package is loaded.
Answer the debugger that is attached to the given context. It is always nil unless the DebugTools package is loaded.
Answer which debugger should be used to debug the current context chain. The class with the highest debugging priority is picked among those mentioned in the chain.
Answer whether the receiver is a context that should be hidden to the user when presenting a backtrace.
Next: ContextPart-printing, Previous: ContextPart-debugging, Up: ContextPart [Index]
Scan the backtrace for contexts whose selector is among those listed in selectors; if one is found, invoke aBlock passing the context.
Scan the backtrace for contexts which have the attribute selector listed in selectors; if one is found, invoke aBlock passing the context and the attribute.
Next: ContextPart-security checks, Previous: ContextPart-enumerating, Up: ContextPart [Index]
Print a backtrace from the receiver to the bottom of the stack on the Transcript.
Print a backtrace from the caller to the bottom of the stack on aStream.
Previous: ContextPart-printing, Up: ContextPart [Index]
Answer the receiver.
Not commented.
Not commented.
Not commented.
Not commented.
Not commented.
Next: CPtr, Previous: ContextPart, Up: Base classes [Index]
At my heart, I am something like the goto instruction; my creation sets the label, and my methods do the jump. However, this is a really powerful kind of goto instruction. If your hair is turning green at this point, don’t worry as you will probably only deal with users of continuations, rather than with the concept itself.
• Continuation class-instance creation: | (class) | |
• Continuation-invocation: | (instance) |
Next: Continuation-invocation, Up: Continuation [Index]
Return a continuation.
Pass a continuation to the one-argument block, aBlock and return the result of evaluating it.
Pass a continuation to the one-argument block, knowing that aBlock does not fall off (either because it includes a method return, or because it yields control to another continuation). If it does, an exception will be signalled and the current process terminated.
Previous: Continuation class-instance creation, Up: Continuation [Index]
Activate the original continuation, passing back in turn a continuation for the caller. The called continuation becomes unusable, and any attempt to reactivate it will cause an exception. This is not a limitation, in general, because this method is used to replace a continuation with another (see the implementation of the Generator class).
Return nil to the original continuation, which becomes unusable. Attempting to reactivate it will cause an exception. This is an optimization over #value.
Return anObject to the original continuation, which becomes unusable. Attempting to reactivate it will cause an exception. This is an optimization over #value:.
Return nil to the original continuation, copying the stack to allow another activation.
Return anObject to the original continuation, copying the stack to allow another activation.
Return the sole element of aCollection to the original continuation (or nil if aCollection is empty), copying the stack to allow another activation
Next: CPtrCType, Previous: Continuation, Up: Base classes [Index]
• CPtr-accessing: | (instance) |
Answer the receiver’s required aligment
Answer the receiver’s size
Answer the address of the location pointed to by the receiver.
Set the address of the location pointed to by the receiver to anObject, which can be either an Integer or a CObject. if anObject is an Integer, it is interpreted as a 32-bit or 64-bit address. If it is a CObject, its address is stored.
Next: CScalar, Previous: CPtr, Up: Base classes [Index]
• CPtrCType class-instance creation: | (class) | |
• CPtrCType-accessing: | (instance) | |
• CPtrCType-basic: | (instance) | |
• CPtrCType-storing: | (instance) |
Next: CPtrCType-accessing, Up: CPtrCType [Index]
Answer a new instance of CPtrCType that maps pointers to the given CType
Private - Called by computeAggregateType: for pointers
Next: CPtrCType-basic, Previous: CPtrCType class-instance creation, Up: CPtrCType [Index]
Answer the type of the elements in the receiver’s instances
Next: CPtrCType-storing, Previous: CPtrCType-accessing, Up: CPtrCType [Index]
Return whether the receiver and anObject are equal.
Return a hash code for the receiver.
Previous: CPtrCType-basic, Up: CPtrCType [Index]
Not commented.
Next: CScalarCType, Previous: CPtrCType, Up: Base classes [Index]
• CScalar class-instance creation: | (class) | |
• CScalar-accessing: | (instance) |
Next: CScalar-accessing, Up: CScalar [Index]
Answer a newly allocated CObject containing the passed value, anObject, in garbage-collected storage.
Answer a CType for the receiver—for example, CByteType if the receiver is CByte.
Answer a newly allocated CObject containing the passed value, anObject. Remember to call #addToBeFinalized if you want the CObject to be automatically freed
Previous: CScalar class-instance creation, Up: CScalar [Index]
Private - Provide a conversion from a CObject to a Smalltalk object to be stored by #at:put:
Answer the value the receiver is pointing to. The exact returned value depends on the receiver’s class
Set the receiver to point to the value, aValue. The exact meaning of aValue depends on the receiver’s class
Next: CShort, Previous: CScalar, Up: Base classes [Index]
• CScalarCType-accessing: | (instance) | |
• CScalarCType-storing: | (instance) |
Next: CScalarCType-storing, Up: CScalarCType [Index]
valueType is used as a means to communicate to the interpreter the underlying type of the data. For scalars, it is supplied by the CObject subclass.
Previous: CScalarCType-accessing, Up: CScalarCType [Index]
Store Smalltalk code that compiles to the receiver
Next: CSmalltalk, Previous: CScalarCType, Up: Base classes [Index]
• CShort class-accessing: | (class) | |
• CShort-accessing: | (instance) |
Next: CShort-accessing, Up: CShort [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CShort class-accessing, Up: CShort [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CString, Previous: CShort, Up: Base classes [Index]
• CSmalltalk class-accessing: | (class) | |
• CSmalltalk-accessing: | (instance) |
Next: CSmalltalk-accessing, Up: CSmalltalk [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CSmalltalk class-accessing, Up: CSmalltalk [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CStringCType, Previous: CSmalltalk, Up: Base classes [Index]
Technically, CString is really a pointer to CChar. However, it can be very useful as a distinct datatype because it is a separate datatype in Smalltalk, so we allow developers to express their semantics more precisely 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 a char *, use CChar>>#asString.
In general, I behave like a cross between an array of characters and a pointer to a character. I provide the protocol for both data types. My #value method returns a Smalltalk String, as you would expect for a scalar datatype.
• CString class-accessing: | (class) | |
• CString class-instance creation: | (class) | |
• CString-accessing: | (instance) |
Next: CString class-instance creation, Up: CString [Index]
Private - Provide a conversion from a CObject to a Smalltalk object to be stored by #at:put:
Next: CString-accessing, Previous: CString class-accessing, Up: CString [Index]
Answer a CType for the receiver—for example, CByteType if the receiver is CByte.
Answer a newly allocated CObject containing the passed value, anObject. Remember to call #addToBeFinalized if you want the CObject to be automatically freed
Previous: CString class-instance creation, Up: CString [Index]
Private - Provide a conversion from a CObject to a Smalltalk object to be stored by #at:put:
Answer the value the receiver is pointing to. The exact returned value depends on the receiver’s class
Set the receiver to point to the value, aValue. The exact meaning of aValue depends on the receiver’s class
Next: CStruct, Previous: CString, Up: Base classes [Index]
• CStringCType-accessing: | (instance) |
Up: CStringCType [Index]
Answer the type of the elements in the receiver’s instances
Next: CType, Previous: CStringCType, Up: Base classes [Index]
• CStruct class-subclass creation: | (class) |
Compile methods that implement the declaration in array.
Next: CUChar, Previous: CStruct, Up: Base classes [Index]
I am not part of the standard Smalltalk kernel class hierarchy. I contain type information used by subclasses of CObject, which represents external C data items.
My only instance variable, cObjectType, is used to hold onto the CObject subclass that gets created for a given CType. Used primarily in the C part of the interpreter because internally it cannot execute methods to get values, so it has a simple way to access instance variable which holds the desired subclass.
My subclasses have instances which represent the actual data types; for the scalar types, there is only one instance created of each, but for the aggregate types, there is at least one instance per base type and/or number of elements.
• CType class-C instance creation: | (class) | |
• CType class-initialization: | (class) | |
• CType-accessing: | (instance) | |
• CType-basic: | (instance) | |
• CType-C instance creation: | (instance) | |
• CType-storing: | (instance) |
Next: CType class-initialization, Up: CType [Index]
Create a new CType for the given subclass of CObject
Create a new CType for the given subclass of CObject
Private - Called by from: for pointers/arrays. Format of type: (#array #int 3) or (#ptr #{FooStruct})
Private - Pass the size, alignment, and description of CType for aBlock, given the field description in ‘type’ (the second element of each pair).
Next: CType-accessing, Previous: CType class-C instance creation, Up: CType [Index]
Initialize the receiver’s TypeMap
Next: CType-basic, Previous: CType class-initialization, Up: CType [Index]
Answer the size of the receiver’s instances
Answer a CArrayCType which represents an array with the given size of CObjects whose type is in turn represented by the receiver
Answer the CObject subclass whose instance is created when new is sent to the receiver
Allocate a new CObject with room for anInteger C objects of the type (class) identified by the receiver. It is the caller’s responsibility to free the memory allocated for it.
Answer a CPtrCType which represents a pointer to CObjects whose type is in turn represented by the receiver
Answer the size of the receiver’s instances
valueType is used as a means to communicate to the interpreter the underlying type of the data. For anything but scalars, it’s just ’self’
Next: CType-C instance creation, Previous: CType-accessing, Up: CType [Index]
Return whether the receiver and anObject are equal.
Return a hash code for the receiver.
Next: CType-storing, Previous: CType-basic, Up: CType [Index]
Create a new CObject with the type (class) identified by the receiver, pointing to the given address (identified by an Integer or CObject).
Allocate a new CObject with the type (class) identified by the receiver. The object is movable in memory, but on the other hand it is garbage-collected automatically.
Allocate a new CObject with room for anInteger C object of the type (class) identified by the receiver. The object is movable in memory, but on the other hand it is garbage-collected automatically.
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.
Previous: CType-C instance creation, Up: CType [Index]
Store Smalltalk code that compiles to the receiver
Next: CUInt, Previous: CType, Up: Base classes [Index]
• CUChar class-getting info: | (class) | |
• CUChar-accessing: | (instance) |
Next: CUChar-accessing, Up: CUChar [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CUChar class-getting info, Up: CUChar [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CULong, Previous: CUChar, Up: Base classes [Index]
• CUInt class-accessing: | (class) | |
• CUInt-accessing: | (instance) |
Next: CUInt-accessing, Up: CUInt [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CUInt class-accessing, Up: CUInt [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CULongLong, Previous: CUInt, Up: Base classes [Index]
• CULong class-accessing: | (class) | |
• CULong-accessing: | (instance) |
Next: CULong-accessing, Up: CULong [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CULong class-accessing, Up: CULong [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CUnion, Previous: CULong, Up: Base classes [Index]
• CULongLong class-accessing: | (class) | |
• CULongLong-accessing: | (instance) |
Next: CULongLong-accessing, Up: CULongLong [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CULongLong class-accessing, Up: CULongLong [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: CUShort, Previous: CULongLong, Up: Base classes [Index]
• CUnion class-subclass creation: | (class) |
Compile methods that implement the declaration in array.
Next: Date, Previous: CUnion, Up: Base classes [Index]
• CUShort class-accessing: | (class) | |
• CUShort-accessing: | (instance) |
Next: CUShort-accessing, Up: CUShort [Index]
Answer the receiver’s instances required aligment
Private - Answer an index referring to the receiver’s instances scalar type
Answer the receiver’s instances size
Previous: CUShort class-accessing, Up: CUShort [Index]
Answer the receiver’s required aligment
Private - Answer an index referring to the receiver’s scalar type
Answer the receiver’s size
Next: DateTime, Previous: CUShort, Up: Base classes [Index]
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 the beginning of the epoch. Dates before 1582 will not be correctly printed. In addition, 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 will yield 6-Oct-1582 (a non-existent day!), not 16-Oct-1582.
In fact, if you pass a year < 1582 to a method like #newDay:month:year: it will assume that it is a two-digit year (e.g. 90=1990, 1000=2900). The only way to create Julian calendar dates is with the #fromDays: instance creation method.
• Date class-basic: | (class) | |
• Date class-instance creation (ANSI): | (class) | |
• Date class-instance creation (Blue Book): | (class) | |
• Date-basic: | (instance) | |
• Date-compatibility (non-ANSI): | (instance) | |
• Date-date computations: | (instance) | |
• Date-printing: | (instance) | |
• Date-still unclassified: | (instance) | |
• Date-storing: | (instance) | |
• Date-testing: | (instance) |
Next: Date class-instance creation (ANSI), Up: Date [Index]
Answer the abbreviated name of the day of week corresponding to the given index
Answer the index of the day of week corresponding to the given name
Answer the number of days in the given (named) month for the given year
Answer the number of days in the given year
Answer the index of the month corresponding to the given name
Initialize the DayNameDict to the names of the days
Initialize the MonthNameDict to the names of the months
Initialize the receiver
Answer the name of the day of week corresponding to the given index
Answer the name of the month corresponding to the given index
Answer the name of the month corresponding to the given index
Next: Date class-instance creation (Blue Book), Previous: Date class-basic, Up: Date [Index]
Answer a Date denoting the d-th day of the given year
Answer a Date denoting the d-th day of the given (as a number) month and year
Next: Date-basic, Previous: Date class-instance creation (ANSI), Up: Date [Index]
Answer an array containing the current date and time
Answer a Date denoting dayCount days past 1/1/1901
Answer a Date denoting the jd-th day in the astronomical Julian calendar.
Answer a Date denoting the date time seconds past Jan 1st, 1901
Answer a Date denoting the dayCount day of the given (named) month and year
Answer a Date denoting the dayCount day of the given (as a number) month and year
Answer a Date denoting the dayCount day of the yearInteger year
Parse an instance of the receiver from aStream
Answer a Date denoting the current date in local time
Answer an array containing the current date and time in Coordinated Universal Time (UTC)
Answer a Date denoting the current date in Coordinated Universal Time (UTC)
Next: Date-compatibility (non-ANSI), Previous: Date class-instance creation (Blue Book), Up: Date [Index]
Answer a new Duration counting the number of days between the receiver and aDate.
Answer a new Date pointing dayCount past the receiver
Answer the number of days between aDate and the receiver (negative if the receiver is before aDate)
Answer a new Date pointing dayCount before the receiver
Next: Date-date computations, Previous: Date-basic, Up: Date [Index]
Answer the day represented by the receiver
Answer the day of week of the receiver as a Symbol
Answer the abbreviated name of the month represented by the receiver
Next: Date-printing, Previous: Date-compatibility (non-ANSI), Up: Date [Index]
Answer the date as the number of seconds from 1/1/1901.
Answer the day represented by the receiver (same as #day)
Answer the day of week of the receiver. 1 = Monday, 7 = Sunday
Answer the day of week of the receiver as a Symbol
Answer the day of week of the receiver as a Symbol
Answer the days passed since 31/12 of last year; e.g. New Year’s Day is 1
Answer the days passed since 1/1/1901
Answer the days in the month represented by the receiver
Answer the days in the year represented by the receiver
Answer the days to the end of the month represented by the receiver
Answer the days to the end of the year represented by the receiver
Answer a Date representing the first day of the month represented by the receiver
Answer whether the receiver refers to a date in a leap year.
Answer a Date representing the last day of the month represented by the receiver
Answer the index of the month represented by the receiver
Answer the abbreviated name of the month represented by the receiver
Answer the index of the month represented by the receiver
Answer the name of the month represented by the receiver
Answer the year represented by the receiver
Next: Date-still unclassified, Previous: Date-date computations, Up: Date [Index]
Print a representation for the receiver on aStream
Next: Date-storing, Previous: Date-printing, Up: Date [Index]
Answer a new Date or DateTime pointing aDuration time past the receiver.
Next: Date-testing, Previous: Date-still unclassified, Up: Date [Index]
Store on aStream Smalltalk code compiling to the receiver
Previous: Date-storing, Up: Date [Index]
Answer whether the receiver indicates a date preceding aDate
Answer whether the receiver indicates the same date as aDate
Answer an hash value for the receievr
Next: DeferredVariableBinding, Previous: Date, Up: Base classes [Index]
My instances represent timestamps.
• DateTime class-information: | (class) | |
• DateTime class-instance creation: | (class) | |
• DateTime class-instance creation (non-ANSI): | (class) | |
• DateTime-basic: | (instance) | |
• DateTime-computations: | (instance) | |
• DateTime-printing: | (instance) | |
• DateTime-splitting in dates & times: | (instance) | |
• DateTime-storing: | (instance) | |
• DateTime-testing: | (instance) | |
• DateTime-time zones: | (instance) |
Next: DateTime class-instance creation, Up: DateTime [Index]
Answer ‘ClockPrecision’.
Initialize the receiver’s class variables
Next: DateTime class-instance creation (non-ANSI), Previous: DateTime class-information, Up: DateTime [Index]
Answer an instance of the receiver referring to the current date and time.
Parse an instance of the receiver from aStream
Answer an instance of the receiver referring to midnight of today in local time.
Answer a DateTime denoting the d-th day of the given year, and setting the time part to the given hour, minute, and second
Answer a DateTime denoting the d-th day of the given year. Set the offset field to ofs (a Duration), and the time part to the given hour, minute, and second
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
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), and the the time part to the given hour, minute, and second
Next: DateTime-basic, Previous: DateTime class-instance creation, Up: DateTime [Index]
Answer a DateTime denoting the given date and time. Set the offset field to ofs (a Duration).
Answer a DateTime denoting the given date and time. Set the offset field to ofs (a Duration).
Answer a DateTime denoting the given date (as days since January 1, 1901) and time (as seconds since UTC midnight).
Answer a DateTime denoting the given date (as days since January 1, 1901) and time (as seconds since midnight). Set the offset field to ofs (a Duration).
Answer a DateTime denoting the given date and time (as seconds since January 1, 1901 midnight UTC).
Answer a DateTime denoting the given date and time (as seconds since January 1, 1901 midnight). Set the offset field to ofs (a Duration).
Next: DateTime-computations, Previous: DateTime class-instance creation (non-ANSI), Up: DateTime [Index]
Answer a new Date pointing aDuration time past the receiver
Answer a new Date pointing dayCount before the receiver
Next: DateTime-printing, Previous: DateTime-basic, Up: DateTime [Index]
Answer the date as the number of seconds from 1/1/1901.
Answer the day of week of the receiver. Unlike Dates, DateAndTimes have 1 = Sunday, 7 = Saturday
Answer the hour in a 24-hour clock
Answer the hour in a 12-hour clock
Answer the hour in a 24-hour clock
Answer either #AM (for anti-meridian) or #PM (for post-meridian)
Answer the minute
Answer the month represented by the receiver
Next: DateTime-splitting in dates & times, Previous: DateTime-computations, Up: DateTime [Index]
Print a representation for the receiver on aStream
Next: DateTime-storing, Previous: DateTime-printing, Up: DateTime [Index]
Answer a Date referring to the same day as the receiver
Answer a Time referring to the same time (from midnight) as the receiver
Since in the past timestamps were referred to as Arrays containing a Date and a Time (in this order), this method provides access to DateTime objects like if they were two-element Arrays.
Next: DateTime-testing, Previous: DateTime-splitting in dates & times, Up: DateTime [Index]
Store on aStream Smalltalk code compiling to the receiver
Next: DateTime-time zones, Previous: DateTime-storing, Up: DateTime [Index]
Answer whether the receiver indicates a date preceding aDate
Answer whether the receiver indicates the same date as aDate
Answer an hash value for the receievr
Previous: DateTime-testing, Up: DateTime [Index]
Answer the receiver, since DateTime objects store themselves in Local time
Convert the receiver to UTC time, and answer a new DateTime object.
Answer the receiver’s offset from UTC to local time (e.g. +3600 seconds for Central Europe Time, -3600*6 seconds for Eastern Standard Time). The offset is expressed as a Duration
Answer a copy of the receiver with the offset from UTC to local time changed to anOffset (a Duration).
Answer an abbreviated indication of the receiver’s offset, expressed as ‘shhmm’, where ‘hh’ is the number of hours and ‘mm’ is the number of minutes between UTC and local time, and ‘s’ can be ‘+’ for the Eastern hemisphere and ‘-’ for the Western hemisphere.
Answer the time zone name for the receiver (currently, it is simply ‘GMT +xxxx’, where ‘xxxx’ is the receiver’s #timeZoneAbbreviation).
Next: Delay, Previous: DateTime, Up: Base classes [Index]
I represent a binding to a variable that is not tied to a particular dictionary until the first access. Then, lookup rules for global variables in the scope of a given class are used.
• DeferredVariableBinding class-basic: | (class) | |
• DeferredVariableBinding-basic: | (instance) | |
• DeferredVariableBinding-storing: | (instance) |
Next: DeferredVariableBinding-basic, Up: DeferredVariableBinding [Index]
Answer a binding that will look up aSymbol as a variable in aClass’s environment at first access. See #resolveBinding’s comment for aDictionary’s meaning.
As with #key:class:defaultDictionary:, but accepting an array of symbols, representing a namespace path, instead.
Next: DeferredVariableBinding-storing, Previous: DeferredVariableBinding class-basic, Up: DeferredVariableBinding [Index]
Answer the path followed after resolving the first key.
Answer a new instance of the receiver with the given key and value
Answer a new instance of the receiver with the given key and value
Previous: DeferredVariableBinding-basic, Up: DeferredVariableBinding [Index]
Put on aStream some Smalltalk code compiling to the receiver
Put on aStream some Smalltalk code compiling to the receiver
Next: DelayedAdaptor, Previous: DeferredVariableBinding, Up: Base classes [Index]
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 operating systems’ fault). When a process sends one of my instances a wait message, that process goes to sleep for the interval specified when the instance was created.
• Delay class-instance creation: | (class) | |
• Delay class-still unclassified: | (class) | |
• Delay class-timer process: | (class) | |
• Delay-accessing: | (instance) | |
• Delay-comparing: | (instance) | |
• Delay-copying: | (instance) | |
• Delay-delaying: | (instance) | |
• Delay-initialization: | (instance) | |
• Delay-instance creation: | (instance) | |
• Delay-testing: | (instance) | |
• Delay-timeout: | (instance) |
Next: Delay class-still unclassified, Up: Delay [Index]
Answer a Delay waiting for millisecondCount milliseconds
Answer a Delay waiting for nanosecondCount nanoseconds
Answer a Delay waiting for secondCount seconds
Answer a Delay waiting until millisecondCount milliseconds after startup
Answer a Delay waiting until nanosecondCount nanoseconds after startup
Next: Delay class-timer process, Previous: Delay class-instance creation, Up: Delay [Index]
Prime the timer event loop when the image starts running.
Next: Delay-accessing, Previous: Delay class-still unclassified, Up: Delay [Index]
Return the delay at the head of the queue.
Handle a timer event; which can be either: - a schedule or unschedule request (DelayRequestor notNil) - a timer signal (not explicitly specified) We check for timer expiry every time we get a signal.
Run the timer event loop.
Private - Schedule this Delay. Run in the timer process, which is the only one that manipulates Queue.
Start the timer event loop.
Private - Unschedule this Delay. Run in the timer process, which is the only one that manipulates Queue.
Next: Delay-comparing, Previous: Delay class-timer process, Up: Delay [Index]
Answer a delay that waits until the current delay’s resumptionTime, or delayDuration milliseconds from now if that would be nil. May answer the receiver if it is already waiting until an absolute time.
Answer the time I have left to wait, in milliseconds.
Answer whether the receiver waits until an absolute time on the millisecond clock.
Answer ‘resumptionTime’.
Next: Delay-copying, Previous: Delay-accessing, Up: Delay [Index]
Answer whether the receiver and aDelay denote the same delay
Answer an hash value for the receiver
Next: Delay-delaying, Previous: Delay-comparing, Up: Delay [Index]
Adjust the current delay so that it behaves as if it had just been created.
Next: Delay-initialization, Previous: Delay-copying, Up: Delay [Index]
Schedule this Delay and wait on it. The current process will be suspended for the amount of time specified when this Delay was created, or until aSemaphore is signaled.
Schedule this Delay and wait on it. The current process will be suspended for the amount of time specified when this Delay was created.
Next: Delay-instance creation, Previous: Delay-delaying, Up: Delay [Index]
Initialize a Delay waiting for millisecondCount milliseconds
Next: Delay-testing, Previous: Delay-initialization, Up: Delay [Index]
Initialize a Delay waiting for millisecondCount milliseconds after startup
Next: Delay-timeout, Previous: Delay-instance creation, Up: Delay [Index]
Answer whether this Delay is being waited on.
Previous: Delay-testing, Up: Delay [Index]
Execute aBlock for up to the time of my own delay; in case the code did not finish abort the execution, unwind the block and then evaluate aTimeoutBlock.
Next: Dictionary, Previous: Delay, Up: Base classes [Index]
I can be used where many expensive updates must be performed. My instances buffer the last value that was set, and only actually set the value when the #trigger message is sent. Apart from this, I’m equivalent to PluggableAdaptor.
• DelayedAdaptor-accessing: | (instance) |
Up: DelayedAdaptor [Index]
Really set the value of the receiver.
Get the value of the receiver.
Set the value of the receiver - actually, the value is cached and is not set until the #trigger method is sent.
Next: DirectedMessage, Previous: DelayedAdaptor, Up: Base classes [Index]
I implement a dictionary, which is an object that is indexed by unique objects (typcially instances of Symbol), and associates another object with that index. I use the equality operator = to determine equality of indices.
In almost all places where you would use a plain Dictionary, a LookupTable would be more efficient; see LookupTable’s comment before you use it. I do have a couple of special features that are useful in certain special cases.
• Dictionary class-instance creation: | (class) | |
• Dictionary-accessing: | (instance) | |
• Dictionary-awful ST-80 compatibility hacks: | (instance) | |
• Dictionary-compilation: | (instance) | |
• Dictionary-dictionary enumerating: | (instance) | |
• Dictionary-dictionary removing: | (instance) | |
• Dictionary-dictionary testing: | (instance) | |
• Dictionary-namespace protocol: | (instance) | |
• Dictionary-printing: | (instance) | |
• Dictionary-rehashing: | (instance) | |
• Dictionary-removing: | (instance) | |
• Dictionary-storing: | (instance) | |
• Dictionary-testing: | (instance) |
Next: Dictionary-accessing, Up: Dictionary [Index]
Answer a new dictionary created from the keys and values of Associations in anArray, such as {1 -> 2. 3 -> 4}. anArray should be specified using brace-syntax.
Create a new dictionary with a default size
Next: Dictionary-awful ST-80 compatibility hacks, Previous: Dictionary class-instance creation, Up: Dictionary [Index]
Add the newObject association to the receiver
Adds all the elements of ’aCollection’ to the receiver, answer aCollection
Answer the key/value Association for the given key. Fail if the key is not found
Answer the key/value Association for the given key. Evaluate aBlock (answering the result) if the key is not found
Returns the content of a Dictionary as a Set of Associations.
Answer the value associated to the given key. Fail if the key is not found
Answer the value associated to the given key, or the result of evaluating aBlock if the key is not found
Answer the value associated to the given key. If the key is not found, evaluate aBlock and associate the result to aKey before returning.
If aKey is absent, answer nil. Else, evaluate aBlock passing the associated value and answer the result of the invocation
Store value as associated to the given key
Answer a Dictionary that only includes the given keys. Fail if any of them is not found
Answer the key associated to the given value, or nil if the value is not found
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
Answer a kind of Set containing the keys of the receiver
Answer an Array containing the values of the receiver
Next: Dictionary-compilation, Previous: Dictionary-accessing, Up: Dictionary [Index]
Tries to see if key exists as a the key of an indexed variable. As soon as nil or an association with the correct key is found, the index of that slot is answered
Next: Dictionary-dictionary enumerating, Previous: Dictionary-awful ST-80 compatibility hacks, Up: Dictionary [Index]
Answer the dictionary that is used when the receiver is before a period in Smalltalk source code.
Next: Dictionary-dictionary removing, Previous: Dictionary-compilation, Up: Dictionary [Index]
Pass each association in the dictionary to aBlock
Answer a new dictionary where the keys are the same and the values are obtained by passing each value to aBlock and collecting the return values
Pass each value in the dictionary to aBlock
Pass each key/value pair in the dictionary as two distinct parameters to aBlock
Pass each key in the dictionary to aBlock
Answer a new dictionary containing the key/value pairs for which aBlock returns false. aBlock only receives the value part of the pairs.
Answer a new dictionary containing the key/value pairs for which aBlock returns true. aBlock only receives the value part of the pairs.
Next: Dictionary-dictionary testing, Previous: Dictionary-dictionary enumerating, Up: Dictionary [Index]
Remove anAssociation’s key from the dictionary
Remove anAssociation’s key from the dictionary
Remove all the keys in keys, without raising any errors
Remove all the keys in keys, passing the missing keys as parameters to aBlock as they’re encountered
Remove the passed key from the dictionary, fail if it is not found
Remove the passed key from the dictionary, answer the result of evaluating aBlock if it is not found
Next: Dictionary-namespace protocol, Previous: Dictionary-dictionary removing, Up: Dictionary [Index]
Answer whether the receiver contains anObject as one of its values
Answer whether the receiver contains the key which is anAssociation’s key and its value is anAssociation’s value
Answer whether the receiver contains the given key
Answer whether the number of occurrences of aValue as one of the receiver’s values
Next: Dictionary-printing, Previous: Dictionary-dictionary testing, Up: Dictionary [Index]
Answer all the receiver’s superspaces in a collection
Evaluate aBlock once for each of the receiver’s superspaces (which is none for BindingDictionary).
Answer a kind of Set containing the keys of the receiver
Answer whether the receiver defines the given key. ‘Defines’ means that the receiver’s superspaces, if any, are not considered.
Return the association for the variable named as specified by ‘key’ *in this namespace*. If the key is not found search will *not* be carried on in superspaces and the method will fail.
Return the association for the variable named as specified by ‘key’ *in this namespace*. If the key is not found search will *not* be carried on in superspaces and aBlock will be immediately evaluated.
Return the value associated to the variable named as specified by ‘key’ *in this namespace*. If the key is not found search will *not* be carried on in superspaces and the method will fail.
Return the value associated to the variable named as specified by ‘key’ *in this namespace*. If the key is not found search will *not* be carried on in superspaces and aBlock will be immediately evaluated.
Answer whether aNamespace is one of the receiver’s direct and indirect superspaces
Answer the receiver’s superspace, which is nil for BindingDictionary.
Answer the receiver and all of its superspaces in a collection, which is none for BindingDictionary
Invokes aBlock for the receiver and all superspaces, both direct and indirect (though a BindingDictionary does not have any).
Next: Dictionary-rehashing, Previous: Dictionary-namespace protocol, Up: Dictionary [Index]
Print all the instance variables and objects in the receiver on aStream
Print a representation of the receiver on aStream
Next: Dictionary-removing, Previous: Dictionary-printing, Up: Dictionary [Index]
Rehash the receiver
Next: Dictionary-storing, Previous: Dictionary-rehashing, Up: Dictionary [Index]
Remove from the receiver all keys for which aBlock returns true.
Next: Dictionary-testing, Previous: Dictionary-removing, Up: Dictionary [Index]
Print Smalltalk code compiling to the receiver on aStream
Previous: Dictionary-storing, Up: Dictionary [Index]
Answer whether the receiver and aDictionary are equal
Answer the hash value for the receiver
Next: Directory, Previous: Dictionary, Up: Base classes [Index]
I represent a message send: I contain the receiver, selector and arguments for a message.
• DirectedMessage class-creating instances: | (class) | |
• DirectedMessage-accessing: | (instance) | |
• DirectedMessage-basic: | (instance) | |
• DirectedMessage-multiple process: | (instance) | |
• DirectedMessage-saving and loading: | (instance) |
Next: DirectedMessage-accessing, Up: DirectedMessage [Index]
Create a new instance of the receiver
Create a new instance of the receiver
Create a new instance of the receiver
This method should not be called for instances of this class.
Create a new instance of the receiver
Next: DirectedMessage-basic, Previous: DirectedMessage class-creating instances, Up: DirectedMessage [Index]
Answer the receiver
Change the receiver
Next: DirectedMessage-multiple process, Previous: DirectedMessage-accessing, Up: DirectedMessage [Index]
Print a representation of the receiver on aStream
Send the message
Send the message (this message provides interoperability between DirectedMessages and blocks)
Send the message with the sole argument anObject (this message provides interoperability between DirectedMessages and blocks)
Send the message with the arguments obj1 and obj2 (this message provides interoperability between DirectedMessages and blocks)
Send the message with the arguments replaced by anArray (this message provides interoperability between DirectedMessages and blocks)
Next: DirectedMessage-saving and loading, Previous: DirectedMessage-basic, Up: DirectedMessage [Index]
Create a new process executing the receiver and start it
Create a new process executing the receiver with given priority and start it
Create a new process executing the receiver in suspended state. The priority is the same as for the calling process. The receiver must not contain returns
Previous: DirectedMessage-multiple process, Up: DirectedMessage [Index]
This method is used when DirectedMessages are used together with PluggableProxies (see ObjectDumper). It sends the receiver to reconstruct the object that was originally stored.
Next: DLD, Previous: DirectedMessage, Up: Base classes [Index]
I am the counterpart of File in a tree-structured file system. I provide the notion of a current working directory and know several well-known places in the file system.
However, all navigation methods for directories are under FilePath or File for efficiency reasons. Refer to the manual of FilePath for information on how to use the instances returned by my class methods.
• Directory class-file name management: | (class) | |
• Directory class-file operations: | (class) | |
• Directory class-reading system defaults: | (class) |
Next: Directory class-file operations, Up: Directory [Index]
Answer the name of a file named ‘fileName’ which resides in a directory named ‘directory’.
Answer (as a Character) the character used to separate directory names
Answer (in a String) the character used to separate directory names
Next: Directory class-reading system defaults, Previous: Directory class-file name management, Up: Directory [Index]
Invoke #allFilesMatching:do: on the current working directory.
Create a directory named dirName and answer it.
Create an empty directory whose name starts with prefix and answer it.
Answer the current working directory, not following symlinks.
Change the current working directory to dirName.
Previous: Directory class-file operations, Up: Directory [Index]
Answer the path to GNU Smalltalk’s executable installation prefix
Answer the path to the user’s home directory
Answer the path to GNU Smalltalk’s image file
Answer the path in which a local version of the GNU Smalltalk kernel’s Smalltalk source files were searched when the image was created.
Answer the path to GNU Smalltalk’s auxiliary executables
Answer the path to the GNU Smalltalk kernel’s Smalltalk source files. Same as ‘Directory kernel’ since GNU Smalltalk 3.0.
Answer the path to GNU Smalltalk’s dynamically loaded modules
Answer the path to GNU Smalltalk’s installation prefix
Answer the path to the installed Smalltalk kernel source files.
Answer the path in which temporary files can be created. This is read from the environment, and guessed if that fails.
Answer the base path under which file for user customization of GNU Smalltalk are stored.
Next: DumperProxy, Previous: Directory, Up: Base classes [Index]
...and Gandalf said: “Many folk like to know beforehand what is to be set on the table; but those who have laboured to prepare the feast like to keep their secret; for wonder makes the words of praise louder.”
I am just an ancillary class used to reference some C functions. Most of my actual functionality is used by redefinitions of methods in CFunctionDescriptor.
• DLD class-C call-outs: | (class) | |
• DLD class-dynamic linking: | (class) |
Next: DLD class-dynamic linking, Up: DLD [Index]
Register aFuncAddr as the target for cCalls to aName.
Previous: DLD class-C call-outs, Up: DLD [Index]
Add library to the search path of libraries to be used by DLD.
This is called internally by gst_dlopen. The library will be open and put in the search path.
Add library to the list of modules to be loaded when the image is started. The gst_initModule function in the library is called, but the library will not be put in the search path used whenever a C function is requested but not registered.
This method calls #primDefineExternFunc: to try to link to a function with the given name, and answers whether the linkage was successful. You can redefine this method to restrict the ability to do dynamic linking.
Private - Initialize the receiver’s class variables
Answer a copy of the search path of libraries to be used by DLD
Answer a copy of the modules reloaded when the image is started
This method tries to link to a function with the given name, and answers whether the linkage was successful. It should not be overridden.
Called on startup - Make DLD re-link and reset the addresses of all the externally defined functions
Next: Duration, Previous: DLD, Up: Base classes [Index]
I am an helper class for ObjectDumper. When an object cannot be saved in the standard way, you can register a subclass of me to provide special means to save that object.
• DumperProxy class-accessing: | (class) | |
• DumperProxy class-instance creation: | (class) | |
• DumperProxy-saving and restoring: | (instance) |
Next: DumperProxy class-instance creation, Up: DumperProxy [Index]
The receiver was asked to be used as a proxy for the class aClass. Answer whether the registration is fine. By default, answer true
Reload a proxy stored in anObjectDumper and reconstruct the object
Next: DumperProxy-saving and restoring, Previous: DumperProxy class-accessing, Up: DumperProxy [Index]
Answer a proxy to be used to save anObject. This method MUST be overridden and anObject must NOT be stored in the object’s instance variables unless you override #dumpTo:, because that would result in an infinite loop!
Previous: DumperProxy class-instance creation, Up: DumperProxy [Index]
Dump the proxy to anObjectDumper – the #loadFrom: class method will reconstruct the original object.
Reconstruct the object stored in the proxy and answer it
Next: DynamicVariable, Previous: DumperProxy, Up: Base classes [Index]
My instances represent differences between timestamps.
• Duration class-instance creation: | (class) | |
• Duration class-instance creation (non ANSI): | (class) | |
• Duration-arithmetics: | (instance) | |
• Duration-processes: | (instance) | |
• Duration-storing: | (instance) |
Next: Duration class-instance creation (non ANSI), Up: Duration [Index]
Answer a duration of ‘d’ days
Answer a duration of ‘d’ days and the given number of hours, minutes, and seconds.
Initialize the receiver’s instance variables
Answer a duration of ‘msec’ milliseconds
Parse an instance of the receiver (hours/minutes/seconds) from aStream
Answer a duration of ‘w’ weeks
Answer a duration of zero seconds.
Next: Duration-arithmetics, Previous: Duration class-instance creation, Up: Duration [Index]
Answer a duration of ‘d’ days and ‘secs’ seconds. The last parameter is unused; this message is available for interoperability with the DateTime class.
Next: Duration-processes, Previous: Duration class-instance creation (non ANSI), Up: Duration [Index]
Answer a Duration that is ‘factor’ times longer than the receiver
Answer a Duration that is the sum of the receiver and aDuration’s lengths.
Answer a Duration that is the difference of the receiver and aDuration’s lengths.
If the parameter is a Duration, answer the ratio between the receiver and factorOrDuration. Else divide the receiver by factorOrDuration (a Number) and answer a new Duration that is correspondingly shorter.
Answer a Duration that is as long as the receiver, but always in the future.
Answer the number of days in the receiver
Answer whether the receiver correspond to a duration of zero seconds.
Answer a Duration that is as long as the receiver, but with past and future exchanged.
Answer whether the receiver is in the past.
Answer whether the receiver is a zero-second duration or is in the future.
Print a represention of the receiver on aStream.
Next: Duration-storing, Previous: Duration-arithmetics, Up: Duration [Index]
Answer a Delay waiting for the amount of time represented by the receiver and start waiting on it.
Previous: Duration-processes, Up: Duration [Index]
Store on aStream Smalltalk code compiling to the receiver
Next: Error, Previous: Duration, Up: Base classes [Index]
I am a variable that is visible only in the stackframes outgoing from this one. Do not use DynamicVariable directly, instead create a subclass for each variable you want to use.
You can override the #value class method, and call #valueIfAbsent: from there if you want the default value to be something else than nil.
• DynamicVariable class-evaluating: | (class) |
Up: DynamicVariable [Index]
Not commented.
Not commented.
Not commented.
Next: Exception, Previous: DynamicVariable, Up: Base classes [Index]
Error represents a fatal error. Instances of it are not resumable.
• Error-exception description: | (instance) |
Answer a textual description of the exception.
Answer false. Error exceptions are by default unresumable; subclasses can override this method if desired.
Next: ExceptionSet, Previous: Error, Up: Base classes [Index]
My instances describe an exception that has happened, and are passed to exception handlers. Classes describe the kind of exception.
Apart from containing information on the generated exception, my instances contain methods that allow you to resume execution, leave the #on:do:... block, and pass the exception to an handler with a lower priority.
• Exception class-comparison: | (class) | |
• Exception class-creating ExceptionCollections: | (class) | |
• Exception class-instance creation: | (class) | |
• Exception class-interoperability with TrappableEvents: | (class) | |
• Exception-accessing: | (instance) | |
• Exception-built ins: | (instance) | |
• Exception-comparison: | (instance) | |
• Exception-copying: | (instance) | |
• Exception-exception description: | (instance) | |
• Exception-exception handling: | (instance) | |
• Exception-exception signaling: | (instance) | |
• Exception-still unclassified: | (instance) |
Next: Exception class-creating ExceptionCollections, Up: Exception [Index]
Answer how good the receiver is at handling the given exception. A negative value indicates that the receiver is not able to handle the exception.
Answer whether the receiver handles ‘anException’.
Next: Exception class-instance creation, Previous: Exception class-comparison, Up: Exception [Index]
Answer an ExceptionCollection containing all the exceptions in the receiver and all the exceptions in aTrappableEvent
Next: Exception class-interoperability with TrappableEvents, Previous: Exception class-creating ExceptionCollections, Up: Exception [Index]
Create an instance of the receiver, which you will be able to signal later.
Create an instance of the receiver, give it default attributes, and signal it immediately.
Create an instance of the receiver, set its message text, and signal it immediately.
Next: Exception-accessing, Previous: Exception class-instance creation, Up: Exception [Index]
Private - Pass ourselves to aBlock
Next: Exception-built ins, Previous: Exception class-interoperability with TrappableEvents, Up: Exception [Index]
Answer an exception’s message text. Do not override this method.
Answer an exception’s message text.
Set an exception’s message text.
Answer an exception’s tag value. If not specified, it is the same as the message text.
Set an exception’s tag value. If nil, the tag value will be the same as the message text.
Next: Exception-comparison, Previous: Exception-accessing, Up: Exception [Index]
This might start the debugger... Note that we use #basicPrint ’cause #printOn: might invoke an error.
Next: Exception-copying, Previous: Exception-built ins, Up: Exception [Index]
Answer whether the receiver is equal to anObject. This is true if either the receiver or its class are the same object as anObject.
Next: Exception-exception description, Previous: Exception-comparison, Up: Exception [Index]
Modify the receiver so that it does not refer to any instantiated exception handler.
Next: Exception-exception handling, Previous: Exception-copying, Up: Exception [Index]
Execute the default action that is attached to the receiver.
Answer a textual description of the exception.
Answer true. Exceptions are by default resumable.
Next: Exception-exception signaling, Previous: Exception-exception description, Up: Exception [Index]
Return the execution context for the #on:do: snippet
Answer whether the current exception handler is within the scope of another handler for the same exception.
Raise the exception that instantiated the receiver, passing the same parameters. If the receiver is resumable and the evaluated exception action resumes then the result returned from #outer will be the resumption value of the evaluated exception action. If the receiver is not resumable or if the exception action does not resume then this message will not return, and #outer will be equivalent to #pass.
Yield control to the enclosing exception action for the receiver. Similar to #outer, but control does not return to the currently active exception handler.
Reinstate all handlers and execute the handler for ‘replacementException’; control does not return to the currently active exception handler. The new Signal object that is created has the same contents as the receiver (this might or not be correct – if it isn’t you can use an idiom such as ‘sig retryUsing: [ replacementException signal ])
If the exception is resumable, resume the execution of the block that raised the exception; the method that was used to signal the exception will answer the receiver. Use this method IF AND ONLY IF you know who caused the exception and if it is possible to resume it in that particular case
If the exception is resumable, resume the execution of the block that raised the exception; the method that was used to signal the exception will answer anObject. Use this method IF AND ONLY IF you know who caused the exception and if it is possible to resume it in that particular case
Re-execute the receiver of the #on:do: message. All handlers are reinstated: watch out, this can easily cause an infinite loop.
Execute aBlock reinstating all handlers, and return its result from the #signal method.
Exit the #on:do: snippet, answering nil to its caller.
Exit the #on:do: snippet, answering anObject to its caller.
Next: Exception-still unclassified, Previous: Exception-exception handling, Up: Exception [Index]
Raise the exceptional event represented by the receiver
Raise the exceptional event represented by the receiver, setting its message text to messageText.
Previous: Exception-exception signaling, Up: Exception [Index]
Return the execution context for the place that signaled the exception, or nil if it is not available anymore (for example if the exception handler has returned.
Next: False, Previous: Exception, Up: Base classes [Index]
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 to use the same handler for many exceptions without having to write duplicate code
• ExceptionSet class-instance creation: | (class) | |
• ExceptionSet-enumerating: | (instance) | |
• ExceptionSet-instance creation: | (instance) |
Next: ExceptionSet-enumerating, Up: ExceptionSet [Index]
Private - Answer a new, empty ExceptionSet
Next: ExceptionSet-instance creation, Previous: ExceptionSet class-instance creation, Up: ExceptionSet [Index]
Private - Evaluate aBlock for every exception in the receiver. Answer the receiver
Answer how good the receiver is at handling the given exception. A negative value indicates that the receiver is not able to handle the exception.
Answer whether the receiver handles ‘exception’.
Previous: ExceptionSet-enumerating, Up: ExceptionSet [Index]
Answer an ExceptionSet containing all the exceptions in the receiver and all the exceptions in aTrappableEvent
Next: File, Previous: ExceptionSet, Up: Base classes [Index]
I always tell lies. I have a single instance in the system, which represents the value false.
• False-basic: | (instance) | |
• False-C hacks: | (instance) | |
• False-printing: | (instance) |
Next: False-C hacks, Up: False [Index]
We are false – anded with anything, we always answer false
We are false – anded with anything, we always answer false
Answer whether the receiver and aBoolean represent the same boolean value
We are false – evaluate the falseBlock
We are false – evaluate the falseBlock
We are false – answer nil
We are false – evaluate the falseBlock
We are false – answer true
We are false – ored with anything, we always answer the other operand, so evaluate aBlock
Answer whether the receiver and aBoolean represent different boolean values
We are false – ored with anything, we always answer the other operand
Next: False-printing, Previous: False-basic, Up: False [Index]
Answer ‘0’.
Previous: False-C hacks, Up: False [Index]
Print a representation of the receiver on aStream
Next: FileDescriptor, Previous: False, Up: Base classes [Index]
I enable access to the properties of files that are on disk.
• File class-C functions: | (class) | |
• File class-file operations: | (class) | |
• File class-initialization: | (class) | |
• File class-instance creation: | (class) | |
• File class-reading system defaults: | (class) | |
• File class-testing: | (class) | |
• File-accessing: | (instance) | |
• File-basic: | (instance) | |
• File-directory operations: | (instance) | |
• File-file name management: | (instance) | |
• File-file operations: | (instance) | |
• File-still unclassified: | (instance) | |
• File-testing: | (instance) |
Next: File class-file operations, Up: File [Index]
Answer the current value of C errno.
Answer C strerror’s result for errno.
Next: File class-initialization, Previous: File class-C functions, Up: File [Index]
Return whether an error had been reported or not. If there had been one, raise an exception too
The error with the C code ‘errno’ has been reported. If errno >= 1, raise an exception
Remove the file with the given path name
Rename the file with the given path name oldFileName to newFileName
Create a symlink for the srcName file with the given path name
Create a symlink named destName file from the given path (relative to destName)
Update the timestamp of the file with the given path name.
Next: File class-instance creation, Previous: File class-file operations, Up: File [Index]
Initialize the receiver’s class variables
Next: File class-reading system defaults, Previous: File class-initialization, Up: File [Index]
Answer a new file with the given path. The path is turned into an absolute path.
Answer a new file with the given path. The path is not validated until some of the fields of the newly created objects are accessed
Next: File class-testing, Previous: File class-instance creation, Up: File [Index]
Answer the full path to the executable being run.
Answer the full path to the image being used.
Next: File-accessing, Previous: File class-reading system defaults, Up: File [Index]
Answer whether a file with the given name exists
Answer whether a directory with the given name exists and can be accessed
Answer whether a file with the given name exists and can be executed
Answer whether a file with the given name exists and is readable
Answer whether a file with the given name exists and is writeable
Next: File-basic, Previous: File class-testing, Up: File [Index]
Answer the name of the file identified by the receiver
Answer a File or Directory object as appropriate for a file named ’aName’ in the directory represented by the receiver.
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 the like).
Answer whether the file is a directory.
Answer whether the file is an AF_UNIX socket.
Answer whether the file is a symbolic link.
Answer the last access time of the file identified by the receiver
Answer the last change time of the file identified by the receiver (the ‘last change time’ has to do with permissions, ownership and the like). On some operating systems, this could actually be the file creation time.
Answer the last modify time of the file identified by the receiver (the ‘last modify time’ has to do with the actual file contents).
Answer the permission bits for the file identified by the receiver
Set the permission bits for the file identified by the receiver to be anInteger.
Answer the name of the file identified by the receiver
Compute the relative path from the receiver to destName.
Refresh the statistics for the receiver
Answer the size of the file identified by the receiver
Next: File-directory operations, Previous: File-accessing, Up: File [Index]
Answer whether the receiver represents the same file as the receiver.
Answer a hash value for the receiver.
Next: File-file name management, Previous: File-basic, Up: File [Index]
Create the receiver as a directory.
Evaluate aBlock once for each file in the directory represented by the receiver, passing its name. aBlock should not return.
Next: File-file operations, Previous: File-directory operations, Up: File [Index]
Answer the full name of the receiver, resolving the ‘.’ and ‘..’ directory entries, and answer the result. Answer nil if the name is invalid (such as ’/usr/../../badname’)
Next: File-still unclassified, Previous: File-file name management, Up: File [Index]
Set the receiver’s timestamps to be accessDateTime and modifyDateTime.
Open the receiver in the given mode (as answered by FileStream’s class constant methods)
Set the receiver’s owner and group to be ownerString and groupString.
Compute the relative path from the directory dirName to the receiver
Remove the file with the given path name
Rename the file with the given path name to newFileName
Create destName as a symbolic link of the receiver. The appropriate relative path is computed automatically.
Create the receiver as a symlink from path destName
Next: File-testing, Previous: File-file operations, Up: File [Index]
Answer an object of the same kind as the receiver, whose name is suffixed with aName.
Previous: File-still unclassified, Up: File [Index]
Answer whether a file with the name contained in the receiver does exist.
Answer whether the receiver identifies an absolute path.
Answer whether a directory with the name contained in the receiver does exist and is accessible
Answer whether a file with the name contained in the receiver does exist and is executable
Answer whether the receiver corresponds to a real filesystem path.
Answer whether a file with the name contained in the receiver does exist and is readable
Answer whether a file with the name contained in the receiver does exist and is writeable
Next: FilePath, Previous: File, Up: Base classes [Index]
My instances are what conventional programmers think of as files. My instance creation methods accept the name of a disk file (or any named file object, such as /dev/rmt0 on UNIX or MTA0: on VMS). In addition, they accept a virtual filesystem path like ‘configure.gz#ugz’ which can be used to transparently extract or decompress files from archives, or do arbitrary processing on the files.
• FileDescriptor class-initialization: | (class) | |
• FileDescriptor class-instance creation: | (class) | |
• FileDescriptor class-still unclassified: | (class) | |
• FileDescriptor-accessing: | (instance) | |
• FileDescriptor-basic: | (instance) | |
• FileDescriptor-binary I/O: | (instance) | |
• FileDescriptor-built ins: | (instance) | |
• FileDescriptor-class type methods: | (instance) | |
• FileDescriptor-initialize-release: | (instance) | |
• FileDescriptor-low-level access: | (instance) | |
• FileDescriptor-overriding inherited methods: | (instance) | |
• FileDescriptor-polymorphism: | (instance) | |
• FileDescriptor-positioning: | (instance) | |
• FileDescriptor-printing: | (instance) | |
• FileDescriptor-testing: | (instance) |
Next: FileDescriptor class-instance creation, Up: FileDescriptor [Index]
Initialize the receiver’s class variables
Close open files before quitting
Next: FileDescriptor class-still unclassified, Previous: FileDescriptor class-initialization, Up: FileDescriptor [Index]
Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file.
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 of the file.
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 any standard C non-binary fopen mode. The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open fileName in the required mode - answered by #append, #create, #readWrite, #read or #write - and evaluate aBlock if the file cannot be opened. Else answer a new FileStream. For mode anyway you can use any The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open a FileDescriptor on the given file descriptor. Read-write access is assumed.
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 not referenced anymore, but you should close it with #close anyway. To keep a file open, send it #removeToBeFinalized
Open fileName in the required mode - answered by #append, #create, #readWrite, #read or #write - and evaluate aBlock if the file cannot be opened. Else answer a new instance of the receiver. For mode anyway you can use any standard C non-binary fopen mode. fileName can be a ‘virtual filesystem’ path, including URLs and ’#’ suffixes that are inspected by the virtual filesystem layers and replaced with tasks such as un-gzipping a file or extracting a file from an archive.
The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open for writing a file whose name starts with baseName, followed by six random alphanumeric characters. The file is created with mode read/write and permissions 0666 or 0600 on most recent operating systems (beware, the former behavior might constitute a security problem). The file is opened with the O_EXCL flag, guaranteeing that when the method returns successfully we are the only user.
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 object is not referenced anymore, because when you close a pipe you have to wait for the associated process to terminate. direction is returned by #read or #write (’r’ or ’w’) and is interpreted from the point of view of Smalltalk: reading means Smalltalk reads the standard 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, unless commandName alters it.
Open a pipe on the given command and evaluate aBlock file cannot be opened. Else answer a new FileStream. The pipe will not be automatically closed upon GC, even if the object is not referenced anymore, because when you close a pipe you have to wait for the associated process to terminate. direction is interpreted from the point of view of Smalltalk: reading means that Smalltalk reads the standard output of the command, writing means that Smalltalk writes the standard input of the command
Open text file for reading. The stream is positioned at the beginning of the file.
Open for reading and writing. The stream is positioned at the beginning of the file.
Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.
Next: FileDescriptor-accessing, Previous: FileDescriptor class-instance creation, Up: FileDescriptor [Index]
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 any standard C non-binary fopen mode. fileName can be a ‘virtual filesystem’ path, including URLs and ’#’ suffixes that are inspected by the virtual filesystem layers and replaced with tasks such as un-gzipping a file or extracting a file from an archive.
The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Next: FileDescriptor-basic, Previous: FileDescriptor class-still unclassified, Up: FileDescriptor [Index]
Answer whether the file is open and we can read from it
Answer whether the file is open and we can write from it
If the file is open, wait until data can be read from it. The wait allows other Processes to run.
If the file is open, wait until we can write to it. The wait allows other Processes to run.
Answer whether the file is open and an exceptional condition (such as presence of out of band data) has occurred on it
Return the OS file descriptor of the file
Return the name of the file
Answer whether the file is still open
Present for compatibility with sockets. For files, it answers whether the file is still open
Answer whether the file is a pipe or an actual disk file
Return the name of the file
If the file is open, wait until an exceptional condition (such as presence of out of band data) has occurred on it. The wait allows other Processes to run.
Next: FileDescriptor-binary I/O, Previous: FileDescriptor-accessing, Up: FileDescriptor [Index]
Perform error checking. By default, we call File class>>#checkError.
Close the file
Answer the whole contents of the file
Answer the contents of the file between the two given positions
Close the file if it is still open by the time the object becomes garbage.
Invalidate a file descriptor
Return the next character in the file, or nil at eof
Return the next byte in the file, or nil at eof
Store aCharacter on the file
Store the byte, anInteger, on the file
Store aByteArray on the file
Returns the next element of the stream without moving the pointer. Returns nil when at end of stream.
Returns whether the next element of the stream is equal to anObject, without moving the pointer if it is not.
Answer the zero-based position from the start of the file
Set the file pointer to the zero-based position n
Reset the stream to its beginning
Close the transmission side of a full-duplex connection. This is useful on read-write pipes.
Return the current size of the file, in bytes
Truncate the file at the current position
Next: FileDescriptor-built ins, Previous: FileDescriptor-basic, Up: FileDescriptor [Index]
Return the next numBytes bytes in the byte array
Return the next 64-bit float in the byte array
Return the next 32-bit float in the byte array
Return the next 4 bytes in the byte array, interpreted as a 32 bit signed int
Return the next 8 bytes in the byte array, interpreted as a 64 bit signed int
Store aDouble as a 64-bit float in the byte array
Return the next 32-bit float in the byte array
Store anInteger (range: -2^63..2^64-1) on the byte array as 8 bytes
Store anInteger (range: -2^31..2^32-1) on the byte array as 4 bytes
Store anInteger (range: -32768..65535) on the byte array as 2 bytes
Return the next 2 bytes in the byte array, interpreted as a 16 bit signed int
Return the next byte in the byte array, interpreted as a 8 bit signed number
Return the next 8 bytes in the byte array, interpreted as a 64 bit unsigned int
Return the next 4 bytes in the byte array, interpreted as a 32 bit unsigned int
Return the next 2 bytes in the byte array, interpreted as a 16 bit unsigned int
Next: FileDescriptor-class type methods, Previous: FileDescriptor-binary I/O, Up: FileDescriptor [Index]
File in the contents of the receiver. During a file in operation, global variables (starting with an uppercase letter) that are not declared don’t yield an ‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As soon as you add the variable to a namespace (for example by creating a class) the Association will be removed from Undeclared and reused in the namespace, so that the old references will automagically point to the new value.
Private - Used to limit the number of primitives used by FileStreams
Private - Used to limit the number of primitives used by FileStreams.
Private - Used to limit the number of primitives used by FileStreams
Private - Used to limit the number of primitives used by FileStreams.
Private - Used to limit the number of primitives used by FileStreams
Private - Used to limit the number of primitives used by FileStreams.
Private - Used to limit the number of primitives used by FileStreams
Private - Used to limit the number of primitives used by FileStreams.
Private - Used to limit the number of primitives used by FileStreams
Private - Used to limit the number of primitives used by FileStreams.
Next: FileDescriptor-initialize-release, Previous: FileDescriptor-built ins, Up: FileDescriptor [Index]
We answer characters, so answer false
We stream on an external entity (a file), so answer true
We answer characters, so answer true
Next: FileDescriptor-low-level access, Previous: FileDescriptor-class type methods, Up: FileDescriptor [Index]
Add me to the list of open files.
Initialize the receiver’s instance variables
Answer myself, or an alternate stream coerced for reading.
Remove me from the list of open files.
Next: FileDescriptor-overriding inherited methods, Previous: FileDescriptor-initialize-release, Up: FileDescriptor [Index]
Put the characters in the supplied range of aCollection in the file
Ignoring any buffering, try to fill the given range of aCollection with the contents of the file
Next: FileDescriptor-polymorphism, Previous: FileDescriptor-low-level access, Up: FileDescriptor [Index]
Answer whether the receiver is empty
Put all the characters of the receiver in aStream.
Return the contents of the file from the last byte to the first
Reset the file pointer to the end of the file
Skip anInteger bytes in the file
Next: FileDescriptor-positioning, Previous: FileDescriptor-overriding inherited methods, Up: FileDescriptor [Index]
The end of the stream has been reached. Signal a Notification.
Next: FileDescriptor-printing, Previous: FileDescriptor-polymorphism, Up: FileDescriptor [Index]
Answer true if the stream supports moving backwards with #skip:.
Next: FileDescriptor-testing, Previous: FileDescriptor-positioning, Up: FileDescriptor [Index]
Print a representation of the receiver on aStream
Previous: FileDescriptor-printing, Up: FileDescriptor [Index]
Answer whether data has come to an end
Next: FileSegment, Previous: FileDescriptor, Up: Base classes [Index]
I expose the syntax of file names, including paths. I know how to manipulate such a path by splitting it into its components. In addition, I expose information about files (both real and virtual) such as their size and timestamps.
• FilePath class-file name management: | (class) | |
• FilePath class-still unclassified: | (class) | |
• FilePath-accessing: | (instance) | |
• FilePath-converting: | (instance) | |
• FilePath-decoration: | (instance) | |
• FilePath-directory operations: | (instance) | |
• FilePath-enumerating: | (instance) | |
• FilePath-file name management: | (instance) | |
• FilePath-file operations: | (instance) | |
• FilePath-printing: | (instance) | |
• FilePath-still unclassified: | (instance) | |
• FilePath-testing: | (instance) | |
• FilePath-virtual filesystems: | (instance) |
Next: FilePath class-still unclassified, Up: FilePath [Index]
Answer the name of a file named ‘fileName’ which resides in a directory named ‘directory’.
Answer the extension of a file named ‘aString’. Note: the extension includes an initial dot.
Answer the full path to a file called ‘aString’, resolving the ‘.’ and ‘..’ directory entries, and answer the result. ‘/..’ is the same as ’/’.
Determine the path of the name of a file called ‘aString’, and answer the result. With the exception of the root directory, the final slash is stripped.
Determine the path of the name of a file called ‘aString’, and answer the result. With the exception of the root directory, the final slash is stripped. If there is no path, evaluate aBlock and return the result.
Answer the relative path to destName when the current directory is srcName’s directory.
Remove the extension from the name of a file called ‘aString’, and answer the result.
Determine the path of the name of a file called ‘aString’, and answer the result as a directory name including the final slash.
Remove the path from the name of a file called ‘aString’, and answer the file name plus extension.
Next: FilePath-accessing, Previous: FilePath class-file name management, Up: FilePath [Index]
Answer whether aString is an absolute ptah.
Next: FilePath-converting, Previous: FilePath class-still unclassified, Up: FilePath [Index]
Answer a File or Directory object as appropriate for a file named ’aName’ in the directory represented by the receiver.
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 the like).
Set the group of the file identified by the receiver to be aString.
Answer whether a file named ‘aName’ exists in the directory represented by the receiver.
Answer the last access time of the file identified by the receiver
Update the last access time of the file corresponding to the receiver, to be aDateTime.
Update the timestamps of the file corresponding to the receiver, to be accessDateTime and modifyDateTime.
Answer the last change time of the file identified by the receiver (the ‘last change time’ has to do with permissions, ownership and the like). On some operating systems, this could actually be the file creation time.
Answer the last modify time of the file identified by the receiver (the ‘last modify time’ has to do with the actual file contents).
Update the last modification timestamp of the file corresponding to the receiver, to be aDateTime.
Answer the permission bits for the file identified by the receiver
Set the permission bits for the file identified by the receiver to be anInteger.
Set the owner of the file identified by the receiver to be aString.
Set the owner and group of the file identified by the receiver to be aString.
Compute the relative path from the receiver to destName.
Refresh the statistics for the receiver
Answer the size of the file identified by the receiver
Next: FilePath-decoration, Previous: FilePath-accessing, Up: FilePath [Index]
Answer the receiver.
Next: FilePath-directory operations, Previous: FilePath-converting, Up: FilePath [Index]
Return a decorator of the receiver that will provide recursive descent into directories for iteration methods. Furthermore, iteration on the returned wrapper will not include ’.’ or ’..’ directory entries, and will include the receiver (directly, not via ’.’).
Next: FilePath-enumerating, Previous: FilePath-decoration, Up: FilePath [Index]
Create the receiver as a directory, together with all its parents.
Create the receiver as a directory, together with all its parents.
Answer a FilePath for a file named ‘aName’ residing in the directory represented by the receiver.
Next: FilePath-file name management, Previous: FilePath-directory operations, Up: FilePath [Index]
Evaluate aBlock on the File objects that match aPattern (according to String>>#match:) in the directory named by the receiver. Recursively descend into directories.
Answer an Array with Directory objects for the subdirectories of the directory represented by the receiver.
Evaluate aBlock once for each file in the directory represented by the receiver, passing a FilePath object (or a subclass) to it. It depends on the subclass whether iteration will include the ’.’ and ’..’ directory entries.
Answer an Array with File or Directory objects for the contents of the directory represented by the receiver.
Answer an Array with the names of the files in the directory represented by the receiver.
Answer an Array with File objects for the contents of the directory represented by the receiver.
Evaluate aBlock once for each file in the directory represented by the receiver, passing a File or Directory object to aBlock. Returns the *names* of the files for which aBlock returns true.
Evaluate block on the File objects that match aPattern (according to String>>#match:) in the directory named by the receiver.
Evaluate aBlock once for each file in the directory represented by the receiver, passing its name. It depends on the subclass whether iteration will include the ’.’ and ’..’ directory entries.
Evaluate block on the file names that match aPattern (according to String>>#match:) in the directory named by the receiver.
Evaluate aBlock once for each file in the directory represented by the receiver, passing a File or Directory object to aBlock. Returns the *names* of the files for which aBlock returns true.
Evaluate aBlock once for each file in the directory represented by the receiver, passing a File or Directory object to aBlock. Returns the *names* of the files for which aBlock returns true.
Next: FilePath-file operations, Previous: FilePath-enumerating, Up: FilePath [Index]
Answer the Directory object for the receiver’s path
Answer the extension of the receiver
Answer the full name of the receiver, resolving the ‘.’ and ‘..’ directory entries, and answer the result. Answer nil if the name is invalid (such as ’/usr/../../badname’)
Answer a String with the full path to the receiver (same as #name; it is useless to override this method).
Answer String with the full path to the receiver (same as #fullName).
Answer the Directory object for the receiver’s path
Answer the path (if any) of the receiver
Answer the path (if any) and file name of the receiver
Answer the path of the receiver, always including a directory name (possibly ‘.’) and the final directory separator
Answer the file name and extension (if any) of the receiver
Next: FilePath-printing, Previous: FilePath-file name management, Up: FilePath [Index]
Open a read-only FileStream on the receiver, read its contents, close the stream and answer the contents
File in the receiver
Open the receiver in the given mode (as answered by FileStream’s class constant methods)
Open the receiver in the given mode (as answered by FileStream’s class constant methods). Upon failure, evaluate aBlock.
Open the receiver in the given mode (as answered by FileStream’s class constant methods)
Open the receiver in the given mode (as answered by FileStream’s class constant methods)
Open the receiver in the given mode (as answered by FileStream’s class constant methods). Upon failure, evaluate aBlock.
Compute the relative path from the directory dirName to the receiver
Open a read-only FileStream on the receiver
Remove the file identified by the receiver
Rename the file identified by the receiver to newName
Create destName as a symbolic link of the receiver. The appropriate relative path is computed automatically.
Create the receiver as a symbolic link from srcName (relative to the path of the receiver).
Update the timestamp of the file corresponding to the receiver.
Answer the result of invoking aBlock with a reading stream open on me, closing it when the dynamic extent of aBlock ends.
Answer the result of invoking aBlock with a writing stream open on me, closing it when the dynamic extent of aBlock ends.
Open a write-only FileStream on the receiver
Next: FilePath-still unclassified, Previous: FilePath-file operations, Up: FilePath [Index]
Print a representation of the receiver on aStream.
Print a representation of the receiver on aStream.
Print a representation of the receiver on aStream.
Return the representation of the receiver with shell characters escaped.
Next: FilePath-testing, Previous: FilePath-printing, Up: FilePath [Index]
Answer a File or Directory object as appropriate for a file named ’aName’ in the directory represented by the receiver.
Next: FilePath-virtual filesystems, Previous: FilePath-still unclassified, Up: FilePath [Index]
Answer whether a file with the name contained in the receiver does exist.
Answer whether the receiver identifies an absolute path.
Answer whether a directory with the name contained in the receiver does exist and can be accessed
Answer whether a file with the name contained in the receiver does exist and identifies a directory.
Answer whether a file with the name contained in the receiver does exist and is executable
Answer whether a file with the name contained in the receiver does exist and does not identify a directory.
Answer whether the receiver corresponds to a real filesystem path.
Answer whether a file with the name contained in the receiver does exist and is readable
Answer whether the receiver identifies a relative path.
Answer whether a file with the name contained in the receiver does exist and identifies a symbolic link.
Answer whether a file with the name contained in the receiver does exist and is writeable
Previous: FilePath-testing, Up: FilePath [Index]
Not commented.
Next: FileStream, Previous: FilePath, Up: Base classes [Index]
My instances represent sections of files. I am primarily used by the compiler to record source code locations. I am not a part of the normal Smalltalk-80 kernel; I am specific to the GNU Smalltalk implementation.
• FileSegment class-basic: | (class) | |
• FileSegment class-installing: | (class) | |
• FileSegment-basic: | (instance) | |
• FileSegment-equality: | (instance) | |
• FileSegment-printing: | (instance) |
Next: FileSegment class-installing, Up: FileSegment [Index]
Create a new FileSegment referring to the contents of the given file, from the startPos-th byte and for sizeInteger bytes. Note that FileSegments should always be created with full paths because relative paths are interpreted to be relative to the kernel directory.
Next: FileSegment-basic, Previous: FileSegment class-basic, Up: FileSegment [Index]
Remove the kernel path from all paths that start with it. Needed to support $(DESTDIR) and relocatable installation.
Next: FileSegment-equality, Previous: FileSegment class-installing, Up: FileSegment [Index]
Answer a String containing the required segment of the file
Answer a String containing the given subsegment of the file. As for streams, from and to are 0-based.
Answer the File object for the file containing the segment
Answer the name of the file containing the segment
Answer the position in the file where the segment starts
If the path starts with startPath, remove that part of the path. map is a Dictionary that is used so that equal filenames stay equal, without increasing the amount of memory that the image uses.
Answer the length of the segment
Evaluate aBlock passing it the FileStream in which the segment identified by the receiver is stored
Next: FileSegment-printing, Previous: FileSegment-basic, Up: FileSegment [Index]
Answer whether the receiver and aFileSegment are equal.
Answer an hash value for the receiver.
Previous: FileSegment-equality, Up: FileSegment [Index]
Answer a printed representation of the file containing the segment. While introducing some ambiguity, this representation is compact eliminates the path for kernel files, and produces a relative path from the current working directory for other files.
Next: Float, Previous: FileSegment, Up: Base classes [Index]
My instances are what conventional programmers think of as files. My instance creation methods accept the name of a disk file (or any named file object, such as /dev/rmt0 on UNIX or MTA0: on VMS).
• FileStream class-file-in: | (class) | |
• FileStream class-standard streams: | (class) | |
• FileStream-basic: | (instance) | |
• FileStream-buffering: | (instance) | |
• FileStream-compiling: | (instance) | |
• FileStream-initialize-release: | (instance) | |
• FileStream-overriding inherited methods: | (instance) | |
• FileStream-testing: | (instance) |
Next: FileStream class-standard streams, Up: FileStream [Index]
File in the aFileName file. During a file in operation, global variables (starting with an uppercase letter) that are not declared yet don’t yield an ‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As soon as you add the variable to a namespace (for example by creating a class) the Association will be removed from Undeclared and reused in the namespace, so that the old references will automagically point to the new value.
Conditionally do a file in, only if the key (often a class) specified by ’aSymbol’ is not present in the Smalltalk system dictionary already. During a file in operation, global variables (starting with an uppercase letter) that are not declared don’t yield an ‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As soon as you add the variable to a namespace (for example by creating a class) the Association will be removed from Undeclared and reused in the namespace, so that the old references will automagically point to the new value.
Conditionally do a file in, only if the supplied boolean is true. During a file in operation, global variables (starting with an uppercase letter) that are not declared don’t yield an ‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As soon as you add the variable to a namespace (for example by creating a class) the Association will be removed from Undeclared and reused in the namespace, so that the old references will automagically point to the new value.
File in the aFileName file giving errors such as if it was loaded from the given line, file name and starting position (instead of 1).
Generate a make file for the file-ins since record was last set to true. Store it on aStream
Private - Initialize the receiver’s class variables
Set whether Smalltalk should record information about nested file-ins. When recording is enabled, use #generateMakefileOnto: to automatically generate a valid makefile for the intervening file-ins.
Conditionally do a file in from the value of assoc, only if the key of assoc is not present in the Smalltalk system dictionary already. During a file in operation, global variables (starting with an uppercase letter) that are not declared don’t yield an ‘unknown variable’ error. Instead, they are defined as nil in the ‘Undeclared’ dictionary (a global variable residing in Smalltalk). As soon as you add the variable to a namespace (for example by creating a class) the Association will be removed from Undeclared and reused in the namespace, so that the old references will automagically point to the new value.
Set whether Smalltalk should output debugging messages when filing in
Next: FileStream-basic, Previous: FileStream class-file-in, Up: FileStream [Index]
Answer a FileStream that is attached the Smalltalk program’s standard error file handle, which can be used for error messages and diagnostics issued by the program.
Answer a FileStream that is attached the Smalltalk program’s standard input file handle, which is the normal source of input for the program.
Answer a FileStream that is attached the Smalltalk program’s standard output file handle; this is used for normal output from the program.
Next: FileStream-buffering, Previous: FileStream class-standard streams, Up: FileStream [Index]
Private - Answer the offset from the start of the file corresponding to the beginning of the read buffer.
Answer the contents of the file between the two given positions
Return the next character in the file, or nil at eof
Store aCharacter on the file
Return the next character in the file, or nil at eof. Don’t advance the file pointer.
Answer the zero-based position from the start of the file
Set the file pointer to the zero-based position n
Return the current size of the file, in bytes
Truncate the file at the current position
Next: FileStream-compiling, Previous: FileStream-basic, Up: FileStream [Index]
Answer the file’s current buffer
Flush the file and set the buffer’s size to bufSize
Synchronize the file descriptor’s state with the object’s state.
Private - Fill the input buffer
Flush the output buffer.
Private - Answer a String to be used as the receiver’s buffer
Private - Assuming that the buffer has space for n characters, store n characters of aCollection in the buffer, starting from the pos-th.
Read up to anInteger bytes from the stream and store them into aCollection. Return the number of bytes read.
Copy up to anInteger bytes from the stream into aStream. Return the number of bytes read.
Answer whether the output buffer is full.
Next: FileStream-initialize-release, Previous: FileStream-buffering, Up: FileStream [Index]
Answer an object that, when sent #asString, will yield the result of sending ‘copyFrom: startPos to: endPos’ to the receiver
Next: FileStream-overriding inherited methods, Previous: FileStream-compiling, Up: FileStream [Index]
Initialize the receiver’s instance variables
Next: FileStream-testing, Previous: FileStream-initialize-release, Up: FileStream [Index]
Write n values from aCollection, the first being at pos.
Returns a collection of the same type that the stream accesses, containing the next line up to the next new-line character. Returns the entire rest of the stream’s contents if no new-line character is found.
Put all the characters of the receiver in aStream.
Returns a collection of the same type that the stream accesses, containing data up to aCharacter. Returns the entire rest of the stream’s contents if no such character is found.
Previous: FileStream-overriding inherited methods, Up: FileStream [Index]
Answer whether data has come to an end
Next: FloatD, Previous: FileStream, Up: Base classes [Index]
My instances represent floating point numbers that have arbitrary precision. Besides the standard numerical operations, they provide transcendental operations too. They implement IEEE-754 correctly if the hardware supports it.
• Float class-byte-order dependancies: | (class) | |
• Float class-characterization: | (class) | |
• Float-arithmetic: | (instance) | |
• Float-basic: | (instance) | |
• Float-built ins: | (instance) | |
• Float-coercing: | (instance) | |
• Float-coercion: | (instance) | |
• Float-comparing: | (instance) | |
• Float-compiler: | (instance) | |
• Float-converting: | (instance) | |
• Float-floating point: | (instance) | |
• Float-misc math: | (instance) | |
• Float-printing: | (instance) | |
• Float-storing: | (instance) | |
• Float-testing: | (instance) | |
• Float-testing functionality: | (instance) | |
• Float-transcendental operations: | (instance) | |
• Float-truncation and round off: | (instance) |
Next: Float class-characterization, Up: Float [Index]
Answer the byte of the receiver that contains the sign bit
Next: Float-arithmetic, Previous: Float class-byte-order dependancies, Up: Float [Index]
Answer whether instances of the receiver can be in denormalized form.
Returns the value of e. Hope is that it is precise enough
Return the smallest Float x for which is 1 + x ~= 1
Return the smallest Float that is > 0.
Return the smallest Float that is > 0 if denormalized values are supported, else return 0.
Returns the value of ln 10. Hope is that it is precise enough
Returns the value of log2 10. Hope is that it is precise enough
Returns the value of pi. Hope is that it is precise enough
Answer the base in which computations between instances of the receiver are made. This should be 2 on about every known computer, so GNU Smalltalk always answers 2.
Next: Float-basic, Previous: Float class-characterization, Up: Float [Index]
Return the receiver’s integer part
Return the negation of the receiver. Unlike 0-self, this converts correctly signed zeros.
Return self raised to the anInteger-th power
Next: Float-built ins, Previous: Float-arithmetic, Up: Float [Index]
Answer an hash value for the receiver. Not-a-number values do not have a hash code and cannot be put in a hashed collection.
Next: Float-coercing, Previous: Float-basic, Up: Float [Index]
Answer the arc-cosine of the receiver
Answer the arc-sine of the receiver
Answer the arc-tangent of the receiver
Answer the integer part of the receiver, truncated towards +infinity
Answer the cosine of the receiver
Answer ’e’ (2.718281828459...) raised to the receiver
Answer the integer part of the receiver, truncated towards -infinity
Answer the logarithm of the receiver in base ’e’ (2.718281828459...)
Private - Answer an hash value for the receiver
Answer the receiver raised to its aNumber power
Answer the sine of the receiver
Answer the square root of the receiver
Answer the tangent of the receiver
Next: Float-coercion, Previous: Float-built ins, Up: Float [Index]
Convert the receiver into a fraction with optimal approximation, but with usually huge terms.
Convert the receiver into a fraction with a good (but undefined) approximation
Convert the receiver to an Integer. Only used for LargeIntegers, there are primitives for the other cases.
Next: Float-comparing, Previous: Float-coercing, Up: Float [Index]
Convert the receiver to a kind of number that is understood by the C call-out mechanism.
Next: Float-compiler, Previous: Float-coercion, Up: Float [Index]
Answer the maximum between the receiver and aNumber. Redefine in subclasses if necessary to ensure that if either self or aNumber is a NaN, it is always answered.
Answer the minimum between the receiver and aNumber. Redefine in subclasses if necessary to ensure that if either self or aNumber is a NaN, it is always answered.
Answer the receiver, with its sign possibly changed to match that of aNumber.
Next: Float-converting, Previous: Float-comparing, Up: Float [Index]
Not commented.
Not commented.
Next: Float-floating point, Previous: Float-compiler, Up: Float [Index]
Answer 0.5 in the representation of the receiver
Next: Float-misc math, Previous: Float-converting, Up: Float [Index]
Not commented.
Not commented.
Next: Float-printing, Previous: Float-floating point, Up: Float [Index]
Answer log base aNumber of the receiver
Next: Float-storing, Previous: Float-misc math, Up: Float [Index]
Print a representation of the receiver on aStream
Next: Float-testing, Previous: Float-printing, Up: Float [Index]
Answer whether the receiver is expressible as a Smalltalk literal.
Store on aStream some Smalltalk code which compiles to the receiver
Print a representation of the receiver on aStream
Next: Float-testing functionality, Previous: Float-storing, Up: Float [Index]
Answer whether the receiver performs exact arithmetic. Floats do not.
Answer whether the receiver does not represent infinity, nor a NaN
Answer whether the receiver represents positive or negative infinity
Answer whether the receiver represents a NaN
Answer whether the receiver is negative
Answer whether the receiver is positive. Negative zero is not positive, so the definition is not simply >= 0.
Answer 1 if the receiver is greater than 0, -1 if less than 0, else 0. Negative zero is the same as positive zero.
Answer whether the receiver is > 0
Next: Float-transcendental operations, Previous: Float-testing, Up: Float [Index]
Answer ‘true’.
Next: Float-truncation and round off, Previous: Float-testing functionality, Up: Float [Index]
Just defined for completeness. Return the receiver.
Answer (self log: radix) ceiling. Use exact arithmetic if radix is not a floating point value.
Answer an estimate of (self abs floorLog: 10)
Answer (self log: radix) floor. Use exact arithmetic if radix is not a floating point value.
Answer log base 10 of the receiver.
Previous: Float-transcendental operations, Up: Float [Index]
Answer the receiver, rounded to the nearest integer
Next: FloatE, Previous: Float, Up: Base classes [Index]
My instances represent floating point numbers that have the same accuracy as C’s "double" numbers.
• FloatD class-byte-order dependencies: | (class) | |
• FloatD class-characterization: | (class) | |
• FloatD class-converting: | (class) | |
• FloatD-built ins: | (instance) | |
• FloatD-coercing: | (instance) | |
• FloatD-converting: | (instance) |
Next: FloatD class-characterization, Up: FloatD [Index]
Answer a float with the bytes in aByteArray, which are in big-endian format.
Answer the byte of the receiver that contains the sign bit
Next: FloatD class-converting, Previous: FloatD class-byte-order dependencies, Up: FloatD [Index]
Return the number of decimal digits of precision for a FloatD. Technically, if P is the precision for the representation, then the decimal precision Q is the maximum number of decimal digits such that any floating point number with Q base 10 digits can be rounded to a floating point number with P base 2 digits and back again, without change to the Q decimal digits.
Return the maximum allowable exponent for a FloatD that is finite.
Return the maximum allowable exponent for a FloatD that is finite.
Return the largest normalized FloatD that is not infinite.
Return the smallest normalized FloatD that is > 0
Return a FloatD that represents positive infinity.
Return a FloatD that represents a mathematically indeterminate value (e.g. Inf - Inf, Inf / Inf).
Return a FloatD that represents negative infinity.
Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
Next: FloatD-built ins, Previous: FloatD class-characterization, Up: FloatD [Index]
Answer aNumber converted to a FloatD
Next: FloatD-coercing, Previous: FloatD class-converting, Up: FloatD [Index]
Multiply the receiver and arg and answer another Number
Sum the receiver and arg and answer another Number
Subtract arg from the receiver and answer another Number
Divide the receiver by arg and answer another FloatD
Answer whether the receiver is less than arg
Answer whether the receiver is less than or equal to arg
Answer whether the receiver is equal to arg
Answer whether the receiver is greater than arg
Answer whether the receiver is greater than or equal to arg
Answer the receiver converted to a FloatE
Answer the receiver converted to a FloatQ
Answer the exponent of the receiver in mantissa*2^exponent representation ( |mantissa|<=1 )
Answer the fractional part of the receiver
Answer the receiver multiplied by 2^arg
Truncate the receiver towards zero and answer the result
Answer whether the receiver is not equal to arg
Next: FloatD-converting, Previous: FloatD-built ins, Up: FloatD [Index]
Just defined for completeness. Return the receiver.
Coerce aNumber to the receiver’s class
Answer the receiver’s generality
Coerce 1 to the receiver’s class
Coerce 0 to the receiver’s class
Previous: FloatD-coercing, Up: FloatD [Index]
Coerce 0.5 to the receiver’s class
Next: FloatQ, Previous: FloatD, Up: Base classes [Index]
My instances represent floating point numbers that have the same accuracy as C’s "float" numbers.
• FloatE class-byte-order dependancies: | (class) | |
• FloatE class-byte-order dependencies: | (class) | |
• FloatE class-characterization: | (class) | |
• FloatE class-converting: | (class) | |
• FloatE-built ins: | (instance) | |
• FloatE-coercing: | (instance) | |
• FloatE-converting: | (instance) |
Next: FloatE class-byte-order dependencies, Up: FloatE [Index]
Answer the byte of the receiver that contains the sign bit
Next: FloatE class-characterization, Previous: FloatE class-byte-order dependancies, Up: FloatE [Index]
Answer a float with the bytes in aByteArray, which are in big-endian format.
Next: FloatE class-converting, Previous: FloatE class-byte-order dependencies, Up: FloatE [Index]
Return the number of decimal digits of precision for a FloatE. Technically, if P is the precision for the representation, then the decimal precision Q is the maximum number of decimal digits such that any floating point number with Q base 10 digits can be rounded to a floating point number with P base 2 digits and back again, without change to the Q decimal digits.
Returns the value of e. Hope is that it is precise enough
Return the maximum allowable exponent for a FloatE that is finite.
Return the maximum allowable exponent for a FloatE that is finite.
Return the largest normalized FloatE that is not infinite.
Return the smallest normalized FloatE that is > 0
Return a FloatE that represents positive infinity.
Returns the value of ln 10. Hope is that it is precise enough
Returns the value of log2 10. Hope is that it is precise enough
Return a FloatE that represents a mathematically indeterminate value (e.g. Inf - Inf, Inf / Inf).
Return a FloatE that represents negative infinity.
Returns the value of pi. Hope is that it is precise enough
Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
Next: FloatE-built ins, Previous: FloatE class-characterization, Up: FloatE [Index]
Answer aNumber converted to a FloatE
Next: FloatE-coercing, Previous: FloatE class-converting, Up: FloatE [Index]
Multiply the receiver and arg and answer another Number
Sum the receiver and arg and answer another Number
Subtract arg from the receiver and answer another Number
Divide the receiver by arg and answer another FloatE
Answer whether the receiver is less than arg
Answer whether the receiver is less than or equal to arg
Answer whether the receiver is equal to arg
Answer whether the receiver is greater than arg
Answer whether the receiver is greater than or equal to arg
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatQ
Answer the exponent of the receiver in mantissa*2^exponent representation ( |mantissa|<=1 )
Answer the fractional part of the receiver
Answer the receiver multiplied by 2^arg
Truncate the receiver towards zero and answer the result
Answer whether the receiver is not equal to arg
Next: FloatE-converting, Previous: FloatE-built ins, Up: FloatE [Index]
Just defined for completeness. Return the receiver.
Coerce aNumber to the receiver’s class
Answer the receiver’s generality
Coerce 1 to the receiver’s class
Coerce 0 to the receiver’s class
Previous: FloatE-coercing, Up: FloatE [Index]
Coerce 0.5 to the receiver’s class
Next: Fraction, Previous: FloatE, Up: Base classes [Index]
My instances represent floating point numbers that have the same accuracy as C’s "long double" numbers.
• FloatQ class-byte-order dependancies: | (class) | |
• FloatQ class-characterization: | (class) | |
• FloatQ class-converting: | (class) | |
• FloatQ-built ins: | (instance) | |
• FloatQ-coercing: | (instance) | |
• FloatQ-converting: | (instance) |
Next: FloatQ class-characterization, Up: FloatQ [Index]
Answer the byte of the receiver that contains the sign bit
Next: FloatQ class-converting, Previous: FloatQ class-byte-order dependancies, Up: FloatQ [Index]
Return the number of decimal digits of precision for a FloatQ. Technically, if P is the precision for the representation, then the decimal precision Q is the maximum number of decimal digits such that any floating point number with Q base 10 digits can be rounded to a floating point number with P base 2 digits and back again, without change to the Q decimal digits.
Returns the value of e. Hope is that it is precise enough
Return the maximum allowable exponent for a FloatQ that is finite.
Return the maximum allowable exponent for a FloatQ that is finite.
Return the largest normalized FloatQ that is not infinite.
Return the smallest normalized FloatQ that is > 0
Return a FloatQ that represents positive infinity.
Returns the value of ln 10. Hope is that it is precise enough
Returns the value of log2 10. Hope is that it is precise enough
Return a FloatQ that represents a mathematically indeterminate value (e.g. Inf - Inf, Inf / Inf).
Return a FloatQ that represents negative infinity.
Returns the value of pi. Hope is that it is precise enough
Answer the number of bits in the mantissa. 1 + (2^-precision) = 1
Next: FloatQ-built ins, Previous: FloatQ class-characterization, Up: FloatQ [Index]
Answer aNumber converted to a FloatQ
Next: FloatQ-coercing, Previous: FloatQ class-converting, Up: FloatQ [Index]
Multiply the receiver and arg and answer another Number
Sum the receiver and arg and answer another Number
Subtract arg from the receiver and answer another Number
Divide the receiver by arg and answer another FloatQ
Answer whether the receiver is less than arg
Answer whether the receiver is less than or equal to arg
Answer whether the receiver is equal to arg
Answer whether the receiver is greater than arg
Answer whether the receiver is greater than or equal to arg
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatE
Answer the exponent of the receiver in mantissa*2^exponent representation ( |mantissa|<=1 )
Answer the fractional part of the receiver
Answer the receiver multiplied by 2^arg
Truncate the receiver towards zero and answer the result
Answer whether the receiver is not equal to arg
Next: FloatQ-converting, Previous: FloatQ-built ins, Up: FloatQ [Index]
Just defined for completeness. Return the receiver.
Coerce aNumber to the receiver’s class
Answer the receiver’s generality
Coerce 1 to the receiver’s class
Coerce 0 to the receiver’s class
Previous: FloatQ-coercing, Up: FloatQ [Index]
Coerce 0.5 to the receiver’s class
Next: Generator, Previous: FloatQ, Up: Base classes [Index]
I represent rational numbers in the form (p/q) where p and q are integers. The arithmetic operations *, +, -, /, on fractions, all return a reduced fraction.
• Fraction class-converting: | (class) | |
• Fraction class-instance creation: | (class) | |
• Fraction-accessing: | (instance) | |
• Fraction-arithmetic: | (instance) | |
• Fraction-coercing: | (instance) | |
• Fraction-coercion: | (instance) | |
• Fraction-comparing: | (instance) | |
• Fraction-converting: | (instance) | |
• Fraction-optimized cases: | (instance) | |
• Fraction-printing: | (instance) | |
• Fraction-testing: | (instance) |
Next: Fraction class-instance creation, Up: Fraction [Index]
Answer aNumber converted to a Fraction
Next: Fraction-accessing, Previous: Fraction class-converting, Up: Fraction [Index]
Initialize the receiver’s class variables
Answer a new instance of fraction (nInteger/dInteger)
Next: Fraction-arithmetic, Previous: Fraction class-instance creation, Up: Fraction [Index]
Answer the receiver’s denominator
Answer the receiver’s numerator
Next: Fraction-coercing, Previous: Fraction-accessing, Up: Fraction [Index]
Multiply two numbers and answer the result.
Sum two numbers and answer the result.
Subtract aNumber from the receiver and answer the result.
Divide the receiver by aNumber and answer the result.
Return the integer quotient of dividing the receiver by aNumber with truncation towards negative infinity.
Return the remainder from dividing the receiver by aNumber, (using //).
Answer an estimate of (self abs floorLog: 10)
Next: Fraction-coercion, Previous: Fraction-arithmetic, Up: Fraction [Index]
Truncate the receiver towards positive infinity and return the truncated result
Coerce aNumber to the receiver’s class
Truncate the receiver towards negative infinity and return the truncated result
Return the receiver’s generality
Truncate the receiver and return the truncated result
Coerce 1 to the receiver’s class
Coerce 0 to the receiver’s class
Next: Fraction-comparing, Previous: Fraction-coercing, Up: Fraction [Index]
Convert the receiver to a kind of number that is understood by the C call-out mechanism.
Next: Fraction-converting, Previous: Fraction-coercion, Up: Fraction [Index]
Test if the receiver is less than arg.
Test if the receiver is less than or equal to arg.
Test if the receiver equals arg.
Test if the receiver is more than arg.
Test if the receiver is greater than or equal to arg.
Answer an hash value for the receiver
Next: Fraction-optimized cases, Previous: Fraction-comparing, Up: Fraction [Index]
Answer the receiver, it is already a Fraction
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatD
Answer the receiver, it is already a Fraction
Answer the integer part of the receiver, expressed as a Fraction
Next: Fraction-printing, Previous: Fraction-converting, Up: Fraction [Index]
Return the receiver, with its sign changed.
Return self raised to the anInteger-th power.
Return the reciprocal of the receiver
Return the square root of the receiver.
Return the square of the receiver.
Next: Fraction-testing, Previous: Fraction-optimized cases, Up: Fraction [Index]
Print a representation of the receiver on aStream
Store Smalltalk code compiling to the receiver on aStream
Previous: Fraction-printing, Up: Fraction [Index]
Answer whether the receiver is rational - true
Next: Getopt, Previous: Fraction, Up: Base classes [Index]
A Generator object provides a way to use blocks to define a Stream of many return values. The return values are computed one at a time, as needed, and hence need not even be finite.
A generator block is converted to a Generator with "Generator on: [...]". The Generator itself is passed to the block, and as soon as a message like #next, #peek, #atEnd or #peekFor: is sent to the generator, execution of the block starts/resumes and goes on until the generator’s #yield: method is called: then the argument of #yield: will be the Generator’s next element. If the block goes on to the end without calling #yield:, the Generator will produce no more elements and #atEnd will return true.
You could achieve the effect of generators manually by writing your own class and storing all the local variables of the generator as instance variables. For example, returning a list of integers could be done by setting a variable to 0, and having the #next method increment it and return it. However, for a moderately complicated generator, writing a corresponding class would be much messier (and might lead to code duplication or inefficiency if you want to support #peek, #peekFor: and/or #atEnd): in general, providing a #do:-like interface is easy, but not providing a Stream-like one (think binary trees).
The idea of generators comes from other programming languages, in particular this interface looks much like Scheme streams and Python generators. But Python in turn mutuated the idea for example from Icon, where the idea of generators is central. In Icon, every expression and function call behaves like a generator, and if a statement manages scalars, it automatically uses up all the results that the corresponding generator provides; on the other hand, Icon does not represent generators as first-class objects like Python and Smalltalk do.
• Generator class-instance creation: | (class) | |
• Generator-stream protocol: | (instance) |
Next: Generator-stream protocol, Up: Generator [Index]
Return an infinite generator; the first item is aValue, the following items are obtained by passing the previous value to aBlock.
Return a generator and pass it to aBlock. When #next is sent to the generator, the block will start execution, and will be suspended again as soon as #yield: is sent from the block to the generator.
Return a generator; for each item of aCollection, evaluate aBlock passing the generator and the item.
Previous: Generator class-instance creation, Up: Generator [Index]
Answer whether more data can be generated.
Evaluate the generator until it generates the next value or decides that nothing else can be generated.
Evaluate the generator until it generates the next value or decides that nothing else can be generated, and save the value so that #peek or #next will return it again.
Evaluate the generator until it generates the next value or decides that nothing else can be generated, and if it is not equal to anObject, save the value so that #peek or #next will return it again.
When entering from the generator the code in the block is executed and control flow goes back to the consumer. When entering from the consumer, the code after the continuation is executed, which resumes execution of the generator block.
Next: Halt, Previous: Generator, Up: Base classes [Index]
This class is usually not instantiated. Class methods provide a way to parse command lines from Smalltalk.
• Getopt class-instance creation: | (class) |
Parse the command-line arguments in args according to the syntax specified in pattern. For every command-line option found, the two-argument block actionBlock is evaluated passing the option name and the argument. For file names (or in general, other command-line arguments than options) the block’s first argument will be nil. For options without arguments, or with unspecified 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 syntax of pattern, see #parse:with:do:ifError:.
Parse the command-line arguments in args according to the syntax specified in pattern. For every command-line option found, the two-argument block actionBlock is evaluated passing the option name and the argument. For file names (or in general, other command-line arguments than options) the block’s first argument will be nil. For options without arguments, or with unspecified 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-line option. If a word ends with a colon, the option will have a mandatory argument. If a word ends with two colons, the option will have an optional argument. Before the colons, multiple option names (either short names like ‘-l’ or long names like ‘–long’) can be specified. Before passing the option to actionBlock, the name will be canonicalized to the last one.
Prefixes of long options are accepted as long as they’re unique, and they are canonicalized to the full name before passing it to actionBlock. Additionally, the full name of an option is accepted even if it is the prefix of a longer option.
Mandatory arguments can appear in the next argument, or in the same argument (separated by an = for arguments to long options). Optional arguments must appear in the same argument.
Next: HashedCollection, Previous: Getopt, Up: Base classes [Index]
Halt represents a resumable error, usually a bug.
• Halt-description: | (instance) |
Answer a textual description of the exception.
Answer true. #halt exceptions are by default resumable.
Next: HomedAssociation, Previous: Halt, Up: Base classes [Index]
I am an hashed collection that can store objects uniquely and give fast responses on their presence in the collection.
• HashedCollection class-instance creation: | (class) | |
• HashedCollection-accessing: | (instance) | |
• HashedCollection-builtins: | (instance) | |
• HashedCollection-copying: | (instance) | |
• HashedCollection-enumerating the elements of a collection: | (instance) | |
• HashedCollection-rehashing: | (instance) | |
• HashedCollection-removing: | (instance) | |
• HashedCollection-saving and loading: | (instance) | |
• HashedCollection-storing: | (instance) | |
• HashedCollection-testing collections: | (instance) |
Next: HashedCollection-accessing, Up: HashedCollection [Index]
Answer a new instance of the receiver with a default size
Answer a new instance of the receiver with the given capacity
Answer a collection whose elements are all those in aCollection
Next: HashedCollection-builtins, Previous: HashedCollection class-instance creation, Up: HashedCollection [Index]
Add newObject to the set, if and only if the set doesn’t already contain an occurrence of it. Don’t fail if a duplicate is found. Answer anObject
This method should not be called for instances of this class.
This method should not be called for instances of this class.
Next: HashedCollection-copying, Previous: HashedCollection-accessing, Up: HashedCollection [Index]
Private - Answer the anIndex-th item of the hash table for the receiver. Using this instead of basicAt: allows for easier changes in the representation
Private - Store value in the anIndex-th item of the hash table for the receiver. Using this instead of basicAt:put: allows for easier changes in the representation
Private - Answer the size of the hash table for the receiver. Using this instead of basicSize allows for easier changes in the representation
Next: HashedCollection-enumerating the elements of a collection, Previous: HashedCollection-builtins, Up: HashedCollection [Index]
Returns a deep copy of the receiver (the instance variables are copies of the receiver’s instance variables)
Returns a shallow copy of the receiver (the instance variables are not copied)
Next: HashedCollection-rehashing, Previous: HashedCollection-copying, Up: HashedCollection [Index]
Enumerate all the non-nil members of the set
Next: HashedCollection-removing, Previous: HashedCollection-enumerating the elements of a collection, Up: HashedCollection [Index]
Rehash the receiver
Next: HashedCollection-saving and loading, Previous: HashedCollection-rehashing, Up: HashedCollection [Index]
Remove oldObject from the set. If it is found, answer oldObject. Otherwise, evaluate anExceptionBlock and answer its value.
Next: HashedCollection-storing, Previous: HashedCollection-removing, Up: HashedCollection [Index]
Called after loading an object; rehash the collection because identity objects will most likely mutate their hashes.
Called after an object is dumped. Do nothing – necessary because by default this calls #postLoad by default
Next: HashedCollection-testing collections, Previous: HashedCollection-saving and loading, Up: HashedCollection [Index]
Store on aStream some Smalltalk code which compiles to the receiver
Previous: HashedCollection-storing, Up: HashedCollection [Index]
Returns true if the two sets have the same membership, false if not
Answer how many elements the receiver can hold before having to grow.
Return the hash code for the members of the set. Since order is unimportant, we use a commutative operator to compute the hash value.
Answer whether the receiver contains an instance of anObject.
Answer whether the receiver is empty.
Return the number of occurrences of anObject. Since we’re a set, this is either 0 or 1. Nil is never directly in the set, so we special case it (the result is always 1).
Answer the receiver’s size
Next: IdentityDictionary, Previous: HashedCollection, Up: Base classes [Index]
My instances represent know about their parent namespace, which is of use when implementing weak collections and finalizations.
• HomedAssociation class-basic: | (class) | |
• HomedAssociation-accessing: | (instance) | |
• HomedAssociation-finalization: | (instance) | |
• HomedAssociation-storing: | (instance) |
Next: HomedAssociation-accessing, Up: HomedAssociation [Index]
Answer a new association with the given key and value
Next: HomedAssociation-finalization, Previous: HomedAssociation class-basic, Up: HomedAssociation [Index]
Answer the namespace in which I live.
Set the namespace in which I live to be aNamespace.
Next: HomedAssociation-storing, Previous: HomedAssociation-accessing, Up: HomedAssociation [Index]
This message is sent to the receiver when the object is made ephemeron (which is common when HomedAssociations are used by a WeakKeyDictionary or a WeakSet). The mourning of the object’s key is first of all demanded to the environment (which will likely remove the object from itself), and then performed as usual by clearing the key and value fields.
Previous: HomedAssociation-finalization, Up: HomedAssociation [Index]
Put on aStream some Smalltalk code compiling to the receiver
Next: IdentitySet, Previous: HomedAssociation, Up: Base classes [Index]
I am similar to LookupTable, except that I use the object identity comparision message == to determine equivalence of indices.
Next: Integer, Previous: IdentityDictionary, Up: Base classes [Index]
I am the typical set object; I can store any objects uniquely. I use the == operator to determine duplication of objects.
• IdentitySet-testing: | (instance) |
Up: IdentitySet [Index]
Answer whether we include the anObject object; for IdentitySets this is identical to #includes:
Next: Interval, Previous: IdentitySet, Up: Base classes [Index]
I am the abstract integer class of the GNU Smalltalk system. My subclasses’ instances can represent signed integers of various sizes (a subclass is picked according to the size), with varying efficiency.
• Integer class-converting: | (class) | |
• Integer-accessing: | (instance) | |
• Integer-basic: | (instance) | |
• Integer-bit operators: | (instance) | |
• Integer-converting: | (instance) | |
• Integer-extension: | (instance) | |
• Integer-iterators: | (instance) | |
• Integer-math methods: | (instance) | |
• Integer-printing: | (instance) | |
• Integer-storing: | (instance) | |
• Integer-testing functionality: | (instance) |
Next: Integer-accessing, Up: Integer [Index]
Answer aNumber converted to a kind of Integer
Next: Integer-basic, Previous: Integer class-converting, Up: Integer [Index]
Answer ‘1’.
Answer the receiver.
Next: Integer-bit operators, Previous: Integer-accessing, Up: Integer [Index]
Answer an hash value for the receiver
Next: Integer-converting, Previous: Integer-basic, Up: Integer [Index]
True if all 1 bits in anInteger are 1 in the receiver
True if any 1 bits in anInteger are 1 in the receiver
Answer the index-th bit of the receiver (the LSB has an index of 1)
Answer an integer which is identical to the receiver, possibly with the exception of the index-th bit of the receiver (the LSB having an index of 1), which assumes a value equal to the low-order bit of the second parameter.
Answer an Integer equal to the receiver, except that all the bits that are set in aMask are cleared.
Return the 1’s complement of the bits of the receiver
Clear the index-th bit of the receiver and answer a new Integer
Answer the index-th base-256 digit of the receiver (byte), expressed in two’s complement
Return the index of the highest order 1 bit of the receiver.
Answer whether the index-th bit of the receiver is set
Return the index of the lowest order 1 bit of the receiver.
Answer true if no 1 bits in anInteger are 1 in the receiver.
Set the index-th bit of the receiver and answer a new Integer
Next: Integer-extension, Previous: Integer-bit operators, Up: Integer [Index]
Return self as a Character or UnicodeCharacter object.
Return the receiver converted to a fraction
Answer the receiver, converted to a ScaledDecimal object. The scale is forced to be 0.
Return the receiver - it’s already truncated
Coerce aNumber to the receiver’s class.
Return the receiver - it’s already truncated
Return the receiver - it’s already truncated
Return the receiver - it’s already truncated
Next: Integer-iterators, Previous: Integer-converting, Up: Integer [Index]
Answer the receiver, truncated to the first higher or equal multiple of anInteger (which must be a power of two)
Next: Integer-math methods, Previous: Integer-extension, Up: Integer [Index]
Evaluate aBlock a number of times equal to the receiver’s value. Compiled in-line for no argument aBlocks without temporaries, and therefore not overridable.
Next: Integer-printing, Previous: Integer-iterators, Up: Integer [Index]
Compute the number of combinations of anInteger objects among a number of objects given by the receiver.
Answer (self log: radix) ceiling. Optimized to answer an integer.
Answer an estimate of (self abs floorLog: 10)
Return whether the receiver is even
Return the receiver’s factorial.
Answer (self log: radix) floor. Optimized to answer an integer.
Return the greatest common divisor (Euclid’s algorithm) between the receiver and anInteger
Return the least common multiple between the receiver and anInteger
Return whether the receiver is odd
Next: Integer-storing, Previous: Integer-math methods, Up: Integer [Index]
Print on aStream the base 10 representation of the receiver
Return the base 10 representation of the receiver
Answer whether the receiver is expressible as a Smalltalk literal.
Print on aStream the base 10 representation of the receiver
Print on aStream the base b representation of the receiver
Print on aStream the base 10 representation of the receiver, padded if necessary to size characters with copies of padding.
Print on aStream the base b representation of the receiver, padded if necessary to size characters with copies of padding.
Return the base baseInteger representation of the receiver, padded if necessary to size characters with copies of padding.
Return the base baseInteger representation of the receiver, padded if necessary to size characters with copies of padding.
Return the base 10 representation of the receiver
Return the base baseInteger representation of the receiver
Return the base baseInteger representation of the receiver, with BBr in front of it
Return the base baseInteger representation of the receiver, with BBr in front of it. This method is deprecated, use #printStringRadix: instead.
Store on aStream some Smalltalk code which compiles to the receiver
Print on aStream Smalltalk code compiling to the receiver, represented in base b
Next: Integer-testing functionality, Previous: Integer-printing, Up: Integer [Index]
Print on aStream the base 10 representation of the receiver
Return the base 10 representation of the receiver
Previous: Integer-storing, Up: Integer [Index]
Answer ‘true’.
Answer whether the receiver is rational - true
Next: Iterable, Previous: Integer, Up: Base classes [Index]
My instances represent ranges of objects, typically Number type objects. I provide iteration/enumeration messages for producing all the members that my instance represents.
• Interval class-instance creation: | (class) | |
• Interval-basic: | (instance) | |
• Interval-printing: | (instance) | |
• Interval-storing: | (instance) | |
• Interval-testing: | (instance) |
Next: Interval-basic, Up: Interval [Index]
Answer an Interval going from startInteger to the stopInteger, with a step of 1
Answer an Interval going from startInteger to the stopInteger, with a step of stepInteger
Answer an Interval containing the same elements as aCollection. Fail if it is not possible to create one.
Next: Interval-printing, Previous: Interval class-instance creation, Up: Interval [Index]
Answer the index-th element of the receiver.
This method should not be called for instances of this class.
Evaluate the receiver for each element in aBlock, collect in an array the result of the evaluations.
Not commented.
Evaluate the receiver for each element in aBlock
Answer whether the receiver is empty.
Answer a copy of the receiver with all of its items reversed
Answer the number of elements in the receiver.
Answer ‘Array’.
Next: Interval-storing, Previous: Interval-basic, Up: Interval [Index]
Not commented.
Answer ‘step’.
Answer the last value.
Print a representation for the receiver on aStream
Next: Interval-testing, Previous: Interval-printing, Up: Interval [Index]
Store Smalltalk code compiling to the receiver on aStream
Previous: Interval-storing, Up: Interval [Index]
Answer whether anInterval is the same interval as the receiver
Answer an hash value for the receiver
Answer whether elements of the receiver are computed using exact arithmetic. This is true as long as the start and step value are exact (i.e. not floating-point).
Next: LargeArray, Previous: Interval, Up: Base classes [Index]
I am an abstract class. My instances are collections of objects that can be iterated. The details on how they can be mutated (if at all possible) are left to the subclasses.
• Iterable class-multibyte encodings: | (class) | |
• Iterable-enumeration: | (instance) | |
• Iterable-iteration: | (instance) | |
• Iterable-streaming: | (instance) |
Next: Iterable-enumeration, Up: Iterable [Index]
Answer true; the receiver is able to store arbitrary Unicode characters.
Next: Iterable-iteration, Previous: Iterable class-multibyte encodings, Up: Iterable [Index]
Answer an iterable that enumerates first the elements of the receiver and then the elements of anIterable.
Search the receiver for an element for which aBlock returns false. Answer true if none does, false otherwise.
Search the receiver for an element for which aBlock returns true. Answer true if some does, false otherwise.
Answer a new instance of a Collection containing all the results of evaluating aBlock passing each of the receiver’s elements
Search the receiver for an element for which aBlock returns false. Answer true if none does, false otherwise.
Search the receiver for an element for which aBlock returns true. Answer true if some does, false otherwise.
Count the elements of the receiver for which aBlock returns true, and return their number.
Search the receiver for an element for which aBlock returns true. If some does, answer it. If none does, fail
Search the receiver for an element for which aBlock returns true. If some does, answer it. If none does, answer the result of evaluating aBlock
Enumerate each object of the receiver, passing them to aBlock
Enumerate each object of the receiver, passing them to aBlock. Between every two invocations of aBlock, invoke separatorBlock
First, pass to binaryBlock the first and second elements of the receiver; for each subsequent element, pass the result of the previous evaluation and an element. Answer the result of the last invocation, or the first element if the collection has size 1. Fail if the collection is empty.
First, pass to binaryBlock thisValue and the first element of the receiver; for each subsequent element, pass the result of the previous evaluation and an element. Answer the result of the last invocation.
Search the receiver for an element for which aBlock returns true. Answer true if none does, false otherwise.
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, don’t answer true
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, answer true
Next: Iterable-streaming, Previous: Iterable-enumeration, Up: Iterable [Index]
Evaluate nilBlock if the receiver is nil, else evaluate iterableBlock with each element of the receiver (which should be an Iterable).
Evaluate iterableBlock with each element of the receiver (which should be an Iterable) if not nil. Else answer nil
Evaluate nilBlock if the receiver is nil, else evaluate iterableBlock, passing each element of the receiver (which should be an Iterable).
Previous: Iterable-iteration, Up: Iterable [Index]
Write all the objects in the receiver to aStream
Return a stream with the same contents as the receiver.
Next: LargeArrayedCollection, Previous: Iterable, Up: Base classes [Index]
I am similar to a plain array, but I’m specially designed to save memory when lots of items are nil.
• LargeArray-overridden: | (instance) |
Up: LargeArray [Index]
Create an Array of the given size
Next: LargeByteArray, Previous: LargeArray, Up: Base classes [Index]
I am an abstract class specially designed to save memory when lots of items have the same value.
• LargeArrayedCollection class-instance creation: | (class) | |
• LargeArrayedCollection-accessing: | (instance) | |
• LargeArrayedCollection-basic: | (instance) |
Next: LargeArrayedCollection-accessing, Up: LargeArrayedCollection [Index]
Answer a new instance of the receiver, with room for anInteger elements.
Next: LargeArrayedCollection-basic, Previous: LargeArrayedCollection class-instance creation, Up: LargeArrayedCollection [Index]
Answer the anIndex-th item of the receiver.
Replace the anIndex-th item of the receiver with anObject.
Arrange the representation of the array for maximum memory saving.
Previous: LargeArrayedCollection-accessing, Up: LargeArrayedCollection [Index]
Answer whether the receiver and aLargeArray have the same contents
Answer an hash value for the receiver
Answer the maximum valid index for the receiver
Next: LargeInteger, Previous: LargeArrayedCollection, Up: Base classes [Index]
I am similar to a plain ByteArray, but I’m specially designed to save memory when lots of items are zero.
• LargeByteArray-overridden: | (instance) |
Up: LargeByteArray [Index]
Answer the maximum number of consecutive items set to the defaultElement that can be present in a compressed array.
Answer the value which is hoped to be the most common in the array
Create a ByteArray of the given size
Next: LargeNegativeInteger, Previous: LargeByteArray, Up: Base classes [Index]
I represent a large integer, which has to be stored as a long sequence of bytes. I have methods to do arithmetics and comparisons, but I need some help from my children, LargePositiveInteger and LargeNegativeInteger, to speed them up a bit.
• LargeInteger-accessing: | (instance) | |
• LargeInteger-arithmetic: | (instance) | |
• LargeInteger-bit operations: | (instance) | |
• LargeInteger-built-ins: | (instance) | |
• LargeInteger-coercion: | (instance) | |
• LargeInteger-disabled: | (instance) | |
• LargeInteger-primitive operations: | (instance) | |
• LargeInteger-testing: | (instance) |
Next: LargeInteger-arithmetic, Up: LargeInteger [Index]
Return self raised to the anInteger-th power
Next: LargeInteger-bit operations, Previous: LargeInteger-accessing, Up: LargeInteger [Index]
Multiply aNumber and the receiver, answer the result
Sum the receiver and aNumber, answer the result
Subtract aNumber from the receiver, answer the result
Divide aNumber and the receiver, answer the result (an Integer or Fraction)
Divide aNumber and the receiver, answer the result truncated towards -infinity
Divide aNumber and the receiver, answer the remainder truncated towards -infinity
Dividing receiver by arg assuming that the remainder is zero, and answer the result
Answer an estimate of (self abs floorLog: 10)
Answer the receiver’s negated
Divide aNumber and the receiver, answer the result truncated towards 0
Divide aNumber and the receiver, answer the remainder truncated towards 0
Next: LargeInteger-built-ins, Previous: LargeInteger-arithmetic, Up: LargeInteger [Index]
Answer the receiver ANDed with aNumber
Answer the aNumber-th bit in the receiver, where the LSB is 1
Answer the receiver’s 1’s complement
Answer the receiver ORed with aNumber
Answer the receiver shifted by aNumber places
Answer the receiver XORed with aNumber
Return the index of the lowest order 1 bit of the receiver.
Next: LargeInteger-coercion, Previous: LargeInteger-bit operations, Up: LargeInteger [Index]
Answer the anIndex-th byte in the receiver’s representation
Set the anIndex-th byte in the receiver’s representation
Answer the index-th base-256 digit of the receiver (byte), expressed in two’s complement
Set the anIndex-th base-256 digit in the receiver’s representation
Answer the number of base-256 digits in the receiver
Answer an hash value for the receiver
Private - Replace the characters from start to stop with new characters contained in replacementString (which, actually, can be any variable byte class), starting at the replaceStart location of replacementString
Answer the number of indexed instance variable in the receiver
Next: LargeInteger-disabled, Previous: LargeInteger-built-ins, Up: LargeInteger [Index]
Convert the receiver to a kind of number that is understood by the C call-out mechanism.
Truncate the number; if needed, convert it to LargeInteger representation.
Answer the receiver’s generality
Coerce 1 to the receiver’s class
Coerce 0 to the receiver’s class
Next: LargeInteger-primitive operations, Previous: LargeInteger-coercion, Up: LargeInteger [Index]
This method always fails. The number of OOPs is far less than the minimum number represented with a LargeInteger.
Answer ‘nil’.
Next: LargeInteger-testing, Previous: LargeInteger-disabled, Up: LargeInteger [Index]
Private - Left shift the receiver by aNumber places
Private - Right shift the receiver by ’shift’ places
Private - Same as negated, but always answer a LargeInteger
Previous: LargeInteger-primitive operations, Up: LargeInteger [Index]
Answer whether the receiver is smaller than aNumber
Answer whether the receiver is smaller than aNumber or equal to it
Answer whether the receiver and aNumber identify the same number.
Answer whether the receiver is greater than aNumber
Answer whether the receiver is greater than aNumber or equal to it
Answer whether the receiver and aNumber identify different numbers.
Next: LargePositiveInteger, Previous: LargeInteger, Up: Base classes [Index]
Just like my brother LargePositiveInteger, I provide a few methods that allow LargeInteger to determine the sign of a large integer in a fast way during its calculations. For example, I know that I am smaller than any LargePositiveInteger
• LargeNegativeInteger-converting: | (instance) | |
• LargeNegativeInteger-numeric testing: | (instance) | |
• LargeNegativeInteger-reverting to LargePositiveInteger: | (instance) |
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatE
Answer the receiver converted to a FloatQ
Next: LargeNegativeInteger-reverting to LargePositiveInteger, Previous: LargeNegativeInteger-converting, Up: LargeNegativeInteger [Index]
Answer the receiver’s absolute value.
Answer whether the receiver is < 0
Answer whether the receiver is >= 0
Answer the receiver’s sign
Answer whether the receiver is > 0
Previous: LargeNegativeInteger-numeric testing, Up: LargeNegativeInteger [Index]
Sum the receiver and aNumber, answer the result
Subtract aNumber from the receiver, answer the result
Return the greatest common divisor between the receiver and anInteger
Answer the receiver’s highest bit’s index
Next: LargeWordArray, Previous: LargeNegativeInteger, Up: Base classes [Index]
Just like my brother LargeNegativeInteger, I provide a few methods that allow LargeInteger to determine the sign of a large integer in a fast way during its calculations. For example, I know that I am larger than any LargeNegativeInteger. In addition I implement the guts of arbitrary precision arithmetic.
• LargePositiveInteger-arithmetic: | (instance) | |
• LargePositiveInteger-converting: | (instance) | |
• LargePositiveInteger-helper byte-level methods: | (instance) | |
• LargePositiveInteger-numeric testing: | (instance) | |
• LargePositiveInteger-primitive operations: | (instance) |
Next: LargePositiveInteger-converting, Up: LargePositiveInteger [Index]
Sum the receiver and aNumber, answer the result
Subtract aNumber from the receiver, answer the result
Calculate the GCD between the receiver and anInteger
Answer the receiver’s highest bit’s index
Next: LargePositiveInteger-helper byte-level methods, Previous: LargePositiveInteger-arithmetic, Up: LargePositiveInteger [Index]
Answer the receiver converted to a FloatD
Answer the receiver converted to a FloatE
Answer the receiver converted to a FloatQ
Return in a String str the base radix representation of the receiver.
Next: LargePositiveInteger-numeric testing, Previous: LargePositiveInteger-converting, Up: LargePositiveInteger [Index]
Private - Answer the sign of byteArray2 - byteArray1; the j-th byte of byteArray1 is compared with the first of byteArray2, the j+1-th with the second, and so on.
Private - Sutract the bytes in byteArray2 from those in byteArray1
Private - Multiply the bytes in bytes by anInteger, which must be < 255. Put the result back in bytes.
Private - Left shift by 1 place the bytes in aByteArray
Private - Left shift the bytes in aByteArray by totalShift places
Private - Left shift by shift places the bytes in aByteArray (shift <= 7)
Private - Right shift the bytes in aByteArray by totalShift places
Private - Right shift the bytes in ‘bytes’ by ’aNumber’ places (shift <= 7)
Private - Answer the number of trailing zero bits in the receiver
Private - Implements Knuth’s divide and correct algorithm from ‘Seminumerical Algorithms’ 3rd Edition, section 4.3.1 (which is basically an enhanced version of the divide ‘algorithm’ for two-digit divisors which is taught in primary school!!!)
Next: LargePositiveInteger-primitive operations, Previous: LargePositiveInteger-helper byte-level methods, Up: LargePositiveInteger [Index]
Answer the receiver’s absolute value
Answer whether the receiver is < 0
Answer whether the receiver is >= 0
Answer the receiver’s sign
Answer whether the receiver is > 0
Previous: LargePositiveInteger-numeric testing, Up: LargePositiveInteger [Index]
Private - Divide the receiver by aNumber (unsigned division). Evaluate aBlock passing the result ByteArray, the remainder ByteArray, and whether the division had a remainder
Private - Answer whether the receiver is small enough to employ simple scalar algorithms for division and multiplication
Private - Multiply the receiver by aNumber (unsigned multiply)
Next: LargeZeroInteger, Previous: LargePositiveInteger, Up: Base classes [Index]
I am similar to a plain WordArray, but I’m specially designed to save memory when lots of items are zero.
• LargeWordArray-overridden: | (instance) |
Up: LargeWordArray [Index]
Answer the value which is hoped to be the most common in the array
Create a WordArray of the given size
Next: Link, Previous: LargeWordArray, Up: Base classes [Index]
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 but is represented like LargeIntegers, has the same generality as LargeIntegers, and so on. That only instance is stored in the class variable Zero, and is used in arithmetical methods, when we have to coerce a parameter that is zero.
• LargeZeroInteger-accessing: | (instance) | |
• LargeZeroInteger-arithmetic: | (instance) | |
• LargeZeroInteger-numeric testing: | (instance) | |
• LargeZeroInteger-printing: | (instance) |
Next: LargeZeroInteger-arithmetic, Up: LargeZeroInteger [Index]
Answer ‘0’.
Answer ‘0’.
Answer ‘0’.
Next: LargeZeroInteger-numeric testing, Previous: LargeZeroInteger-accessing, Up: LargeZeroInteger [Index]
Multiply aNumber and the receiver, answer the result
Sum the receiver and aNumber, answer the result
Subtract aNumber from the receiver, answer the result
Divide aNumber and the receiver, answer the result (an Integer or Fraction)
Divide aNumber and the receiver, answer the result truncated towards -infinity
Divide aNumber and the receiver, answer the remainder truncated towards -infinity
Divide aNumber and the receiver, answer the result truncated towards 0
Divide aNumber and the receiver, answer the remainder truncated towards 0
Next: LargeZeroInteger-printing, Previous: LargeZeroInteger-arithmetic, Up: LargeZeroInteger [Index]
Answer the receiver’s sign
Answer whether the receiver is > 0
Previous: LargeZeroInteger-numeric testing, Up: LargeZeroInteger [Index]
Return in a string the base radix representation of the receiver.
Next: LinkedList, Previous: LargeZeroInteger, Up: Base classes [Index]
I represent simple linked lists. Generally, I am not used by myself, but rather a subclass adds other instance variables that hold the information for each node, and I hold the glue that keeps them together.
• Link class-instance creation: | (class) | |
• Link-basic: | (instance) | |
• Link-iteration: | (instance) |
Next: Link-basic, Up: Link [Index]
Create an instance with the given next link
Next: Link-iteration, Previous: Link class-instance creation, Up: Link [Index]
Answer the next item in the list
Set the next item in the list
Previous: Link-basic, Up: Link [Index]
Retrieve a node (instance of Link) that is at a distance of ‘index’ after the receiver.
This method should not be called for instances of this class.
Evaluate aBlock for each element in the list
Answer the number of elements in the list. Warning: this is O(n)
Next: LookupKey, Previous: Link, Up: Base classes [Index]
I provide methods that access and manipulate linked lists. I assume that the elements of the linked list are subclasses of Link, because I use the methods that class Link supplies to implement my methods.
• LinkedList-accessing: | (instance) | |
• LinkedList-adding: | (instance) | |
• LinkedList-enumerating: | (instance) | |
• LinkedList-iteration: | (instance) | |
• LinkedList-testing: | (instance) |
Next: LinkedList-adding, Up: LinkedList [Index]
Return the element that is index into the linked list.
This method should not be called for instances of this class.
Next: LinkedList-enumerating, Previous: LinkedList-accessing, Up: LinkedList [Index]
Add aLink at the end of the list; return aLink.
Add aLink at the head of the list; return aLink.
Add aLink at then end of the list; return aLink.
Remove aLink from the list and return it, or invoke aBlock if it’s not found in the list.
Remove the first element from the list and return it, or error if the list is empty.
Remove the final element from the list and return it, or error if the list is empty.
Next: LinkedList-iteration, Previous: LinkedList-adding, Up: LinkedList [Index]
Enumerate each object in the list, passing it to aBlock (actual behavior might depend on the subclass of Link that is being used).
Answer whether we include the anObject object
Answer whether we include anObject
Next: LinkedList-testing, Previous: LinkedList-enumerating, Up: LinkedList [Index]
Retrieve the first element of the list and return it, or error if the list is empty.
Retrieve the last element of the list and return it, or error if the list is empty.
Previous: LinkedList-iteration, Up: LinkedList [Index]
Returns true if the list contains no members
Returns true if the list contains at least a member
Answer the number of elements in the list. Warning: this is O(n)
Next: LookupTable, Previous: LinkedList, Up: Base classes [Index]
I represent a key for looking up entries in a data structure. Subclasses of me, such as Association, typically represent dictionary entries.
• LookupKey class-basic: | (class) | |
• LookupKey-accessing: | (instance) | |
• LookupKey-printing: | (instance) | |
• LookupKey-storing: | (instance) | |
• LookupKey-testing: | (instance) |
Next: LookupKey-accessing, Up: LookupKey [Index]
Answer a new instance of the receiver with the given key and value
Next: LookupKey-printing, Previous: LookupKey class-basic, Up: LookupKey [Index]
Answer the receiver’s key
Set the receiver’s key to aKey
Next: LookupKey-storing, Previous: LookupKey-accessing, Up: LookupKey [Index]
Put on aStream a representation of the receiver
Next: LookupKey-testing, Previous: LookupKey-printing, Up: LookupKey [Index]
Put on aStream some Smalltalk code compiling to the receiver
Previous: LookupKey-storing, Up: LookupKey [Index]
Answer whether the receiver’s key is less than aLookupKey’s
Answer whether the receiver’s key and value are the same as aLookupKey’s, or false if aLookupKey is not an instance of the receiver
Answer an hash value for the receiver
Next: Magnitude, Previous: LookupKey, Up: Base classes [Index]
I am a more efficient variant of Dictionary that cannot be used as a pool dictionary of variables, as I don’t use Associations to store key-value pairs. I also cannot have nil as a key; if you need to be able to store nil as a key, use Dictionary instead. I use the object equality comparison message #= to determine equivalence of indices.
• LookupTable class-instance creation: | (class) | |
• LookupTable-accessing: | (instance) | |
• LookupTable-enumerating: | (instance) | |
• LookupTable-hashing: | (instance) | |
• LookupTable-rehashing: | (instance) | |
• LookupTable-removing: | (instance) | |
• LookupTable-storing: | (instance) |
Next: LookupTable-accessing, Up: LookupTable [Index]
Create a new LookupTable with a default size
Next: LookupTable-enumerating, Previous: LookupTable class-instance creation, Up: LookupTable [Index]
Add the anAssociation key to the receiver
Answer the key/value Association for the given key. Evaluate aBlock (answering the result) if the key is not found
Answer the value associated to the given key, or the result of evaluating aBlock if the key is not found
If aKey is absent, answer nil. Else, evaluate aBlock passing the associated value and answer the result of the invocation
Store value as associated to the given key
Next: LookupTable-hashing, Previous: LookupTable-accessing, Up: LookupTable [Index]
Pass each association in the LookupTable to aBlock.
Pass each value in the LookupTable to aBlock.
Pass each key/value pair in the LookupTable as two distinct parameters to aBlock.
Pass each key in the LookupTable to aBlock.
Next: LookupTable-rehashing, Previous: LookupTable-enumerating, Up: LookupTable [Index]
Answer the hash value for the receiver
Next: LookupTable-removing, Previous: LookupTable-hashing, Up: LookupTable [Index]
Rehash the receiver
Next: LookupTable-storing, Previous: LookupTable-rehashing, Up: LookupTable [Index]
Remove anAssociation’s key from the dictionary
Remove anAssociation’s key from the dictionary
Remove the passed key from the LookupTable, answer the result of evaluating aBlock if it is not found
Previous: LookupTable-removing, Up: LookupTable [Index]
Print Smalltalk code compiling to the receiver on aStream
Next: MappedCollection, Previous: LookupTable, Up: Base classes [Index]
I am an abstract class. My objects represent things that are discrete and map to a number line. My instances can be compared with < and >.
• Magnitude-basic: | (instance) | |
• Magnitude-misc methods: | (instance) |
Next: Magnitude-misc methods, Up: Magnitude [Index]
Answer whether the receiver is less than aMagnitude
Answer whether the receiver is less than or equal to aMagnitude
Answer whether the receiver is equal to aMagnitude
Answer whether the receiver is greater than aMagnitude
Answer whether the receiver is greater than or equal to aMagnitude
Previous: Magnitude-basic, Up: Magnitude [Index]
Returns true if object is inclusively between min and max.
Returns the greatest object between the receiver and aMagnitude
Returns the least object between the receiver and aMagnitude
Next: Memory, Previous: Magnitude, Up: Base classes [Index]
I represent collections of objects that are indirectly indexed by names. There are really two collections involved: domain and a map. The map maps between external names and indices into domain, which contains the real association. In order to work properly, the domain must be an instance of a subclass of SequenceableCollection, and the map must be an instance of Dictionary, or of a subclass of SequenceableCollection.
As an example of using me, consider implenting a Dictionary whose elements are indexed. The domain would be a SequenceableCollection with n elements, the map a Dictionary associating each key to an index in the domain. To access 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 matrix implemented as a single n*m Array: the Array would be the domain, while the map would be an Interval.
• MappedCollection class-instance creation: | (class) | |
• MappedCollection-basic: | (instance) |
Next: MappedCollection-basic, Up: MappedCollection [Index]
Answer a new MappedCollection using the given domain (aCollection) and map
This method should not be used; instead, use #collection:map: to create MappedCollection.
Previous: MappedCollection class-instance creation, Up: MappedCollection [Index]
This method should not be called for instances of this class.
Answer the object at the given key
Store value at the given key
Answer a new MappedCollection that only includes the given keys. The new MappedCollection might use keyCollection or consecutive integers for the keys, depending on the map’s type. Fail if any of them is not found in the map.
Answer a Collection with the same keys as the map, where accessing a key yields the value obtained by passing through aBlock the value accessible from the key in the receiver. The result need not be another MappedCollection
Answer a bag with the receiver’s values
Answer a new collection containing all the items in the receiver from the a-th to the b-th.
Evaluate aBlock for each object
Answer the receiver’s domain
Answer the keys that can be used to access this collection.
Evaluate aBlock passing two arguments, one being a key that can be used to access this collection, and the other one being the value.
Evaluate aBlock on the keys that can be used to access this collection.
Answer the receiver’s map
Answer the objects in the domain for which aBlock returns false
Answer the objects in the domain for which aBlock returns true
Answer the receiver’s size
Next: Message, Previous: MappedCollection, Up: Base classes [Index]
I provide access to actual machine addresses of OOPs and objects. I have no instances; you send messages to my class to map between an object and the address of its OOP or object. In addition I provide direct memory access with different C types (ints, chars, OOPs, floats,...).
• Memory class-accessing: | (class) |
Access the Smalltalk object (OOP) at the given address.
Store a pointer (OOP) to the Smalltalk object identified by ‘value’ at the given address.
Answer whether we’re running on a big- or little-endian system.
Access the C char at the given address. The value is returned as a Smalltalk Character.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given address, using sizeof(char) bytes - i.e. 1 byte.
Access the C int pointed by the given address
Access the C double at the given address.
Store the Smalltalk Float object identified by ‘value’, at the given address, writing it like a C double.
Access the C float at the given address.
Store the Smalltalk Float object identified by ‘value’, at the given address, writing it like a C float.
Access the C int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(int) bytes.
Access the C long int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(long) bytes.
Access the C long double at the given address.
Store the Smalltalk Float object identified by ‘value’, at the given address, writing it like a C long double.
Access the C short int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(short) bytes.
Access the string pointed by the C ‘char *’ at the given given address.
Store the Smalltalk String object identified by ‘value’, at the given address in memory, writing it like a *FRESHLY ALLOCATED* C string. It is the caller’s responsibility to free it if necessary.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given address, using sizeof(char) bytes - i.e. 1 byte.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(int) bytes.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(long) bytes.
Access the C unsigned char at the given address. The value is returned as a Smalltalk Character.
Store as a C char the Smalltalk Character or Integer object identified by ‘value’, at the given address, using sizeof(char) bytes - i.e. 1 byte.
Access the C unsigned int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(int) bytes.
Access the C unsigned long int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(long) bytes.
Access the C unsigned short int at the given address.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(short) bytes.
Store the Smalltalk Integer object identified by ‘value’, at the given address, using sizeof(short) bytes.
Next: MessageNotUnderstood, Previous: Memory, Up: Base classes [Index]
I represent a message send. My instances are created to hold a message that has failed, so that error reporting methods can examine the sender and arguments, but also to represent method attributes (like <primitive: 111> since their syntax is isomorphic to that of a message send.
• Message class-creating instances: | (class) | |
• Message-accessing: | (instance) | |
• Message-basic: | (instance) | |
• Message-printing: | (instance) |
Next: Message-accessing, Up: Message [Index]
Create a new Message with the given selector and argument
Create a new Message with the given selector and arguments
Next: Message-basic, Previous: Message class-creating instances, Up: Message [Index]
Answer the first of the receiver’s arguments
Answer the receiver’s arguments
Set the receiver’s arguments
Answer the receiver’s selector
Set the receiver’s selector
Next: Message-printing, Previous: Message-accessing, Up: Message [Index]
Print a representation of the receiver on aStream, modeling it after the source code for a attribute.
Previous: Message-basic, Up: Message [Index]
Print a representation of the receiver on aStream
Resend to aReceiver - present for compatibility
Resend to aReceiver
Next: Metaclass, Previous: Message, Up: Base classes [Index]
MessageNotUnderstood represents an error during message lookup. Signaling it is the default action of the #doesNotUnderstand: handler
• MessageNotUnderstood-accessing: | (instance) | |
• MessageNotUnderstood-description: | (instance) |
Next: MessageNotUnderstood-description, Up: MessageNotUnderstood [Index]
Answer the message that wasn’t understood
Answer the object to whom the message send was directed
Previous: MessageNotUnderstood-accessing, Up: MessageNotUnderstood [Index]
Answer a textual description of the exception.
Answer true. #doesNotUnderstand: exceptions are by default resumable.
Next: MethodContext, Previous: MessageNotUnderstood, Up: Base classes [Index]
I am the root of the class hierarchy. My instances are metaclasses, one for each real class. My instances have a single instance, which they hold onto, which is the class that they are the metaclass of. I provide methods for creation of actual class objects from metaclass object, and the creation of 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: | (class) | |
• Metaclass-accessing: | (instance) | |
• Metaclass-basic: | (instance) | |
• Metaclass-compiling methods: | (instance) | |
• Metaclass-delegation: | (instance) | |
• Metaclass-filing: | (instance) | |
• Metaclass-printing: | (instance) | |
• Metaclass-testing functionality: | (instance) |
Next: Metaclass-accessing, Up: Metaclass [Index]
Answer a new metaclass representing a subclass of superMeta
Next: Metaclass-basic, Previous: Metaclass class-instance creation, Up: Metaclass [Index]
Answer the only instance of the metaclass
Answer the only instance of the metaclass - present for compatibility
Answer the only instance of the metaclass - present for compatibility
Next: Metaclass-compiling methods, Previous: Metaclass-accessing, Up: Metaclass [Index]
Private - create a full featured class and install it, or change the superclass or shape of an existing one; instance variable names, class variable names and pool dictionaries are left untouched.
Private - create a full featured class and install it, or change an existing one
Private - parse the instance and class variables, and the pool dictionaries, then create the class.
Private - create a full featured class and install it
Next: Metaclass-delegation, Previous: Metaclass-basic, Up: Metaclass [Index]
Use my instance’s poolResolution.
Next: Metaclass-filing, Previous: Metaclass-compiling methods, Up: Metaclass [Index]
Add a class variable with the given name to the class pool dictionary
Add the given shared pool to the list of the class’ pool dictionaries
Answer the names of the variables in the receiver’s class pool dictionary and in each of the superclasses’ class pool dictionaries
Answer the shared pools visible from methods in the metaclass, in the correct search order.
Return the names of the shared pools defined by the class and any of its superclasses
Answer the class category
Answer the class pool dictionary
Answer the names of the variables in the class pool dictionary
Answer the class comment
Answer the debugger class that was set in the instance class
Answer the namespace in which the receiver is implemented
Answer the class name - it has none, actually
Answer the (possibly inherited) registered handler for pragma aSymbol, or nil if not found.
Removes the class variable from the class, error if not present, or still in use.
Remove the given dictionary to the list of the class’ pool dictionaries
Return the names of the shared pools defined by the class
Next: Metaclass-printing, Previous: Metaclass-delegation, Up: Metaclass [Index]
File out complete class description: class definition, class and instance methods
Next: Metaclass-testing functionality, Previous: Metaclass-filing, Up: Metaclass [Index]
Answer the class name when the class is referenced from aNamespace.
Print a represention of the receiver on aStream
Print on aStream the class name when the class is referenced from aNamespace.
Store Smalltalk code compiling to the receiver on aStream
Previous: Metaclass-printing, Up: Metaclass [Index]
Answer ‘instanceClass’.
Answer ‘true’.
Next: MethodDictionary, Previous: Metaclass, Up: Base classes [Index]
My instances represent an actively executing method. They record various bits of information about the execution environment, and contain the execution stack.
• MethodContext-accessing: | (instance) | |
• MethodContext-debugging: | (instance) | |
• MethodContext-printing: | (instance) |
Next: MethodContext-debugging, Up: MethodContext [Index]
Answer the MethodContext to which the receiver refers (i.e. the receiver itself)
Answer whether the receiver is a block context
Answers whether the receiver has actually ended execution and will be skipped when doing a return. BlockContexts are removed from the chain whenever a non-local return is done, but MethodContexts need to stay there in case there is a non-local return from the #ensure: block.
To create a valid execution environment for the interpreter even before it starts, GST creates a fake context which invokes a special “termination” method. Such a context can be used as a marker for the current execution environment. Answer whether the receiver is that kind of context.
Answers whether the context must continue execution even after a non-local return (a return from the enclosing method of a block, or a call to the #continue: method of ContextPart). Such contexts are created only by #ensure:.
To create a valid execution environment for the interpreter even before it starts, GST creates a fake context which invokes a special “termination” method. A similar context is created by #valueWithUnwind, by using this method.
Return the context from which the receiver was sent
Next: MethodContext-printing, Previous: MethodContext-accessing, Up: MethodContext [Index]
Answer whether the receiver is a context that should be hidden to the user when presenting a backtrace. Such contexts are identified through the #exceptionHandlingInternal: attribute: if there is such a context in the backtrace, all those above it are marked as internal.
That is, the attribute being set to true means that the context and all those above it are to be hidden, while the attribute being set to false means that the contexts above it must be hidden, but not the context itself.
Previous: MethodContext-debugging, Up: MethodContext [Index]
Print a representation for the receiver on aStream
Next: MethodInfo, Previous: MethodContext, Up: Base classes [Index]
I am similar to an IdentityDictionary, except that removal and rehashing operations inside my instances look atomic to the interpreter.
• MethodDictionary-adding: | (instance) | |
• MethodDictionary-rehashing: | (instance) | |
• MethodDictionary-removing: | (instance) |
Next: MethodDictionary-rehashing, Up: MethodDictionary [Index]
Store value as associated to the given key
Next: MethodDictionary-removing, Previous: MethodDictionary-adding, Up: MethodDictionary [Index]
Rehash the receiver
Previous: MethodDictionary-rehashing, Up: MethodDictionary [Index]
Remove anAssociation’s key from the dictionary
Remove the passed key from the dictionary, answer the result of evaluating aBlock if it is not found
Next: Namespace, Previous: MethodDictionary, Up: Base classes [Index]
I provide information about particular methods. I can produce the category that a method was filed under, and can be used to access the source code of the method.
• MethodInfo-accessing: | (instance) | |
• MethodInfo-equality: | (instance) |
Next: MethodInfo-equality, Up: MethodInfo [Index]
Answer the method category
Set the method category
Answer the class in which the method is defined
Set the class in which the method is defined
Answer the selector through which the method is called
Set the selector through which the method is called
Answer a FileSegment or String or nil containing the method source code
Answer the name of the file where the method source code is
Answer the starting position of the method source code in the sourceFile
Answer a String containing the method source code
Remove the reference to the source code for the method
Previous: MethodInfo-accessing, Up: MethodInfo [Index]
Compare the receiver and aMethodInfo, answer whether they’re equal
Answer an hash value for the receiver
Next: NetClients.URIResolver, Previous: MethodInfo, Up: Base classes [Index]
I am a Namespace that has a super-namespace.
• Namespace class-accessing: | (class) | |
• Namespace class-disabling instance creation: | (class) | |
• Namespace class-initialization: | (class) | |
• Namespace-accessing: | (instance) | |
• Namespace-namespace hierarchy: | (instance) | |
• Namespace-overrides for superspaces: | (instance) | |
• Namespace-printing: | (instance) |
Next: Namespace class-disabling instance creation, Up: Namespace [Index]
Answer the current namespace
Set the current namespace to be aNamespace or, if it is a class, its class pool (the Dictionary that holds class variables).
Next: Namespace class-initialization, Previous: Namespace class-accessing, Up: Namespace [Index]
Disabled - use #addSubspace: to create instances
Disabled - use #addSubspace: to create instances
Next: Namespace-accessing, Previous: Namespace class-disabling instance creation, Up: Namespace [Index]
This actually is not needed, the job could be done in dict.c (function namespace_new). But I’m lazy and I prefer to rely on the Smalltalk implementation of IdentitySet.
Next: Namespace-namespace hierarchy, Previous: Namespace class-initialization, Up: Namespace [Index]
Answer a Set of all the keys in the receiver and its superspaces
Next: Namespace-overrides for superspaces, Previous: Namespace-accessing, Up: Namespace [Index]
Answer all the other namespaces that inherit from the receiver’s superspace.
Evaluate aBlock once for each of the other namespaces that inherit from the receiver’s superspace, passing the namespace as a parameter.
Next: Namespace-printing, Previous: Namespace-namespace hierarchy, Up: Namespace [Index]
Return the key/value pair associated to the variable named as specified by ‘key’. If the key is not found search will be brought on in superspaces, finally evaluating aBlock if the variable cannot be found in any of the superspaces.
Pass each association in the namespace to aBlock
Return the value associated to the variable named as specified by ‘key’. If the key is not found search will be brought on in superspaces, finally evaluating aBlock if the variable cannot be found in any of the superspaces.
If aKey is absent from the receiver and all its superspaces, answer nil. Else, evaluate aBlock passing the associated value and answer the result of the invocation
Pass each value in the namespace to aBlock
Answer whether the receiver or any of its superspaces contain the given key
Pass to aBlock each of the receiver’s keys and values, in two separate parameters
Pass to aBlock each of the receiver’s keys
Assign newValue to the variable named as specified by ‘key’. This method won’t define a new variable; instead if the key is not found it will search in superspaces and evaluate aBlock if it is not found. Answer newValue.
Answer the number of keys in the receiver and each of its superspaces
Previous: Namespace-overrides for superspaces, Up: Namespace [Index]
Answer Smalltalk code compiling to the receiver when the current namespace is aNamespace
Print on aStream some Smalltalk code compiling to the receiver when the current namespace is aNamespace
Store Smalltalk code compiling to the receiver
Next: NetClients.URL, Previous: Namespace, Up: Base classes [Index]
This class publishes methods to download files from the Internet.
• NetClients.URIResolver class-api: | (class) | |
• NetClients.URIResolver class-instance creation: | (class) |
Always raise an error, as this method is not supported without loading the additional NetClients package.
Always evaluate aBlock and answer the result if the additional NetClients package is not loaded. If it is, instead, return a WebEntity with the contents of the resource specified by anURI, and only evaluate the block if loading the resource fails.
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.
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 result of the evaluation.
Previous: NetClients.URIResolver class-api, Up: NetClients.URIResolver [Index]
Answer a new URIResolver that will do its best to fetch the data for anURL from the Internet.
Next: Notification, Previous: NetClients.URIResolver, Up: Base classes [Index]
Copyright (c) Kazuki Yasumatsu, 1995. All rights reserved.
• NetClients.URL class-encoding URLs: | (class) | |
• NetClients.URL class-instance creation: | (class) | |
• NetClients.URL-accessing: | (instance) | |
• NetClients.URL-comparing: | (instance) | |
• NetClients.URL-copying: | (instance) | |
• NetClients.URL-initialize-release: | (instance) | |
• NetClients.URL-printing: | (instance) | |
• NetClients.URL-still unclassified: | (instance) | |
• NetClients.URL-testing: | (instance) | |
• NetClients.URL-utilities: | (instance) |
Next: NetClients.URL class-instance creation, Up: NetClients.URL [Index]
Decode a text/x-www-form-urlencoded String into a text/plain String.
Encode a text/plain into a text/x-www-form-urlencoded String (those things with lots of % in them).
Initialize the receiver’s class variables.
Next: NetClients.URL-accessing, Previous: NetClients.URL class-encoding URLs, Up: NetClients.URL [Index]
Parse the given URL and answer an URL object based on it.
Answer a ’blank’ URL.
Answer an URL object made from all the parts passed as arguments.
Answer an URL object made from all the parts passed as arguments.
Answer an URL object made from all the parts passed as arguments.
Answer an URL object made from all the parts passed as arguments.
Next: NetClients.URL-comparing, Previous: NetClients.URL class-instance creation, Up: NetClients.URL [Index]
Answer the full request string corresponding to the URL. This is how the URL would be printed in the address bar of a web browser, except that the query data is printed even if it is to be sent through a POST request.
Convert the form fields to a Dictionary, answer nil if no question mark is found in the URL.
Answer the file part of the URL, decoding it from x-www-form-urlencoded format.
Answer the fragment part of the URL, decoding it from x-www-form-urlencoded format.
Answer the fragment part of the URL, leaving it in x-www-form-urlencoded format.
Set the fragment part of the URL, which should be in x-www-form-urlencoded format.
Answer the full request string corresponding to the URL. This is how the URL would be printed in the address bar of a web browser, except that the query data is printed even if it is to be sent through a POST request.
Answer whether the URL has a query part but is actually for an HTTP POST request and not really part of the URL (as it would be for the HTTP GET request).
Set whether the query part of the URL is actually the data for an HTTP POST request and not really part of the URL (as it would be for the HTTP GET request).
Answer the host part of the URL.
Set the host part of the URL to aString.
If the receiver is an nntp url, return the news group.
Answer the password part of the URL.
Set the password part of the URL to aString.
Answer the path part of the URL.
Set the path part of the URL to aString.
Answer the port number part of the URL.
Set the port number part of the URL to anInteger.
Answer whether the URL has a query part and it is meant for an HTTP POST request, answer it. Else answer nil.
Associate to the URL some data that is meant to be sent through an HTTP POST request, answer it.
Answer the query data associated to the URL.
Set the query data associated to the URL to aString.
Answer the URL as it would be sent in an HTTP stream (that is, the path and the query data, the latter only if it is to be sent with an HTTP POST request).
Answer the URL’s scheme.
Set the URL’s scheme to be aString.
Answer the username part of the URL.
Set the username part of the URL to aString.
Next: NetClients.URL-copying, Previous: NetClients.URL-accessing, Up: NetClients.URL [Index]
Answer whether the two URLs are equal. The file and anchor are 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.
Answer an hash value for the receiver
Next: NetClients.URL-initialize-release, Previous: NetClients.URL-comparing, Up: NetClients.URL [Index]
Answer a copy of the receiver where the fragment and query parts of the URL have been cleared.
Answer a copy of the receiver where the fragment parts of the URL has been cleared.
All the variables are copied when an URL object is copied.
Next: NetClients.URL-printing, Previous: NetClients.URL-copying, Up: NetClients.URL [Index]
Initialize the object to a consistent state.
Next: NetClients.URL-still unclassified, Previous: NetClients.URL-initialize-release, Up: NetClients.URL [Index]
Print a representation of the URL on the given stream.
Next: NetClients.URL-testing, Previous: NetClients.URL-printing, Up: NetClients.URL [Index]
Not commented.
Not commented.
Not commented.
Next: NetClients.URL-utilities, Previous: NetClients.URL-still unclassified, Up: NetClients.URL [Index]
Answer whether the URL is cacheable. The current implementation considers file URLs not to be cacheable, and everything else to be.
Answer whether the URL points to a particular fragment (anchor) of the resource.
Answer whether the URL includes query arguments to be submitted when retrieving the resource.
Answer whether the URL is a file URL.
Answer whether the URL only includes the name of a particular fragment (anchor) of the resource to which it refers.
Previous: NetClients.URL-testing, Up: NetClients.URL [Index]
Construct an absolute URL based on the relative URL anURL and the base path represented by the receiver
Next: NullProxy, Previous: NetClients.URL, Up: Base classes [Index]
Notification represents a resumable, exceptional yet non-erroneous, situation. Signaling a notification in absence of an handler simply returns nil.
• Notification-exception description: | (instance) |
Up: Notification [Index]
Do the default action for notifications, which is to resume execution of the context which signaled the exception.
Answer a textual description of the exception.
Answer true. Notification exceptions are by default resumable.
Next: NullValueHolder, Previous: Notification, Up: Base classes [Index]
I am a proxy that does no special processing on the object to be saved. I can be used to disable proxies for particular subclasses. My subclasses add to the stored information, but share the fact that the format is about the same as that of #dump: without a proxy.
• NullProxy class-instance creation: | (class) | |
• NullProxy-accessing: | (instance) |
Next: NullProxy-accessing, Up: NullProxy [Index]
Reload the object stored in anObjectDumper
Previous: NullProxy class-instance creation, Up: NullProxy [Index]
Dump the