Pudu programming language
Menu
API reference

Std.Out.Printer

1 declaration

type

Printer

This declaration introduces a public type.

What it does

The decisions about how something is written, held as a value.

print takes text and ends the line, and every choice beyond that — what

goes between the pieces, what ends the line, whether it is output or errors,

how far it is indented — has to be assembled at the call site. Assembled

there, those choices cannot be named, cannot be passed to a function, and

are rewritten at every call.

Here they are a value. A printer is built once, given a name, and handed to

whatever does the writing, so a function that reports something takes the

printer to report through rather than deciding the shape itself.

The defaults are the familiar ones: a space between pieces and a newline at

the end.

Read the signature

  • This declaration has no value signature because it introduces a type or trait.

Back to Std.OutSearch related declarations