]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/annotations/annotations-docs.factor
Create basis vocab root
[factor.git] / basis / tools / annotations / annotations-docs.factor
1 USING: help.markup help.syntax words parser ;
2 IN: tools.annotations
3
4 ARTICLE: "tools.annotations" "Word annotations"
5 "The word annotation feature modifies word definitions to add debugging code. You can restore the old definition by calling " { $link reset } " on the word in question."
6 { $subsection watch }
7 { $subsection breakpoint }
8 { $subsection breakpoint-if }
9 "All of the above words are implemented using a single combinator which applies a quotation to a word definition to yield a new definition:"
10 { $subsection annotate } ;
11
12 ABOUT: "tools.annotations"
13
14 HELP: annotate
15 { $values { "word" "a word" } { "quot" "a quotation with stack effect " { $snippet "( word def -- def )" } } }
16 { $description "Changes a word definition to the result of applying a quotation to the old definition." }
17 { $notes "This word is used to implement " { $link watch } "." } ;
18
19 HELP: watch
20 { $values { "word" word } }
21 { $description "Annotates a word definition to print the data stack on entry and exit." } ;
22
23 HELP: breakpoint
24 { $values { "word" word } }
25 { $description "Annotates a word definition to enter the single stepper when executed." } ;
26
27 HELP: breakpoint-if
28 { $values { "quot" "a quotation with stack effect" { $snippet "( -- ? )" } } { "word" word } }
29 { $description "Annotates a word definition to enter the single stepper if the quotation yields true." } ;