Rewrite specs.md tuple/failable/pack/UFCS/grammar sections to the new syntax, update readme.md, and refresh stale tuple references in example header comments. Also fixes two pre-existing doc inaccuracies surfaced in review: drop the value-discarding `;` in the tuple-return examples, and correct the §13 function-type grammar production (optional param list + optional trailing `!` channel). Optional semantics unchanged. current/CHECKPOINT-LANG.md logs the cutover.
52 lines
2.7 KiB
Markdown
52 lines
2.7 KiB
Markdown
# CHECKPOINT-LANG — user-facing language features
|
|
|
|
Companion to [PLAN-LANG.md](PLAN-LANG.md). Update after every step (one step at
|
|
a time, per the cadence rule).
|
|
|
|
## Last completed step
|
|
**Tuple syntax cutover — `Tuple(...)` type + `.(...)` value (commit 989e18b7).**
|
|
The bare-paren tuple grammar was replaced with explicit, position-unambiguous
|
|
forms that mirror how structs work:
|
|
|
|
- type `(A, B)` → `Tuple(A, B)` (named keeps `:` — `Tuple(x: A, y: B)`)
|
|
- value `(a, b)` → `.(a, b)` (named uses `=` — `.(x = a, y = b)`)
|
|
- typed (new) → `Tuple(A, B).(a, b)` (like `Point.{...}`)
|
|
- failable `-> (T, !)` → `-> T !`
|
|
`-> (T1, T2, !)` → `-> Tuple(T1, T2) !` (error channel OUTSIDE the Tuple)
|
|
|
|
Bare `(...)` is now grouping ONLY, everywhere; a comma in bare parens is a hard
|
|
error with a migration hint. Grouping, function types `(A, B) -> R`, param lists,
|
|
lambdas, match bindings, and `?(?T)` grouping are unaffected. `Tuple(...)` is
|
|
strictly a TYPE in every position (incl. `size_of` / `type_info` args); a tuple
|
|
VALUE comes only from `.(...)` or `Tuple(...).(...)`. A bare `Tuple(1, 2)`
|
|
(non-type elements) is rejected. Field access is unchanged (`.0`/`.1` positional,
|
|
`.x` named). Optional semantics are untouched — `??T ≡ ?T` was NOT done; nested
|
|
optionals (`?(?i64)`) stay genuine.
|
|
|
|
The ~110 tuple-bearing corpus files were migrated by a one-shot AST-aware
|
|
migrator; new examples landed (0130 new syntax, 0131 typed construction, 1060
|
|
named-tuple failable return). Issue **0189** filed (non-type expression in type
|
|
position silently fabricates an empty struct — surfaced while validating the
|
|
`Tuple(i32, g.a)` rejection path).
|
|
|
|
Docs updated to the new syntax: `specs.md` (Tuple Types section, function
|
|
multi-return note, all error-channel sections, Variadic Heterogeneous Type Packs,
|
|
Tuple UFCS Splatting, and the normative Grammar block) and `readme.md` (inline-asm
|
|
named-tuple return + the `N → a tuple` rule). Stale old-syntax mentions in example
|
|
header comments were corrected (comments only — no code touched). Suite green
|
|
(810 ran, 0 failed).
|
|
|
|
## Current state
|
|
Tuple syntax cutover shipped and documented. `Tuple(...)` / `.(...)` are the only
|
|
tuple spellings across the corpus, specs, and readme.
|
|
|
|
## Next step
|
|
Pick up the next incomplete LANG step from [PLAN-LANG.md](PLAN-LANG.md).
|
|
|
|
## Log
|
|
- **Tuple syntax cutover** (commit 989e18b7): `(A,B)`/`(a,b)` tuples replaced by
|
|
`Tuple(A,B)` type + `.(a,b)` value; failable `!` moved outside the Tuple
|
|
(`-> T !` / `-> Tuple(...) !`); bare parens are grouping-only. Docs (specs.md +
|
|
readme.md) and stale example-comment mentions migrated to the new syntax. Issue
|
|
0189 filed. Suite green (810 ran, 0 failed).
|