]> gitweb.factorcode.org Git - factor.git/blob - basis/inspector/inspector-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / inspector / inspector-docs.factor
1 USING: help.markup help.syntax kernel classes io io.styles mirrors
2 inspector.private ;
3 IN: inspector
4
5 ARTICLE: "inspector" "The inspector"
6 "The inspector displays a tabular view of an object and adds navigation and editing features. Inspector words are found in the " { $vocab-link "inspector" } " vocabulary."
7 $nl
8 "Starting the inspector:"
9 { $subsection inspect }
10 "The inspector supports a number of commands which operate on the most recently inspected object:"
11 { $subsection &push }
12 { $subsection &back }
13 { $subsection &at }
14 { $subsection &put }
15 { $subsection &add }
16 { $subsection &rename }
17 { $subsection &delete }
18 "A variable holding the current object:"
19 { $subsection me }
20 "A description of an object can be printed without starting the inspector:"
21 { $subsection describe } ;
22
23 ABOUT: "inspector"
24
25 HELP: describe
26 { $values { "obj" object } }
27 { $description "Print a tabular overview of the object."
28 $nl
29 "For sequences and hashtables, this outputs the entries of the collection. For all other object types, slot names and values are shown." }
30 { $examples { $code "global describe" } } ;
31
32 HELP: inspector-stack
33 { $var-description "If the inspector is running, this variable holds previously-inspected objects." } ;
34
35 HELP: &push
36 { $values { "obj" object } } 
37 { $description "If the inspector is running, outputs the object currently being inspected." } ;
38
39 HELP: inspector
40 { $values { "obj" object } }
41 { $description "Starts a new inspector and prints a brief help message. If an inspector is already running, this starts a nested inspector. An alternative word that reuses the current inspector instance is " { $link inspect } "." } ;
42
43 HELP: inspect
44 { $values { "obj" object } }
45 { $description "If an inspector is already running, displays the slots of the object in the current inspector. If an inspector is not running, starts a new inspector." } ;
46
47 HELP: &at
48 { $values { "n" "a non-negative integer" } }
49 { $description "Inspects the " { $snippet "n" } "th slot of the current object. Use " { $link &back } " to return." } ;
50
51 HELP: &put
52 { $values { "value" object } { "n" "a non-negative integer" } }
53 { $description "Sets the " { $snippet "n" } "th slot of the current object to the given value." }
54 { $errors "Throws an error if the object does not support this operation." } ;
55
56 HELP: &add
57 { $values { "value" object } { "key" object } }
58 { $description "Adds a key/value pair to the current object." }
59 { $errors "Throws an error if the object does not support this operation." } ;
60
61 HELP: &delete
62 { $values { "n" "a non-negative integer" } }
63 { $description "Deletes the " { $snippet "n" } "th slot from the current object." }
64 { $errors "Throws an error if the object does not support this operation." } ;
65
66 HELP: &rename
67 { $values { "key" object } { "n" "a non-negative integer" } }
68 { $description "Changes the key of the " { $snippet "n" } "th slot of the current object." }
69 { $errors "Throws an error if the object does not support this operation." } ;
70
71 HELP: &back
72 { $description "Returns to the previously-inspected object." } ;
73
74 { &back &at &put &add &delete } related-words
75
76 HELP: me
77 { $var-description "The currently inspected object." } ;