The tom unit is that standard TOM library.
The boolean truth.
The boolean non-truth.
An alternative name for TRUE.
An alternative name for FALSE.
Return a string informally describing this object.
This returns the result of having the receiver write itself into a new String which is subsequently returned.
boolean (result) eq All other post self == other == result;
The selector equivalent of `==', i.e. the returned result is TRUE iff the receiving object and the other object are the same object.
The postcondition states that this method is not overridable.
boolean (result) equal id other post self == other -> result;
Return TRUE when the receiving object considers itself equal to the other object. For instance, two Number objects holding the same value will return TRUE.
The receiving object should be able to assume the other object is of the same kind, or at least shares with it a common superclass, as in the case of, for instance, CharString and ByteString which are both subclasses of String and can compare with each other.
As stated by the postcondition, an object must be equal to itself. This knowledge may be used by a caller to prevent a method invocation.
Return a hash value for the receiving object. The default implementation returns some bit pattern deduced from self.
Two distinct objects considering themselves equal should also return the same hash value.
Hash the address of the receiving object. For classes not redefining hash, this performs the same function.
id (self) self;
Return the receiving object.
deferred OutputStream write OutputStream s;
All objects, even classes, know how to (descriptively) write themselves to a stream.
A default implementation of this method is provided by the State class and instance.
deferred boolean classp;
Return TRUE iff the receiving object is a class object. An implementation for this method is provided by the State class and instance.
boolean isKindOf class (State) a_class;
Return TRUE iff the class of the receiving object is a subclass of the class.
deferred class (id) kind;
Return the class of the receiving object.
boolean respondsTo selector sel;
Return YES iff the selector sel can be safely sent to the receiver. The default implementation only checks whether the receiving object provides a direct implementation of the sel; any checking through an alternative forwardDelegate should be performed by the object itself.
All forwardDelegate selector sel;
Return an object of which the method indicated by the selector sel should be invoked. This method is invoked if the receiving object does not directly respond to sel. The default implementation returns self. The object returned could be a delegate which is to act upon behalf of the receiving object for the intended call of the selector sel.
InvocationResult forwardInvocation Invocation invocation;
Return the result of forwarding the invocation, for example by firing it at an appropriate object. The default implementation raises a program-condition SelectorCondition.
dynamic perform selector sel : Array arguments = nil;
Send the receiving object a message with the selector sel and the, possibly unboxed, arguments. The number of elements of arguments must match the number of arguments dictated by the selector.
Unboxing the arguments means that if an int argument is needed, the int at int method will be used to retrieve the argument from the arguments, possibly resulting in the object retrieved being asked for its intValue.
dynamic perform selector sel with dynamic arguments;
Send the receiving object a message with the selector sel and the arguments. The number of arguments must match the number of arguments dictated by the selector.
If the selector sel accepts more than one argument, arguments should be a tuple. The tuple-ization of the actual arguments to the selector sel and the elements of the arguments tuple is ignored.
Thread performInThread selector sel with dynamic arguments;
Like perform with but create a new thread for the performance. Return the newly created thread or nil upon failure.
dynamic valueOfVariableNamed ByteString name;
Retrieve the value of the variable with the indicated name. If there is more than one variable with the same name and expected return type, the first is returned.
void setValue dynamic value ofVariableNamed ByteString name;
Set the value of the variable named name in the receiving object to the value. It is an error if the type of the value does not exactly match the actual type of the variable: no conversion is performed.
Return the type of the variable named name as introduced by the extension ext. This returns one of the TYPEDESC_* Constants.
Return the boxed value of the variable named name as introduced by the extension ext.
Return the Extension object of this object for the extension named name. If name == nil, the main extension is returned.
Return an array of the extensions of the receiving object, not including the extensions introduced by superclasses.
Return an array of all extensions of the receiving object. This includes the extensions introduced by superclasses.
Return an array of state introducing extensions of the receiving object. This includes the extensions introduced by superclasses.
void throw dynamic value;
Throw execution to the catch specified for the receiving object, returning the value. If the value is void, the default value for the type to be returned by the catch is returned.
void preconditionFailed selector sel;
This method is invoked for a failed precondition of a method invocation of the receiving object. The method is identified by the selector sel. The default implementation raises a condition-condition SelectorCondition.
Method precondition checking is enabled is the option :cc-pre is provided on the program's command line. The code for precondition checking is normally compiled in by the compiler. This code is omitted by passing the -fno-checks or -fno-pre-checks option to the compiler.
void postconditionFailed selector sel;
This method is invoked for a failed postcondition of a method invocation of the receiving object. The method is identified by the selector sel. The default implementation raises a condition-condition SelectorCondition.
Similar to precondition checking, postcondition checking is enabled by the :cc-post option on the command line of this program and not providing -fno-checks or -fno-post-checks to the compiler.
protected void unimplemented selector sel message: String message = nil;
Moan about the selector sel not yet having been implemented by the receiving object. This raises an unimplemented SelectorCondition.
protected void shouldNotImplement selector sel;
Contrary to what the inheritance tells you about the selector sel being invokable for the receiving object, that object thinks otherwise.
protected void subclassResponsibility selector sel;
Moan about the receiving object defining a method for the selector sel, but actually the implementation of the method by the object thinks it should be implemented by a subclass.
Return TRUE iff the receiving object is a Cons cell. The default implementation returns NO.
OutputStream writeListElement OutputStream s;
Finish outputing the list, of which the receiving object is the tail, to the stream s. The default implementation writes itself as a dotted cdr at the end of the list.
deferred boolean persistent-coding-p;
Return YES iff the receiving object is a persistent object. This is significant for distributed objects, where class objects and Selector instances must be persistent across different invocations.
Return the address of the receiving object as a pointer. This is here solely to be able to print the address of objects, for debugging purposes.
Return YES if the receiving object should be maintained in the permanent object store when coding. This does not matter for archiving; it makes a difference for DO. Class objects and Selectors return TRUE for this; the default implementation returns FALSE.
void dump (boolean, boolean) (allow_self, allow_simple) level int level;
Dump the graph of which the receiving object is the root to stderr.
Like void dump (boolean, boolean), allowing self/simple printing and doing infinite recursion.
Return TRUE iff the receiving object can be dumped simply. This will be true for class objects, strings, numbers, etc. This method is overridden by dump_self_p. The default implementation returns FALSE.
Return TRUE iff the receiving object wants to dump itself instead of having its variables scrutinized. This is used by collection objects and others which employ pointer typed variables. The default implementation returns FALSE.
OutputStream dump_simple OutputStream s;
Dump the receiving object to the stream s, simply. This is only ever invoked if the object returns YES for dump_simple_p. The default implementation simply prints self to the stream.
protected void dumpSelf MutableKeyed done indent MutableByteString prefix simple boolean allow_simple level int level to OutputStream s;
Have the receiving object dump itself. Only ever invoked if it returns TRUE for dump_self_p. The default implementation invokes shouldNotImplement.
deferred protected void dump MutableKeyed done indent MutableByteString prefix simple boolean allow_simple level int level to OutputStream s;
Hard worker for dump.
Return YES iff the receiving object has not yet been marked alive during the current run of the garbage collector. Class objects are never dead.
Mark the receiving object as being alive. This method is only needed by the container garbage collection scheme.
This method is invoked during Garbage Collection. During GC, the Runtime library is running in panic mode. If anything goes wrong, for instance a condition is signaled or raised, the program will abort. Moral: be careful during garbage collection.