Words
Factor handbook » The language

Prev:Collections
Next:Shuffle words


Words are the Factor equivalent of functions or procedures in other languages. Words are essentially named Quotations.

There are two ways of creating word definitions:
• using parsing words at parse time.
• using defining words at run time.

The latter is a more dynamic feature that can be used to implement code generation and such, and in fact parse time defining words are implemented in terms of run time defining words.

Types of words:
Image Colon definitions
Image Symbols
Image Word aliasing
Image Constants
Image Primitives

Advanced topics:
Image Deferred words and mutual recursion
Image Compiler declarations
Image Word introspection
Image Word properties

See also
Vocabularies, Vocabulary loader, Definitions, Printing definitions