Handbook
Glossary
with-streams ( input output quot -- )
Factor handbook
»
Input and output
»
Streams
»
Default input and output streams
Prev:
with-output-stream* ( stream quot -- )
Next:
with-streams* ( input output quot -- )
Vocabulary
io
Inputs
input
an input stream
output
an output stream
quot
a
quotation
Outputs
None
Word description
Calls the quotation in a new dynamic scope, with
input-stream
rebound to
input
and
output-stream
rebound to
output
. The streams are closed if the quotation returns or throws an error.
Definition
USING:
kernel
;
IN:
io
:
with-streams
( input output quot -- )
swapd
[
with-output-stream
]
curry
with-input-stream
;
inline