Tuples are user-defined classes composed of named slots. They are the central data type of Factor's object system.
Tuple examplesA parsing word defines tuple classes:
TUPLE:
For each tuple class, several words are defined, the class word, a class predicate, and accessor words for each slot.
The class word is used for defining methods on the tuple class; it has the same name as the tuple class. The predicate is named
name?. Initially, no specific words are defined for constructing new instances of the tuple. Constructors must be defined explicitly, and tuple slots are accessed via automatically-generated accessor words.
Slot accessors
Tuple constructors
Tuple subclassing
Tuple slot declarations
Protocol slots
Tuple introspectionTuple classes can be redefined; this updates existing instances:
Tuple redefinitionTuple literal syntax is documented in
Tuple syntax.