Handbook
Glossary
with-string-writer ( quot -- str )
Factor handbook
»
Input and output
»
String streams
Prev:
with-string-reader ( str quot -- )
Vocabulary
io
.
streams
.
string
Inputs
quot
a
quotation
Outputs
str
a
string
Word description
Calls the quotation in a new dynamic scope with
output-stream
rebound to a new string writer. The accumulated string is output when the quotation returns.
Definition
USING:
io
kernel
strings
;
IN:
io.streams.string
:
with-string-writer
( quot -- str )
<string-writer>
[
swap
with-output-stream*
]
keep
>string
;
inline