This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.

Constructor

~import std/constructor

Koru Standard Library: Constructor — the comptime assembly sandwich.

constructor.kz · 4 tors · ~[comptime]

Koru Standard Library: Constructor — the comptime assembly sandwich. · 15 more lines
Koru Standard Library: Constructor — the comptime assembly sandwich. The constructor is `capture` generalized from a scalar cell to a GROWING structure. Where `capture` folds one cell (`! as` / `captured` / `| captured`), the constructor COLLECTS (`! construct` / `push` / `| constructed`). The whole thing is comptime and DISSOLVES — allocations happen at comptime and never reach the binary. Runtime collection is not the constructor; it's the store. SURFACE: `std/constructor(nums)` invokes the module's `default` event (the default-event rule: `std/M(args)` ≡ `std/M:default(args)`). The header arg is the cell NAME; the `! construct` half drives a LINQ traversal whose `push` calls collect into the cell; `| constructed <r>` is the one-shot after-read. This file currently builds the VALUE terminal (a comptime list). The struct / type terminals (the `field` vocabulary + `std/types:emit`) follow.

default

comptimetransformpre koru_std/constructor.kz:31

struct

comptimetransformpre koru_std/constructor.kz:43