]> gitweb.factorcode.org Git - factor.git/commitdiff
Documentation updates
authorSlava Pestov <slava@shill.internal.stack-effects.com>
Wed, 15 Apr 2009 23:19:35 +0000 (18:19 -0500)
committerSlava Pestov <slava@shill.internal.stack-effects.com>
Wed, 15 Apr 2009 23:19:35 +0000 (18:19 -0500)
13 files changed:
basis/compiler/errors/errors-docs.factor
basis/concurrency/promises/promises-docs.factor
basis/editors/editors-docs.factor
basis/help/cookbook/cookbook.factor
basis/help/handbook/handbook.factor
basis/help/home/home-docs.factor
basis/io/launcher/launcher-docs.factor
basis/tools/errors/errors-docs.factor
basis/tools/test/test-docs.factor
basis/ui/tools/error-list/error-list.factor
basis/ui/tools/inspector/inspector-docs.factor
basis/ui/tools/listener/listener-docs.factor
core/continuations/continuations-docs.factor

index 4d6f014f1b750bf29723771a9d8a393649f3c752..c10e33b7457ed7a993891487be04bf82ae5baeb1 100644 (file)
@@ -14,7 +14,7 @@ $nl
 { $subsection :warnings }
 { $subsection :errors }
 { $subsection :linkage }
-"Compiler warnings and errors are also shown in the " { $link "ui.tools.error-list" } "." ;
+"Compiler warnings and errors are reported using the " { $link "tools.errors" } " mechanism and are shown in the " { $link "ui.tools.error-list" } "." ;
 
 HELP: compiler-error
 { $values { "error" "an error" } { "word" word } }
index 8e160842a93d5f7abb0c907a70723f6bc8d32ff3..69f12d87397aac4d192bc3311e7dc888e991e3e8 100644 (file)
@@ -7,6 +7,10 @@ IN: concurrency.promises
 HELP: promise\r
 { $class-description "The class of write-once promises." } ;\r
 \r
+HELP: <promise>\r
+{ $values { "promise" promise } }\r
+{ $description "Creates a new promise which may be fulfilled by calling " { $link fulfill } "." } ;\r
+\r
 HELP: promise-fulfilled?\r
 { $values { "promise" promise } { "?" "a boolean" } }\r
 { $description "Tests if " { $link fulfill } " has previously been called on the promise, in which case " { $link ?promise } " will return immediately without blocking." } ;\r
index 646582beb0bcf824bbbefd76c8869c2a7d93f026..30611ca699297f0b3b7e736653fb3cd10506adad 100644 (file)
@@ -14,6 +14,9 @@ ARTICLE: "editor" "Editor integration"
 
 ABOUT: "editor"
 
+HELP: edit-hook
+{ $var-description "A quotation with stack effect " { $snippet "( file line -- )" } ". If not set, the " { $link edit } " word throws a condition with restarts for loading one of the sub-vocabularies of the " { $vocab-link "editors" } " vocabulary." } ;
+
 HELP: edit
 { $values { "defspec" "a definition specifier" } }
 { $description "Opens the source file containing the definition using the current " { $link edit-hook } ". See " { $link "editor" } "." }
index 867f3732098b8d855683b0f934624b3160e5651f..9bb76f8d5a4767d73d973451d4c1b420ab7323c8 100644 (file)
@@ -74,7 +74,7 @@ $nl
     "shuffle-words"
     "words"
     "generic"
-    "tools"
+    "handbook-tools-reference"
 } ;
 
 ARTICLE: "cookbook-combinators" "Control flow cookbook"
index b08e04550df5c92772ede47a740870a5985d52fc..ebce042e06054a0d063e304a3e8fb7cdb23f5c1a 100644 (file)
@@ -5,7 +5,7 @@ math system strings sbufs vectors byte-arrays quotations
 io.streams.byte-array classes.builtin parser lexer
 classes.predicate classes.union classes.intersection
 classes.singleton classes.tuple help.vocabs math.parser
-accessors definitions ;
+accessors definitions sets ;
 IN: help.handbook
 
 ARTICLE: "conventions" "Conventions"
@@ -197,28 +197,6 @@ ARTICLE: "io" "Input and output"
 { $subsection "io.ports" }
 { $see-also "destructors" } ;
 
