iyi

Standard library, 0.18.0

std/kernel

Kernel methods and top-level utilities.

import std/kernel to use it. Source: src/std/kernel.iyi at v0.18.0.

No sleep. The prelude has one and it takes **milliseconds** as an Int32, parking the fiber on the scheduler; this module carried a second sleep taking seconds as a Float64, which busy-waited on the monotonic clock. Two meanings for one name, decided by whether the argument was written 2 or 2.0 — a thousandfold apart — and the second one burned a core for the whole wait and starved every other fiber on the thread with it (SPEC.md III.1.7a, III.4). The prelude's is the sleep there is, and it says so itself: sleep 2.0 is refused with "sleep takes milliseconds, an Int32".

abortdef

Terminates the program with status, after writing message to standard error as a line, as puts writes one: a message that already ends in a newline gets no second one, as in the other library.

The ending is exit's, as the other library's abort is its exit: what the task deferred runs, and what a stream set to sync = false holds is written. This wrote through the runtime's own __iyi_write and ended with __iyi_exit, which skip both: STDOUT.sync = false, puts "before", abort "bye" left standard output empty, a defer around the call never ran, and a line buffered on standard error before the message was lost.

std/kerneliyi doc src/std/kernel.iyi
pub def abort(message : String | ::Nil = nil, status : Int32 = 1) : NoReturn

loopdef

Repeatedly executes the block until break.

std/kerneliyi doc src/std/kernel.iyi
pub def loop(& : (-> Nil)) : Nil

pdef

Inspects object to standard output followed by newline. Returns object.

std/kerneliyi doc src/std/kernel.iyi
pub def p(object : T) : T forall T

pdef

Inspects each object to standard output. Returns objects tuple.

std/kerneliyi doc src/std/kernel.iyi
pub def p(*objects : *T) : Tuple(*T) forall T

ppdef

Pretty prints object to standard output. Returns object.

std/kerneliyi doc src/std/kernel.iyi
pub def pp(object : T) : T forall T

ppdef

Pretty prints each object to standard output. Returns objects tuple.

std/kerneliyi doc src/std/kernel.iyi
pub def pp(*objects : *T) : Tuple(*T) forall T

puts_alldef

Prints objects followed by a newline.

std/kerneliyi doc src/std/kernel.iyi
pub def puts_all(*objects : *T) : Nil forall T