Handbook
Glossary
stream-write-table ( table-cells style stream -- )
Factor handbook
»
Input and output
»
Formatted output
»
Formatted stream protocol
Prev:
make-cell-stream ( style stream -- stream' )
Vocabulary
io
.
styles
Inputs
table-cells
a sequence of sequences of table cells
style
an
assoc
stream
an output stream
Outputs
None
Generic word contract
Prints a table of cells produced by
with-cell
.
The
style
hashtable holds table style information. See
Table styles
.
Notes
Most code only works on one stream at a time and should instead use
tabular-output
; see
Default input and output streams
.
Errors
Throws an error if the I/O operation fails.
See also
table-gap
,
table-border
,
tabular-output
Definition
IN:
io.styles
GENERIC:
stream-write-table
( table-cells style stream -- )
Methods
USING:
accessors
io
io.streams.256color.private
io.streams.escape-codes
io.styles
kernel
sequences
strings
;
M:
256color
stream-write-table
[
drop
[
[
stream>>
>string
]
map
]
map
format-ansi-table
[
nl
]
[
write
]
interleave
]
with-output-stream*
;
USING:
accessors
io
io.streams.ansi.private
io.streams.escape-codes
io.styles
kernel
sequences
strings
;
M:
ansi
stream-write-table
[
drop
[
[
stream>>
>string
]
map
]
map
format-ansi-table
[
nl
]
[
write
]
interleave
]
with-output-stream*
;
USING:
accessors
io.streams.duplex
io.styles
kernel
;
M:
duplex-stream
stream-write-table
[
out>>
]
call
\
stream-write-table
execute
;
USING:
accessors
io.styles
kernel
;
M:
filter-writer
stream-write-table
[
stream>>
]
call
\
stream-write-table
execute
;
USING:
accessors
html.streams
html.streams.private
io.styles
kernel
sequences
xml.data
xml.syntax.private
;
M:
html-writer
stream-write-table
[
table-style
swap
[
[
data>>
2
nenum
T{
xml-chunk
{
seq ~vector~
}
}
interpolate-xml
]
with
map
1
nenum
T{
xml-chunk
{
seq
V{
""
~tag~
""
}
}
}
interpolate-xml
]
with
map
1
nenum
T{
xml-chunk
{
seq
V{
""
T{
tag
{
name ~name~
}
{
attrs ~attrs~
}
{
children ~vector~
}
}
""
}
}
}
interpolate-xml
]
emit-html
;
USING:
accessors
io.styles
kernel
sequences
ui.gadgets.panes
ui.gadgets.panes.private
;
M:
pane-stream
stream-write-table
[
swap
[
[
stream>>
pane>>
smash-pane
]
map
]
map
<styled-grid>
]
dip
write-gadget
;
USING:
accessors
io.styles
kernel
pdf.layout
pdf.streams
sequences
;
M:
pdf-writer
stream-write-table
nip
swap
[
[
stream>>
data>>
<table-cell>
]
map
<table-row>
]
map
<table>
swap
data>>
push
;
USING:
io
io.streams.plain
io.styles
kernel
sequences
strings
strings.tables
;
M:
plain-writer
stream-write-table
[
drop
[
[
>string
]
map
]
map
format-table
[
nl
]
[
write
]
interleave
]
with-output-stream*
;
USING:
io.styles
io.styles.private
;
M:
style-stream
stream-write-table
nested-style
stream-write-table
;