]> gitweb.factorcode.org Git - factor.git/commitdiff
More documentation cleanup.
authorBrad Christensen <brad@temporalsculpt.org>
Wed, 3 Feb 2010 06:37:20 +0000 (23:37 -0700)
committerBrad Christensen <brad@temporalsculpt.org>
Wed, 3 Feb 2010 07:05:04 +0000 (00:05 -0700)
basis/io/directories/directories-docs.factor
basis/io/styles/styles-docs.factor
core/io/io-docs.factor

index e93023523d21eaaa8a63d57dcedb0507f11cdd2d..ffca920dc6ca149c02e70bb631e0c214de8fc410 100644 (file)
@@ -145,7 +145,7 @@ ARTICLE: "delete-move-copy" "Deleting, moving, and copying files"
 "Operations for deleting and copying files come in two forms:"
 { $list
     { "Words named " { $snippet { $emphasis "operation" } "-file" } " which work on regular files only." }
-    { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files." }
+  { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files. (see " { $link "io.directories.hierarchy" } ")" }
 }
 "The operations for moving and copying files come in three flavors:"
 { $list
index ed2f0c425f16f402209c6fa7c3bd7ce8c5cab00d..7750db8f1d46466b9bf4d3860d81c964a6a823de 100644 (file)
@@ -204,7 +204,7 @@ HELP: foreground
 { $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." } 
 { $examples
     { $code
-        "10 ["
+        "10 iota ["
             "    \"Hello world\\n\""
             "    swap 10 / 1 <gray> foreground associate format"
         "] each"
@@ -215,9 +215,9 @@ HELP: background
 { $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." }
 { $examples
     { $code
-        "10 ["
+        "10 iota ["
             "    \"Hello world\\n\""
-            "    swap 10 / 1 over - over 1 <rgba>"
+            "    swap 10 / 1 over - over 1 <rgba>"
             "    background associate format nl"
         "] each"
     }
index e0b74d5ab337c73ccf337efc3ebfc7e33dfc64f2..aa6e087442c263fa6abd97e9fedc74e649cd7173 100644 (file)
@@ -165,7 +165,7 @@ $io-error ;
 
 HELP: read-until
 { $values { "seps" string } { "seq" { $or byte-array string f } } { "sep/f" "a character or " { $link f } } }
-{ $contract "Reads elements from " { $link input-stream } ". until the first occurrence of a separator, or stream exhaustion. In the former case, the separator character is pushed on the stack, and is not part of the output. In the latter case, the entire stream contents are output, along with " { $link f } "." }
+{ $contract "Reads elements from " { $link input-stream } " until the first occurrence of a separator, or stream exhaustion. In the former case, the separator character is pushed on the stack, and is not part of the output. In the latter case, the entire stream contents are output, along with " { $link f } "." }
 $io-error ;
 
 HELP: read-partial
@@ -300,14 +300,14 @@ ARTICLE: "stdio-motivation" "Motivation for default streams"
 { $code
     "USING: continuations kernel io io.files math.parser splitting ;"
     "\"data.txt\" utf8 <file-reader>"
-    "dup stream-readln number>string over stream-read 16 group"
+    "dup stream-readln string>number over stream-read 16 group"
     "swap dispose"
 }
 "This code has two problems: it has some unnecessary stack shuffling, and if either " { $link stream-readln } " or " { $link stream-read } " throws an I/O error, the stream is not closed because " { $link dispose } " is never reached. So we can add a call to " { $link with-disposal } " to ensure the stream is always closed:"
 { $code
     "USING: continuations kernel io io.files math.parser splitting ;"
     "\"data.txt\" utf8 <file-reader> ["
-    "    dup stream-readln number>string over stream-read"
+    "    dup stream-readln string>number over stream-read"
     "    16 group"
     "] with-disposal"
 }
@@ -315,14 +315,14 @@ ARTICLE: "stdio-motivation" "Motivation for default streams"
 { $code
     "USING: continuations kernel io io.files math.parser splitting ;"
     "\"data.txt\" utf8 <file-reader> ["
-    "    readln number>string read 16 group"
+    "    readln string>number read 16 group"
     "] with-input-stream"
 }
 "An even better implementation that takes advantage of a utility word:"
 { $code
     "USING: continuations kernel io io.files math.parser splitting ;"
     "\"data.txt\" utf8 ["
-    "    readln number>string read 16 group"
+    "    readln string>number read 16 group"
     "] with-file-reader"
 } ;