Start a logical block, creating a <pretty-stream> if necessary.
This function groups printing into a logical block. The logical block provides boundaries for new levels of indentation, affects #”linear” newlines, and so on.
prefix is a string to print at the beginning of the logical block. The block’s indentation is automatically set to be one character position greater than the column in which prefix ends. Alternatively, per-line-prefix is a string to print on every line of the logical block. This function signals an error if it is called with both prefix and per-line-prefix supplied.
suffix is a string to print at the end of the logical block.
column advises the pretty printer as to the current column of the output stream. The column argument may be ignored entirely by some methods, and it may be ignored in some cases by methods that can better determine the stream’s current output column.
body must be a <function> that can take one argument, and this argument is a <stream>. The body function should use the stream argument passed to it; the body function should not close over the stream argument to pprint-logical-block.
pprint-logical-block wraps stream with a pretty printing stream when stream is any other kind of stream. If stream is already a pretty printing stream, then the body function is called on stream.
All print-object methods that are written to do pretty printing must call the other pretty printing functions within the dynamic scope of a call to pprint-logical-block; otherwise, the pretty printing functions are no-ops.
open
| stream | An instance of <stream>. |
| column: | An instance of <integer>. Required. |
| prefix: | An instance of type-union(<false>, <byte-string>). The default is #f. |
| per-line-prefix: | An instance of type-union(<false>, <byte-string>). The default is #f. |
| body: | An instance of <function>. Required. |
| suffix: | An instance of type-union(<false>, <byte-string>). The default is #f. |