Prelude

no import

Auto-loaded before every program — no import needed. These are thin Zinc wrappers over the print/eprint/format builtins that add separators, newlines, and stderr variants. Source: stdlib/default.zn. There is no fmt module — printing is these prelude globals plus the builtins above.


println(..any)

Print args separated by a single space, then a newline. The everyday print.

prints(sep: string, ..any)

Print args separated by sep (no trailing newline).

printsln(sep: string, ..any)

Like prints, plus a trailing newline.

printf(fmt: string, ..any)

print(format(fmt, ..args)) — formatted, no trailing newline.

printfln(fmt: string, ..any)

Like printf, plus a trailing newline.

eprintln(..any)

println to stderr (space-separated + newline).

eprints(sep: string, ..any)

prints to stderr (no trailing newline).

eprintsln(sep: string, ..any)

Like eprints, plus a trailing newline.

eprintf(fmt: string, ..any)

printf to stderr.

eprintfln(fmt: string, ..any)

printfln to stderr.

to_string(v: any) => string

Convenience alias for the string builtin, kept in the prelude by convention — no behavioral difference (string(true) is already "true", string(nil) is already "nil").

println("hello", 42, true)          // hello 42 true
printfln("{} + {} = {}", 2, 3, 5)   // 2 + 3 = 5
prints(", ", 1, 2, 3)               // 1, 2, 3   (no newline)
eprintln("warning: disk low")       // → stderr
On this page