-ARTICLE: "tools" "Developer tools"
-{ $subsection "tools.vocabs" }
-"Exploratory tools:"
-{ $subsection "see" }
-{ $subsection "editor" }
-{ $subsection "listener" }
-{ $subsection "tools.crossref" }
-{ $subsection "inspector" }
-{ $subsection "tools.completion" }
-"Debugging tools:"
-{ $subsection "tools.annotations" }
-{ $subsection "tools.test" }
-{ $subsection "tools.threads" }
-"Performance tools:"
-{ $subsection "tools.memory" }
-{ $subsection "profiling" }
-{ $subsection "timing" }
-{ $subsection "tools.disassembler" }
-"Deployment tools:"
-{ $subsection "tools.deploy" }
-{ $see-also "ui-tools" } ;
-
 ARTICLE: "article-index" "Article index"
 { $index [ articles get keys ] } ;
 
@@ -247,59 +225,79 @@ ARTICLE: "class-index" "Class index"
 
 USING: help.cookbook help.tutorial ;
 
-ARTICLE: "handbook-language-reference" "Language reference"
-"Fundamentals:"
+ARTICLE: "handbook-language-reference" "The language"
+{ $heading "Fundamentals" }
 { $subsection "conventions" }
 { $subsection "syntax" }
 { $subsection "effects" }
 { $subsection "evaluator" }
-"Data types:"
+{ $heading "Data types" }
 { $subsection "booleans" }
 { $subsection "numbers" }
 { $subsection "collections" }
-"Evaluation:"
+{ $heading "Evaluation" }
 { $subsection "words" }
 { $subsection "shuffle-words" }
 { $subsection "combinators" }
 { $subsection "errors" }
 { $subsection "continuations" }
-"Named values:"
+{ $heading "Named values" }
 { $subsection "locals" }
 { $subsection "namespaces" }
 { $subsection "namespaces-global" }
 { $subsection "values" }
-"Abstractions:"
+{ $heading "Abstractions" }
 { $subsection "objects" }
 { $subsection "destructors" }
 { $subsection "macros" }
 { $subsection "fry" }
-"Program organization:"
+{ $heading "Program organization" }
 { $subsection "vocabs.loader" }
 "Vocabularies tagged " { $link T{ vocab-tag { name "extensions" } } } " implement various additional language abstractions." ;
 
-ARTICLE: "handbook-environment-reference" "Environment reference"
-"Parse time and compile time:"
+ARTICLE: "handbook-system-reference" "The implementation"
+{ $heading "Parse time and compile time" }
 { $subsection "parser" }
 { $subsection "definitions" }
 { $subsection "vocabularies" }
 { $subsection "source-files" }
 { $subsection "compiler" }
-"Tools:"
-{ $subsection "prettyprint" }
-{ $subsection "tools" }
-{ $subsection "help" }
-{ $subsection "inference" }
+{ $heading "Virtual machine" }
 { $subsection "images" }
-"VM:"
 { $subsection "cli" }
 { $subsection "rc-files" }
 { $subsection "init" }
 { $subsection "system" }
 { $subsection "layouts" } ;
 
-ARTICLE: "handbook-library-reference" "Library reference"
-"This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
-{ $index [ "handbook" orphan-articles remove ] } ;
+ARTICLE: "handbook-tools-reference" "Developer tools"
+"The below tools are text-based. " { $link "ui-tools" } " are documented separately."
+{ $heading "Workflow" }
+{ $subsection "listener" }
+{ $subsection "editor" }
+{ $subsection "tools.vocabs" }
+{ $subsection "tools.test" }
+{ $subsection "help" }
+{ $heading "Debugging" }
+{ $subsection "prettyprint" }
+{ $subsection "inspector" }
+{ $subsection "tools.annotations" }
+{ $subsection "inference" }
+{ $heading "Browsing" }
+{ $subsection "see" }
+{ $subsection "tools.crossref" }
+{ $heading "Performance" }
+{ $subsection "timing" }
+{ $subsection "profiling" }
+{ $subsection "tools.memory" }
+{ $subsection "tools.threads" }
+{ $subsection "tools.disassembler" }
+{ $heading "Deployment" }
+{ $subsection "tools.deploy" } ;
+
+ARTICLE: "handbook-library-reference" "Libraries"
+"This index lists articles from loaded vocabularies which are not subsections of any other article. To explore more vocabularies, see " { $link "vocab-index" } "."
+{ $index [ orphan-articles { "help.home" "handbook" } diff ] } ;
 
 ARTICLE: "handbook" "Factor handbook"
 "Learn the language:"
@@ -307,11 +305,11 @@ ARTICLE: "handbook" "Factor handbook"
 { $subsection "first-program" }
 "Reference material:"
 { $subsection "handbook-language-reference" }
-{ $subsection "handbook-environment-reference" }
 { $subsection "io" }
 { $subsection "ui" }
+{ $subsection "handbook-system-reference" }
+{ $subsection "handbook-tools-reference" }
 { $subsection "ui-tools" }
