Handbook
Glossary
with-farkup-writer ( quot -- str )
Farkup streams
Prev:
<farkup-writer> ( -- farkup-writer )
Vocabulary
io
.
streams
.
farkup
Inputs
quot
a
quotation
Outputs
str
a
string
Word description
Calls the quotation in a new dynamic scope with
output-stream
rebound to an
farkup-writer
. When the quotation returns, outputs the accumulated Farkup markup.
Examples
USING: io io.styles io.streams.farkup prettyprint ; [ "Hello" { { font-style bold } } format nl ] with-farkup-writer .
"*Hello*\n\n"
Definition
USING:
accessors
io
kernel
sequences
;
IN:
io.streams.farkup
:
with-farkup-writer
( quot -- str )
<farkup-writer>
[
swap
with-output-stream
]
keep
data>>
""
concat-as
;
inline