1 USING: help.markup help.syntax words definitions prettyprint
2 tools.crossref.private math quotations assocs kernel ;
5 ARTICLE: "tools.crossref" "Definition cross referencing"
6 "Definitions can answer a sequence of definitions they directly depend on:"
8 "An inverted index of the above:"
9 { $subsections get-crossref }
15 "Tools for interactive use:"
21 { $see-also "definitions" "words" "see" } ;
23 ABOUT: "tools.crossref"
26 { $values { "defspec" "a definition specifier" } { "seq" "a sequence of definition specifiers" } }
27 { $description "Outputs a sequence of definitions directory called by the given definition." }
28 { $notes "The sequence might include the definition itself, if it is a recursive word." }
30 "We can ask the " { $link sq } " word to produce a list of words it calls:"
31 { $unchecked-example "\ sq uses ." "{ dup * }" }
35 { $var-description "A graph whose vertices are definition specifiers and edges are usages. See " { $link "graphs" } ". This variable is reset to " { $link f } " every time a definition is added or removed. Call " { $link get-crossref } " to lazily construct the graph instead of using this variable directly." } ;
38 { $values { "crossref" assoc } }
39 { $description "Outputs the cross-referencing index, mapping definitions to usages, building it first if necessary." }
40 { $notes "This word is used to implement " { $link usage } " and " { $link usage. } "." } ;
43 { $values { "defspec" "a definition specifier" } }
44 { $description "Adds a vertex representing this definition, along with edges representing dependencies to the " { $link crossref } " graph." }
48 { $values { "defspec" "a definition specifier" } { "seq" "a sequence of definition specifiers" } }
49 { $description "Outputs a sequence of definitions that directly call the given definition." }
50 { $notes "The sequence might include the definition itself, if it is a recursive word." } ;
53 { $values { "word" "a word" } }
54 { $description "Prints an list of all callers of a word. This may include the word itself, if it is recursive." }
55 { $examples { $code "\\ reverse usage." } } ;
58 { $values { "obj" object } { "assoc" "an assoc with words as keys" } }
59 { $description "Outputs a set of words referenced by the quotation and any quotations it contains." } ;
61 { usage usage. } related-words