Various conventions are used throughout the Factor documentation and source code.
Glossary of termsCommon terminology and abbreviations used throughout Factor and its documentation:
Term | Definition |
alist | an association list; see Association lists |
assoc | an associative mapping; see Associative mapping operations |
associative mapping | an object whose class implements the Associative mapping protocol |
boolean | t or f |
class | a set of objects identified by a class word together with a discriminating predicate. See Classes |
combinator | a word taking a quotation or another word as input; a higher-order function. See Combinators |
definition specifier | an instance of definition which implements the Definition protocol |
generalized boolean | an object interpreted as a boolean; a value of f denotes false and anything else denotes true |
generic word | a word whose behavior depends on the class of one of its inputs. See Generic words and methods |
method | a specialized behavior of a generic word on a class. See Generic words and methods |
object | any datum which can be identified |
ordering specifier | see Ordering specifiers |
pathname string | an OS-specific pathname which identifies a file |
quotation | an anonymous function; an instance of the quotation class. More generally, instances of the callable class can be used in many places documented to expect quotations |
sequence | a sequence; see Sequence protocol |
slot | a component of an object which can store a value |
stack effect | a pictorial representation of a word's inputs and outputs, for example + ( x y -- z ). See Stack effect declarations |
true value | any object not equal to f |
vocabulary or vocab | a named set of words. See Vocabularies |
vocabulary specifier | a vocab, vocab-link or a string naming a vocabulary |
word | the basic unit of code, analogous to a function or procedure in other programming languages. See Words |
Documentation conventionsFactor documentation consists of two distinct bodies of text. There is a hierarchy of articles, much like this one, and there is word documentation. Help articles reference word documentation, and vice versa, but not every documented word is referenced from some help article.
The browser, completion popups and other tools use a common set of
Definition icons.
Every article has links to parent articles at the top. Explore these if the article you are reading is too specific.
Some generic words have
Description headings, and others have
Contract headings. A distinction is made between words which are not intended to be extended with user-defined methods, and those that are.
Vocabulary naming conventionsA vocabulary name ending in
.private contains words which are either implementation details, unsafe, or both. For example, the
sequences.private vocabulary contains words which access sequence elements without bounds checking (
Unsafe sequence operations ). You should avoid using private words from the Factor library unless absolutely necessary. Similarly, your own code can place words in private vocabularies using
<PRIVATE if you do not want other people using them without good reason.
Word naming conventionsThese conventions are not hard and fast, but are usually a good first step in understanding a word's behavior:
Stack effect conventionsStack effect conventions are documented in
Stack effect declarations.