Skip to main content

CONSOLE

Constant CONSOLE 

Source
pub const CONSOLE: ModuleSchema;
Expand description

console: line-oriented output on two streams.

println and print write what the program produces; eprintln and eprint write what it has to say about what it produces — a warning, a progress line, a summary. With one stream the second kind has to go inside the first, which is what puts a complaint about a malformed record in the middle of the records.

Every operation takes a variadic String, which is why console.println("a", "b") prints one line of two space-separated parts. Bytes already handed to the terminal cannot be taken back, so all four are irreversible writes.

All four are the console capability, and the two streams are not two authorities: a program that may write to the terminal may write to the terminal, and where a line lands is a question about the program’s output rather than about what it was allowed to do. A host that means to capture what a run produces and let its complaints through says so by handing cove_runtime::host::Console two different writers, which is where that choice belongs. ADR 0020 says why.