comptime expandable match statements

This commit is contained in:
2026-07-17 14:29:50 +02:00
parent 1f25e6cd1d
commit 97f1c06057
22 changed files with 120821 additions and 119318 deletions
+12 -2
View File
@@ -851,8 +851,8 @@
- tuples are unnamed-field structs with structural anonymous values, nominal named declarations,
brace literals, numeric fields, and no runtime metadata
- `@std/meta`, `typeinfo!`, `field!`, `compile_error!`, specialization-time branches, and semantic
`inline for` use checker-owned persistent compile-time values for aggregate-first reflection and
heterogeneous static expansion; inline-loop control is recursively resolved at comptime
`expand for` use checker-owned persistent compile-time values for aggregate-first reflection and
heterogeneous static expansion; expand-loop control is recursively resolved at comptime
- interleaved comptime parameters use semantic candidate resolution, immutable byte values specialize
by contents, and all comptime parameters remain erased from the runtime ABI
- `io.print(writer, format, args)` validates and expands `{s}` / `{d}` formatting at comptime,
@@ -885,6 +885,16 @@
- integer output uses one base-aware 65-byte stack buffer; float output uses fixed-buffer
libc `snprintf` with 32-bit and 64-bit general/scientific precision and propagates failure
40. compile-time `expand` (implemented)
- expansion-oriented `inline for` is strictly renamed to `expand for`; `inline` remains available
for future function-inlining syntax
- final expanded enum and tagged-union match arms generate checker-local specialized arms only
for variants not covered by preceding explicit arms
- generated enum values and union tags are static bindings, heterogeneous payloads retain their
concrete types, and `void` payloads support value and pointer captures without runtime storage
- `tag!` reads or folds a tagged union discriminant, while `tagname!` turns a comptime-known enum
value into its immutable field-name string
## A word on unchecked casts
For casts that bypass safety checks, Honey provides builtin functions: