]> gitweb.factorcode.org Git - factor.git/blob - basis/inspector/inspector-docs.factor
calendar.format: make duration>human-readable more human readable
[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 { $subsections inspect }
10 "The inspector supports a number of commands which operate on the most recently inspected object:"
11 { $subsections
12     &push
13     &back
14     &at
15     &put
16     &add
17     &rename
18     &delete
19 }
20 "A variable holding the current object:"
21 { $subsections me }
22 "A description of an object can be printed without starting the inspector:"
23 { $subsections describe } ;
24
25 ABOUT: "inspector"
26
27 HELP: describe
28 { $values { "obj" object } }
29 { $description "Print a tabular overview of the object."
30 $nl
31 "For sequences and hashtables, this outputs the entries of the collection. For all other object types, slot names and values are shown." }
32 { $examples { $code "global describe" } } ;
33
34 HELP: inspector-stack
35 { $var-description "If the inspector is running, this variable holds previously-inspected objects." } ;
36
37 HELP: &push
38 { $values { "obj" object } }
39 { $description "If the inspector is running, outputs the object currently being inspected." } ;
40
41 HELP: inspector
42 { $values { "obj" object } }
43 { $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 } "." } ;
44
45 HELP: inspect
46 { $values { "obj" object } }
47 { $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." } ;
48
49 HELP: &at
50 { $values { "n" "a non-negative integer" } }
51 { $description "Inspects the " { $snippet "n" } "th slot of the current object. Use " { $link &back } " to return." } ;
52
53 HELP: &put
54 { $values { "value" object } { "n" "a non-negative integer" } }
55 { $description "Sets the " { $snippet "n" } "th slot of the current object to the given value." }
56 { $errors "Throws an error if the object does not support this operation." } ;
57
58 HELP: &add
59 { $values { "value" object } { "key" object } }
60 { $description "Adds a key/value pair to the current object." }
61 { $errors "Throws an error if the object does not support this operation." } ;
62
63 HELP: &delete
64 { $values { "n" "a non-negative integer" } }
65 { $description "Deletes the " { $snippet "n" } "th slot from the current object." }
66 { $errors "Throws an error if the object does not support this operation." } ;
67
68 HELP: &rename
69 { $values { "key" object } { "n" "a non-negative integer" } }
70 { $description "Changes the key of the " { $snippet "n" } "th slot of the current object." }
71 { $errors "Throws an error if the object does not support this operation." } ;
72
73 HELP: &back
74 { $description "Returns to the previously-inspected object." } ;
75
76 { &back &at &put &add &delete } related-words
77
78 HELP: me
79 { $var-description "The currently inspected object." } ;