Definitions - Factor Documentation (original) (raw)
A definition is an artifact read from a source file. Words for working with definitions are found in the definitions vocabulary.
Definitions are defined using parsing words. Examples of definitions together with their defining parsing words are words (:), methods (M:), and vocabularies (IN:).
All definitions share some common traits:
• | There is a word to list all definitions of a given type |
---|---|
• | There is a parsing word for creating new definitions |
• | There is an ordinary word which is the runtime equivalent of the parsing word, for introspection |
• | Instances of the definition may be introspected and modified with the definition protocol |
For every source file loaded into the system, a list of definitions is maintained. Pathname objects implement the definition protocol, acting over the definitions their source files contain. See Source files for details. Definition protocol
Definition sanity checking
Compilation units
A parsing word to remove definitions: FORGET:
See also
Printing definitions, The parser, Source files, Words, Generic words and methods, Help system implementation