with-cell ( quot -- )
Factor documentation > Factor handbook > Input and output > Formatted output > Formatted output on the default stream
Prev:with-row ( quot -- )
Next:write-cell ( str -- )


Vocabulary
io.styles

Inputs and outputs
quota quotation


Word description
Calls a quotation in a new scope with output-stream rebound. Output performed by the quotation is displayed in a table cell. This word can only be called inside the quotation given to with-row.

Errors
Throws an error if the I/O operation fails.

Definition
USING: io kernel make namespaces ;

IN: io.styles

: with-cell ( quot -- )
H{ } output-stream get make-cell-stream
[ swap with-output-stream ] keep , ; inline