Remove unnecessary word

db4
Slava Pestov 2008-01-24 23:50:00 -04:00
parent 62f076d0c3
commit 35f390e8ca
2 changed files with 3 additions and 8 deletions

5
core/io/io-docs.factor Normal file → Executable file
View File

@ -29,7 +29,6 @@ ARTICLE: "stdio" "The default stream"
"Various words take an implicit stream parameter from a variable to reduce stack shuffling."
{ $subsection stdio }
"Unless rebound in a child namespace, this variable will be set to a console stream for interacting with the user."
{ $subsection close }
{ $subsection read1 }
{ $subsection read }
{ $subsection read-until }
@ -178,10 +177,6 @@ $io-error ;
HELP: stdio
{ $var-description "Holds a stream, used for various implicit stream operations. Rebound using " { $link with-stream } " and " { $link with-stream* } "." } ;
HELP: close
{ $contract "Closes the " { $link stdio } " stream." }
$io-error ;
HELP: readln
{ $values { "str/f" "a string or " { $link f } } }
{ $contract "Reads a line of input from the " { $link stdio } " stream. Outputs " { $link f } " on stream exhaustion." }

View File

@ -38,8 +38,6 @@ SYMBOL: stdio
! Default error stream
SYMBOL: stderr
: close ( -- ) stdio get stream-close ;
: readln ( -- str/f ) stdio get stream-readln ;
: read1 ( -- ch/f ) stdio get stream-read1 ;
: read ( n -- str/f ) stdio get stream-read ;
@ -56,7 +54,9 @@ SYMBOL: stderr
stdio swap with-variable ; inline
: with-stream ( stream quot -- )
swap [ [ close ] [ ] cleanup ] with-stream* ; inline
swap [
[ stdio get stream-close ] [ ] cleanup
] with-stream* ; inline
: tabular-output ( style quot -- )
swap >r { } make r> stdio get stream-write-table ; inline