]> gitweb.factorcode.org Git - factor.git/blob - core/words/symbol/symbol-docs.factor
Merge qualified, alias, symbols, constants into core
[factor.git] / core / words / symbol / symbol-docs.factor
1 USING: help.syntax help.markup words.symbol words compiler.units ;
2 IN: words.symbol
3
4 HELP: symbol
5 { $description "The class of symbols created by " { $link POSTPONE: SYMBOL: } "." } ;
6
7 HELP: define-symbol
8 { $values { "word" word } }
9 { $description "Defines the word to push itself on the stack when executed. This is the run time equivalent of " { $link POSTPONE: SYMBOL: } "." }
10 { $notes "This word must be called from inside " { $link with-compilation-unit } "." }
11 { $side-effects "word" } ;
12
13 ARTICLE: "words.symbol" "Symbols"
14 "A symbol pushes itself on the stack when executed. By convention, symbols are used as variable names (" { $link "namespaces" } ")."
15 { $subsection symbol }
16 { $subsection symbol? }
17 "Defining symbols at parse time:"
18 { $subsection POSTPONE: SYMBOL: }
19 { $subsection POSTPONE: SYMBOLS: }
20 "Defining symbols at run time:"
21 { $subsection define-symbol }
22 "Symbols are just compound definitions in disguise. The following two lines are equivalent:"
23 { $code
24     "SYMBOL: foo"
25     ": foo ( -- value ) \\ foo ;"
26 } ;
27
28 ABOUT: "words.symbol"