1 USING: help.markup help.syntax strings definitions generic words classes ;
2 FROM: prettyprint.sections => with-pprint ;
6 { $values { "defspec" "a definition specifier" } { "str" string } }
7 { $contract "Prettyprints the prologue of a definition." } ;
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." } ;
15 { $values { "defspec" "a definition specifier" } }
16 { $contract "Prettyprints a definition." }
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" }
24 { $values { "word" "a " { $link generic } " or a " { $link class } } }
25 { $contract "Prettyprints the methods defined on a generic word or class." } ;
28 { $values { "defspec" "a definition specifier" } { "start" word } { "end" { $maybe word } } }
29 { $contract "Outputs the parsing words which delimit the definition." }
31 { $example "USING: definitions prettyprint ;"
33 ": foo ( -- ) ; \\ foo definer . ."
36 { $example "USING: definitions prettyprint ;"
38 "SYMBOL: foo \\ foo definer . ."
39 "f\nPOSTPONE: SYMBOL:"
42 { $notes "This word is used in the implementation of " { $link see } "." } ;
45 { $values { "defspec" "a definition specifier" } { "seq" "a sequence" } }
46 { $contract "Outputs the body of a definition." }
48 { $example "USING: definitions math prettyprint ;" "\\ sq definition ." "[ dup * ]" }
50 { $notes "This word is used in the implementation of " { $link see } "." } ;
52 ARTICLE: "see" "Printing definitions"
53 "The " { $vocab-link "see" } " vocabulary implements support for printing out " { $link "definitions" } " in the image."
55 "Printing a definition:"
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" } ":"