]> gitweb.factorcode.org Git - factor.git/blob - basis/see/see-docs.factor
Update actions, because Node.js 16 actions are deprecated, to Node.js 20
[factor.git] / basis / see / see-docs.factor
1 USING: classes definitions generic help.markup help.syntax
2 prettyprint.sections sequences strings words ;
3 IN: see
4
5 HELP: synopsis
6 { $values { "defspec" "a definition specifier" } { "str" string } }
7 { $contract "Prettyprints the prologue of a definition." } ;
8
9 HELP: synopsis*
10 { $values { "defspec" "a definition specifier" } }
11 { $contract "Adds sections to the current block corresponding to a the prologue of a definition, in source code-like form." }
12 { $notes "This word should only be called from inside the " { $link with-pprint } " combinator. Client code should call " { $link synopsis } " instead." } ;
13
14 HELP: see
15 { $values { "defspec" "a definition specifier" } }
16 { $contract "Prettyprints a definition." }
17 { $examples
18   "A word:" { $code "\\ append see" }
19   "A method:" { $code "USE: arrays" "M\\ array length see" }
20   "A help article:" { $code "USE: help.topics" "\"help\" >link see" }
21 } ;
22
23 HELP: see-methods
24 { $values { "word" "a " { $link generic } " or a " { $link class } } }
25 { $contract "Prettyprints the methods defined on a generic word or class." } ;
26
27 HELP: definer
28 { $values { "defspec" "a definition specifier" } { "start" word } { "end" { $maybe word } } }
29 { $contract "Outputs the parsing words which delimit the definition." }
30 { $examples
31     { $example "USING: definitions prettyprint ;"
32                "IN: scratchpad"
33                ": foo ( -- ) ; \\ foo definer . ."
34                ";\nPOSTPONE: :"
35     }
36     { $example "USING: definitions prettyprint ;"
37                "IN: scratchpad"
38                "SYMBOL: foo \\ foo definer . ."
39                "f\nPOSTPONE: SYMBOL:"
40     }
41 }
42 { $notes "This word is used in the implementation of " { $link see } "." } ;
43
44 HELP: definition
45 { $values { "defspec" "a definition specifier" } { "seq" sequence } }
46 { $contract "Outputs the body of a definition." }
47 { $examples
48     { $example "USING: definitions math prettyprint ;" "\\ sq definition ." "[ dup * ]" }
49 }
50 { $notes "This word is used in the implementation of " { $link see } "." } ;
51
52 ARTICLE: "see" "Printing definitions"
53 "The " { $vocab-link "see" } " vocabulary implements support for printing out " { $link "definitions" } " in the image."
54 $nl
55 "Printing a definition:"
56 { $subsections see }
57 "Printing the methods defined on a generic word or class (see " { $link "objects" } "):"
58 { $subsections see-methods }
59 "Definition specifiers implementing the " { $link "definition-protocol" } " should also implement the " { $emphasis "see protocol" } ":"
60 { $subsections
61     see*
62     synopsis*
63 } ;
64
65 ABOUT: "see"