diff --git a/basis/io/streams/limited/limited-docs.factor b/basis/io/streams/limited/limited-docs.factor index a7199eaad1..833e53820e 100755 --- a/basis/io/streams/limited/limited-docs.factor +++ b/basis/io/streams/limited/limited-docs.factor @@ -24,7 +24,22 @@ HELP: limit " \"123456\" 3 stream-throws limit" " 100 swap stream-read ." "] [ ] recover ." - "T{ limit-exceeded }" +"""T{ limit-exceeded + { n 1 } + { stream + T{ limited-stream + { stream + T{ string-reader + { underlying "123456" } + { i 3 } + } + } + { mode stream-throws } + { count 4 } + { limit 3 } + } + } +}""" } "Returning " { $link f } " on exhaustion:" { $example diff --git a/core/io/io-docs.factor b/core/io/io-docs.factor index 13048fdb61..e0b74d5ab3 100644 --- a/core/io/io-docs.factor +++ b/core/io/io-docs.factor @@ -86,6 +86,14 @@ HELP: stream-copy { $description "Copies the contents of one stream into another, closing both streams when done." } $io-error ; +HELP: stream-tell +{ $values + { "stream" "a stream" } { "n" integer } +} +{ $description "Returns the index of the stream pointer if the stream is seekable." } +{ $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ; + + HELP: stream-seek { $values { "n" integer } { "seek-type" "a seek singleton" } { "stream" "a stream" } @@ -274,8 +282,11 @@ $nl } "This word is only required for string output streams:" { $subsections stream-nl } -"This word is for streams that allow seeking:" -{ $subsections stream-seek } +"These words are for seekable streams:" +{ $subsections + stream-tell + stream-seek +} { $see-also "io.timeouts" } ; ARTICLE: "stdio-motivation" "Motivation for default streams"