-{ $subsection "unicode" }
 { $subsection "alien" }
 { $subsection "handbook-library-reference" }
 "Explore loaded libraries:"
index e6db2d3b9c3c7e400cb7c1b651ae8bf5006f0701..b40d1626702c24a9d4db273c89e057f4ca7f2557 100644 (file)
@@ -8,6 +8,7 @@ ARTICLE: "help.home" "Factor documentation"
   { $link "handbook" }
   { $link "vocab-index" }
   { $link "ui-tools" }
+  { $link "ui-listener" }
 }
 { $heading "Recently visited" }
 { $table
index 358521473540ce253234015f96c15a63ed1f62a9..f20e65dc275a23b94e1ebc8f06dd6a0058c755d9 100644 (file)
@@ -140,7 +140,46 @@ HELP: <process-stream>
   { "desc" "a launch descriptor" }
   { "encoding" "an encoding descriptor" }
   { "stream" "a bidirectional stream" } }
-{ $description "Launches a process and redirects its input and output via a pair of pipes which may be read and written as a stream of the given encoding." } ;
+{ $description "Launches a process and redirects its input and output via a pair of pipes which may be read and written as a stream with the given encoding." } ;
+
+HELP: <process-reader>
+{ $values
+  { "desc" "a launch descriptor" }
+  { "encoding" "an encoding descriptor" }
+  { "stream" "an input stream" } }
+{ $description "Launches a process and redirects its output via a pipe which may be read as a stream with the given encoding." } ;
+
+HELP: <process-writer>
+{ $values
+  { "desc" "a launch descriptor" }
+  { "encoding" "an encoding descriptor" }
+  { "stream" "an output stream" }
+}
+{ $description "Launches a process and redirects its input via a pipe which may be written to as a stream with the given encoding." } ;
+
+HELP: with-process-stream
+{ $values
+  { "desc" "a launch descriptor" }
+  { "encoding" "an encoding descriptor" }
+  { "quot" quotation }
+}
+{ $description "Launches a process and redirects its input and output via a pair of pipes. The quotation is called with " { $link input-stream } " and " { $link output-stream } " rebound to these pipes." } ;
+
+HELP: with-process-reader
+{ $values
+  { "desc" "a launch descriptor" }
+  { "encoding" "an encoding descriptor" }
+  { "quot" quotation }
+}
+{ $description "Launches a process and redirects its output via a pipe. The quotation is called with " { $link input-stream } " and " { $link output-stream } " rebound to this pipe." } ;
+
+HELP: with-process-writer
+{ $values
+  { "desc" "a launch descriptor" }
+  { "encoding" "an encoding descriptor" }
+  { "quot" quotation }
+}
+{ $description "Launches a process and redirects its input via a pipe. The quotation is called with " { $link input-stream } " and " { $link output-stream } " rebound to this pipe." } ;
 
 HELP: wait-for-process
 { $values { "process" process } { "status" object } }
@@ -175,7 +214,11 @@ ARTICLE: "io.launcher.launch" "Launching processes"
 "Redirecting standard input and output to a pipe:"
 { $subsection <process-reader> }
 { $subsection <process-writer> }
-{ $subsection <process-stream> } ;
+{ $subsection <process-stream> }
+"Combinators built on top of the above:"
+{ $subsection with-process-reader }
+{ $subsection with-process-writer }
+{ $subsection with-process-stream } ;
 
 ARTICLE: "io.launcher.examples" "Launcher examples"
 "Starting a command and waiting for it to finish:"
index a28d4abf24c3d063cd149be4647c8e2ed7997680..9fc324b231ea086d695caede1db7823156faaf75 100644 (file)
@@ -1 +1,19 @@
 IN: tools.errors
+USING: help.markup help.syntax source-files.errors ;
+
+HELP: errors.
+{ $values { "errors" "a sequence of " { $link source-file-error } " instances" } }
+{ $description "Prints a list of errors, grouped by source file." } ;
+
+ARTICLE: "tools.errors" "Batch error reporting"
+"Some tools, such as the " { $link "compiler" } ", " { $link "tools.test" } " and " { $link "help.lint" } " need to report multiple errors at a time. Each error is associated with a source file, line number, and optionally, a definition. " { $link "errors" } " cannot be used for this purpose, so the " { $vocab-link "source-files.errors" } " vocabulary provides an alternative mechanism. Note that the words in this vocabulary are used for implementation only; to actually list errors, consult the documentation for the relevant tools."
+$nl
+"Source file errors inherit from a class:"
+{ $subsection source-file-error }
+"Printing an error summary:"
+{ $subsection error-summary }
+"Printing a list of errors:"
+{ $subsection errors. }
+"Batch errors are reported in the " { $link "ui.tools.error-list" } "." ;
+
+ABOUT: "tools.errors"
\ No newline at end of file
index ccc26be07e3faa4f323c62bc440781ece9545fde..9122edcb67b2be3bb9ec57c441c5a1ff56396639 100644 (file)
@@ -9,7 +9,8 @@ ARTICLE: "tools.test.write" "Writing unit tests"
 { $subsection POSTPONE: must-fail-with }
 "Assert that a quotation or word has a specific static stack effect (see " { $link "inference" } "):"
 { $subsection POSTPONE: must-infer }
