diff --git a/basis/io/directories/directories-docs.factor b/basis/io/directories/directories-docs.factor index e93023523d..ffca920dc6 100644 --- a/basis/io/directories/directories-docs.factor +++ b/basis/io/directories/directories-docs.factor @@ -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 diff --git a/basis/io/styles/styles-docs.factor b/basis/io/styles/styles-docs.factor index ed2f0c425f..7750db8f1d 100644 --- a/basis/io/styles/styles-docs.factor +++ b/basis/io/styles/styles-docs.factor @@ -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 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 1 over - over 1 " + " swap 10 / 1 over - over 1 " " background associate format nl" "] each" } diff --git a/core/io/io-docs.factor b/core/io/io-docs.factor index e0b74d5ab3..aa6e087442 100644 --- a/core/io/io-docs.factor +++ b/core/io/io-docs.factor @@ -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 " - "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 [" - " 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 [" - " 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" } ;