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”.
Alphabetic list:
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
CShort
CSmalltalk
CUChar
CByte
CBoolean
CUInt
CULong
CUShort
ContextPart
BlockContext
MethodContext
Continuation
CType
CPtrCType
CArrayCType
CScalarCType
CStringCType
Delay
Directory
DLD
DumperProxy
AlternativeObjectProxy
NullProxy
VersionableObjectProxy
PluggableProxy
SingletonProxy
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
Kernel.TrappableEvent
ExceptionSet
Link
Process
CallinProcess
SymLink
Magnitude
Character
UnicodeCharacter
Date
DateTime
LookupKey
Association
HomedAssociation
VariableBinding
DeferredVariableBinding
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
Signal
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.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
UndefinedObject
ValueAdaptor
NullValueHolder
PluggableAdaptor
DelayedAdaptor
ValueHolder
Promise
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'.
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'.
Do not send this in user code; use #compile: or related methods instead.
Do not send this in user code; use #compile:ifError: or related methods instead.
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.
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:.
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.
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.
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'
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.
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.
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.
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.
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.
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.
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.
Internally, Exception and every subclass of it hold onto a CoreException, so the two mechanisms are actually interchangeable.