slot-spec
Factor handbook » The language » Objects » Low-level slot operations

Next:reader-word ( name -- word )


Vocabulary
slots

Class description
A slot specification. The "slots" word property of builtin-class and tuple-class instances holds sequences of slot specifications.

The slots of a slot specification are:
name - a string identifying the slot.
offset - an integer offset specifying where the slot value is stored inside instances of the relevant class. This is an implementation detail.
class - a class declaring the set of possible values for the slot.
initial - an initial value for the slot.
read-only - a boolean indicating whether the slot is read only or not. Read only slots do not have a writer method associated with them.


Definition

TUPLE: slot-spec name offset class initial read-only ;


Methods