]> gitweb.factorcode.org Git - factor.git/blob - core/io/streams/string/string-docs.factor
Initial import
[factor.git] / core / io / streams / string / string-docs.factor
1 USING: help.markup help.syntax io strings quotations sequences ;
2 IN: io.streams.string
3
4 ARTICLE: "io.streams.string" "String streams"
5 "String streams:"
6 { $subsection <string-reader> }
7 { $subsection <string-writer> }
8 "Utility combinators:"
9 { $subsection string-in }
10 { $subsection string-out } ;
11
12 ABOUT: "io.streams.string"
13
14 HELP: <string-writer>
15 { $values { "stream" "an output stream" } }
16 { $description "Creates an output stream that collects text into a delegate string buffer. The contents of the buffer can be recovered by executing " { $link >string } ", and indeed all other sequence operations are permitted by virtue of the delegation." } ;
17
18 HELP: string-out
19 { $values { "quot" quotation } { "str" string } }
20 { $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ;
21
22 HELP: <string-reader>
23 { $values { "str" string } { "stream" "an input stream" } }
24 { $description "Creates a new stream for reading " { $snippet "str" } " from beginning to end." }
25 { $notes "The implementation exploits the ability of string buffers to respond to the input stream protocol by reading characters from the end of the buffer." } ;
26
27 HELP: string-in
28 { $values { "str" string } { "quot" quotation } }
29 { $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to an input stream reading " { $snippet "str" } " from beginning to end. The accumulated string is output when the quotation returns." } ;