ludic/selfhost/tests
Orkuncakilkaya 872f458cb2
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 25s
ci / build-and-test (push) Successful in 1m26s
commit-lint / conventional-commits (push) Successful in 2s
docs / build-and-deploy (push) Successful in 23s
feat(types): tagged-union enums — variant payloads + binding match + exhaustiveness (#56)
Extend `enum` from named int constants to a tagged union: a variant may
carry a payload (`enum Tile { Empty, Wall, Door(int), Portal(int, int) }`).
Such enums box to a heap record (an i32 tag at offset 0, then one 8-byte
slot per payload position); an all-bare enum keeps its zero-cost compile-
time-ordinal representation, byte-for-byte unchanged (every golden render
and the bootstrap fixpoint still hold).

- Parser: variant payload declarations, stored as N_PARAM kids on the
  variant node.
- Construction: by name — `Door(3)`, `Portal(x, y)`, bare `Empty` — resolved
  ahead of the function-call fallback and boxed with the payloads coerced to
  their declared types.
- match: destructures a tagged scrutinee, switching on the tag and binding
  each arm's payload names in a scoped local frame.
- Checking pass: a tagged `match` must be exhaustive (cover every variant or
  end in `_`), and constructor/pattern arities and binding forms are checked
  — all reported where the scrutinee's type is known.

Adds selfhost/tests/enums.ludic to the regression suite and documents the
feature in LANGUAGE.md and the enum/match pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-01 03:07:46 +03:00
..
color.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
const.ludic fix(compiler): preserve declared type of const references 2026-09-01 02:48:03 +03:00
control.ludic refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
crypto.ludic feat(stdlib): Crypto.* — SHA-256 + HMAC-SHA256, constant-time verify (#19) 2026-08-30 13:37:02 +03:00
datetime.ludic feat(stdlib): Time/Date/Duration calendar-clock core (issue #9) 2026-08-30 03:37:38 +03:00
datetime2.ludic feat(stdlib): DateTime format/parse + simulated Clock — completes #9 2026-08-30 03:51:48 +03:00
easecollide.ludic refactor(stdlib): de-abbreviate namespaces (Mem/Sys/Net/Collide) 2026-08-30 01:30:47 +03:00
enums.ludic feat(types): tagged-union enums — variant payloads + binding match + exhaustiveness (#56) 2026-09-01 03:07:46 +03:00
fixed.ludic refactor(lang): rename builtins flr->floor and fx->fixed 2026-08-30 02:01:56 +03:00
hash.ludic feat(lang,stdlib): 64-bit long type + 64-bit Hash variants (issue #17) 2026-08-30 01:01:06 +03:00
long.ludic refactor(lang): rename the str type (and stringify builtin) to string 2026-08-30 01:51:11 +03:00
match_bits.ludic refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
math.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
math2.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
math3.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
memsys.ludic refactor(stdlib): consolidate System.* onto Os.*, retire duplicated members 2026-08-30 22:54:28 +03:00
slices.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
sort.ludic feat(stdlib): sorting toolkit — sort_by/sort_desc_by/sort_with + stable merge sort (#11) 2026-08-30 11:39:26 +03:00
structs.ludic refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
textlist.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
textlist2.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
textsplit.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
transcend.ludic feat(stdlib): Math.exp/log/pow + Ease.elastic transcendentals (issue #25) 2026-08-30 01:19:44 +03:00
types2d.ludic feat(types): IVec2 + Rect 2D value types (#1) 2026-08-31 18:29:41 +03:00
vector.ludic feat(stdlib): 2D Vector type + Vector.* namespace (issue #25) 2026-08-30 02:09:38 +03:00