-{ $subsection POSTPONE: must-infer-as } ;
+{ $subsection POSTPONE: must-infer-as }
+"All of the above are used like ordinary words but are actually parsing words. This ensures that parse-time state, namely the line number, can be associated with the test in question, and reported in test failures." ;
 
 ARTICLE: "tools.test.run" "Running unit tests"
 "The following words run test harness files; any test failures are collected and printed at the end:"
@@ -17,9 +18,9 @@ ARTICLE: "tools.test.run" "Running unit tests"
 { $subsection test-all }
 "The following word prints failures:"
 { $subsection :test-failures }
-"Help lint failures are also shown in the " { $link "ui.tools.error-list" } "."
+"Test failures are reported using the " { $link "tools.errors" } " mechanism and are shown in the " { $link "ui.tools.error-list" } "."
 $nl
-"Unit test failurs are instances of a class, and are stored in a global variable:"
+"Unit test failures are instances of a class, and are stored in a global variable:"
 { $subsection test-failure }
 { $subsection test-failures } ;
 
index 499dc40115cfb565e6b5af05bea39b7db0fd6284..7efe023f9ad75a238f0aa5f6d61e47be598e10be 100644 (file)
@@ -97,7 +97,7 @@ M: error-renderer column-titles
 M: error-renderer column-alignment drop { 0 1 0 0 } ;
 
 : sort-errors ( seq -- seq' )
-    [ [ [ asset>> ] [ line#>> ] bi 2array ] keep ] { } map>assoc
+    [ [ [ asset>> unparse-short ] [ line#>> ] bi 2array ] keep ] { } map>assoc
     sort-keys values ;
 
 : file-matches? ( error pathname/f -- ? )
index c329f037e178a20a71e904d3aa84ef0b1a06e14c..72f4e1fe66f747f8aea8b5d63db6ab9f52f05d1e 100644 (file)
@@ -1,5 +1,5 @@
 USING: help.markup help.syntax ui.commands ui.gadgets.slots
-ui.gadgets.editors ;
+ui.gadgets.editors kernel ;
 IN: ui.tools.inspector
 
 ARTICLE: "ui-inspector-edit" "Editing slot values in the inspector"
@@ -21,4 +21,8 @@ $nl
 "The UI inspector is an instance of " { $link inspector-gadget } "."
 { $subsection "ui-inspector-edit" } ;
 
+HELP: inspector
+{ $values { "obj" object } }
+{ $description "Opens a new inspector window displaying the slots of " { $snippet "obj" } "." } ;
+
 ABOUT: "ui-inspector"
\ No newline at end of file
index afe890b9c5264cc997792c243e8a39bca9d3a206..ec4fc80a4df3a772150b8589d37e199d02db1962 100644 (file)
@@ -27,6 +27,8 @@ ARTICLE: "ui-listener" "UI listener"
 { $command-map interactor "quotation" }
 { $heading "Editing commands" }
 "The text editing commands are standard; see " { $link "gadgets-editors-commands" } "."
+$nl
+"The listener displays a summary with any outstanding error conditions before every prompt. See " { $link "ui.tools.error-list" } " for details."
 { $heading "Implementation" }
 "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
 
index 0627ed5265dc78ebc614d872170f35e7adb74827..651169554eacabea03ece6839a3b596e4e761c0e 100644 (file)
@@ -30,7 +30,7 @@ $nl
 { $heading "Anti-pattern #4: Logging and rethrowing" }
 "If you are going to rethrow an error, do not log a message. If you do so, the user will see two log messages for the same error, which will clutter logs without adding any useful information." ;
 
-ARTICLE: "errors" "Error handling"
+ARTICLE: "errors" "Exception handling"
 "Support for handling exceptional situations such as bad user input, implementation bugs, and input/output errors is provided by a set of words built using continuations."
 $nl
 "Two words raise an error in the innermost error handler for the current dynamic extent:"