Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
0.2.0 Preview 1 · Frozen documentation

Print

Attempts to write one complete borrowed UTF-8 view to standard output.

Sn is under heavy development. Reference extracted from this release’s bundled standard library. Public API examples are not an exhaustive compatibility test. Read the matching release guide for tested workflows and limitations. Read the status →

Module std.io

import std.io;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

TryPrint

pub fn TryPrint(Value: str) -> Result<void, IoError>

Attempts to write one complete borrowed UTF-8 view to standard output.

On the Linux/POSIX target, a closed pipe is reported as OutputFailed; the operation contains the SIGPIPE generated by its own write attempt.

Value: Valid UTF-8 view borrowed only for the complete call. Return: .Ok after every byte is accepted or .Err { Error = .OutputFailed }. Warning: May block and may emit a strict prefix before reporting failure.

Example

module example.print;
from std.io import Print, TryPrint;
fn Main() -> i32 {
    let ResultValue = TryPrint("recoverable\n");
    switch ResultValue {
        case .Ok => Print("complete\n");
        case .Err { Error = _ } => return 1;
    }
    return 0;
}
pub fn Print(Value: str) -> void

Writes one complete borrowed UTF-8 view or terminates fatally. Value: Valid UTF-8 view borrowed only for the complete call. Return: No value after successful complete output. Warning: May block, may emit a strict prefix, and fatal-traps without unwinding on failure.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library