]> gitweb.factorcode.org Git - factor.git/blob - core/words/symbol/symbol-docs.factor
docs: replace $description with $class-description for class words
[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 { $class-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 { $subsections
16     symbol
17     symbol?
18 }
19 "Defining symbols at parse time:"
20 { $subsections
21     POSTPONE: SYMBOL:
22     POSTPONE: SYMBOLS:
23 }
24 "Defining symbols at run time:"
25 { $subsections define-symbol }
26 "Symbols are just compound definitions in disguise. The following two lines are equivalent:"
27 { $code
28     "SYMBOL: foo"
29     ": foo ( -- value ) \\ foo ;"
30 } ;
31
32 ABOUT: "words.symbol"