Next: Setters, Previous: Yasos terms, Up: Yasos [Contents][Index]
(
opname self arg …)
default-bodyDefines a default behavior for data objects which don’t handle the operation opname. The default behavior (for an empty default-body) is to generate an error.
Defines a predicate opname?, usually used for determining the
type of an object, such that (opname? object)
returns #t
if object has an operation opname? and
#f
otherwise.
((name self arg …) body)
…Returns an object (an instance of the object system) with operations.
Invoking (name object arg …)
executes the
body of the object with self bound to object and
with argument(s) arg….
((
ancestor1 init1)
…)
operation …A let
-like form of object
for multiple inheritance. It
returns an object inheriting the behaviour of ancestor1 etc. An
operation will be invoked in an ancestor if the object itself does not
provide such a method. In the case of multiple inherited operations
with the same identity, the operation used is the one found in the first
ancestor in the ancestor list.
Used in an operation definition (of self) to invoke the operation in an ancestor component but maintain the object’s identity. Also known as “send-to-super”.
A default print
operation is provided which is just (format
port obj)
(see Format) for non-instances and prints
obj preceded by ‘#<INSTANCE>’ for instances.
The default method returns the number of elements in obj if it is
a vector, string or list, 2
for a pair, 1
for a character
and by default id an error otherwise. Objects such as collections
(see Collections) may override the default in an obvious way.
Next: Setters, Previous: Yasos terms, Up: Yasos [Contents][Index]