format-box ( table -- seq )


Vocabulary
strings.tables

Inputs
tablean object


Outputs
seqan object


Definition


: format-box ( table -- seq )
format-cells
[ { } ] [
dup length 1 - over [ format-column ] change-nth flip [
[ [ " │ " join "│ " " │" surround ] map ]
[ first [ length 9472 <repetition> ] map ] bi
[ "─┬─" join "┌─" "─┐" surround , ] [
"─┼─" join "├─" "─┤" surround [ , ] curry
[ , ] interleave
] [ "─┴─" join "└─" "─┘" surround , ] tri
] { } make
] if-empty ;