3.54. kink/io/STR_PRINTER

Provides str printers.

3.54.1. STR_PRINTER.make_pair(Newline)

STR_PRINTER.make_pair Makes a printer which builds a str, with the Newline.

Precondition:

• Newline must be a str

STR_PRINTER.make_pair returns a pair of [Printer $gen_str], where the Printer is a printer which builds a str, and $gen_str is a thunk which returns the built str.

Example:

:STR_PRINTER.require_from('kink/io/')

[:P :gen_str] <- STR_PRINTER.make_pair("\r\n")
P.print_line('foo')
P.print_line('bar')
stdout.print_line(gen_str.repr) # => "foo\r\nbar\r\n"