Mirrors
Factor handbook » The language » Objects

Prev:Delegation
Next:Low-level slot operations


The mirrors vocabulary defines data types which present an object's slots and slot values as an associative structure. This enables idioms such as iteration over all slots in a tuple, or editing of tuples, sequences and assocs in a generic fashion. This functionality is used by developer tools and meta-programming utilities.

A mirror provides such a view of a tuple:
mirror

<mirror> ( object -- mirror )


Utility word used by developer tools which inspect objects:
make-mirror ( obj -- assoc )


See also
Low-level slot operations