All
class does not serve a purpose. It is the stateless All
instance which is inherited by both the State
class and instance,
and, supposedly, by all objects not inheriting from State
.
const TRUE = !0;
const FALSE = !TRUE;
const YES = TRUE;
TRUE
.
const NO = FALSE;
FALSE
.
String description;
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;
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;
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.
int hash;
self
.
Two distinct objects considering themselves equal
should also return
the same hash
value.
int hashq;
hash
, this performs the same function.
id (self) self;
deferred OutputStream write OutputStream s;
A default implementation of this method is provided by the State
class and instance.
deferred boolean classp;
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;
TRUE
iff the class of the receiving object is a subclass of
the class
.
deferred class (id) kind;
boolean respondsTo selector sel;
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 (self) forwardDelegate selector sel;
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;
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;
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;
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;
perform with
but create a new thread for the performance.
Return the newly created thread or nil
upon failure.
boolean invocationp;
YES
iff the receiving object is an Invocation
. Only
Invocation
objects are supposed to return YES
.
dynamic valueOfVariableNamed ByteString name;
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;
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.
int typeOfVariableNamed String name from Extension ext pre [[self stateExtensions] memq ext] != nil;
name
as introduced by the
extension ext
. This returns one of the TYPEDESC_*
Constants
.
_builtin_.Any valueOfVariableNamed String name from Extension ext pre [[self stateExtensions] memq ext] != nil;
name
as introduced by
the extension ext
.
Extension extensionNamed String name inherited: boolean check_supers = NO;
Extension
object of this object for the extension named
name
. If name == nil
, the main extension is returned.
Indexed stateExtensions;
void throw dynamic value;
value
. If the value
is void
, the default value
for the type to be returned by the catch is returned.
void preconditionFailed selector sel;
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;
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;
sel
not yet having been implemented by the
receiving object. This raises an unimplemented
SelectorCondition
.
protected void shouldNotImplement selector sel;
selector
sel
being invokable for the receiving object, that object thinks
otherwise.
protected void subclassResponsibility selector sel;
sel
, but actually the implementation of the method by the object
thinks it should be implemented by a subclass.
boolean consp;
TRUE
iff the receiving object is a Cons
cell. The
default implementation returns NO
.
OutputStream writeListElement OutputStream s;
s
. The default implementation writes itself
as a dotted cdr at the end of the list.
deferred boolean persistent-coding-p;
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.
pointer address;
boolean coding-permanent-object-p;
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
Selector
s return TRUE
for this; the default implementation returns
FALSE
.
void dump (boolean, boolean) (allow_self, allow_simple) level int level;
void dump;
void dump (boolean, boolean)
, allowing self/simple printing
and doing infinite recursion.
boolean dump_simple_p;
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
.
boolean dump_self_p;
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;
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;
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;
dump
.
boolean gc_dead_p;
YES
iff the receiving object has not yet been marked alive
during the current run of the garbage collector. Class objects are
never dead.
void gc_mark;
This method is invoked during Garbage Collection. During GC, the
Runtime
library is running in panic mode. If anything goed wrong,
for instance a condition is signaled or raised, the program will
abort. Moral: be careful during garbage collection.