Skip to content

docs: align LANGUAGE_CONTRACT + GRAMMAR with #405 call semantics and #406 catch binding (#492)#519

Merged
InauguralPhysicist merged 1 commit into
mainfrom
docs/492-contract-grammar-405-406
Jul 9, 2026
Merged

docs: align LANGUAGE_CONTRACT + GRAMMAR with #405 call semantics and #406 catch binding (#492)#519
InauguralPhysicist merged 1 commit into
mainfrom
docs/492-contract-grammar-405-406

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Collaborator

docs/LANGUAGE_CONTRACT.md and docs/GRAMMAR.md still described pre-#405 call-spread and pre-#406 catch binding while marked Enforced — fighting SPEC.md and the suite. This aligns them.

Changes

Verification (runtime, v0.28.0)

  • one of [7]7; one of ([7])[7]; fib of [n-1]55
  • built-in error → dict, e.kind = undefined_name; thrown string stays a string, thrown dict preserved

Docs-only (no code/scripts touched).

Follow-up (issue's item 5): no doc-drift gate covers LANGUAGE_CONTRACT/GRAMMAR today — only SPEC.md + COMPARISON.md fenced examples are byte-checked by test_doc_examples.py. Extending the byte-check to these files would prevent this drift class but is a larger change; leaving as a note.

Closes #492

🤖 Generated with Claude Code

…406 catch binding (#492)

Both docs marked pre-#405 / pre-#406 behavior as Enforced while SPEC.md
and the suite are the truth. Rewrote to match:

- Function calls / argument unpacking: brackets after `of` are an
  argument list at EVERY count (#405) — `f of []` zero args, `f of [x]`
  one arg (the element, not the list), `f of [a, b]` two; a variable
  never acts as an arg list; parenthesise to pass a list whole or make
  any one-arg call. Dropped the stale "length-1 literal binds the whole
  list" claim from LANGUAGE_CONTRACT and GRAMMAR.
- #153 footgun: now a RESOLVED footgun — bracketed recursion on a
  defaulted fn (`fib of [n - 1]`) binds n = element and works after #405;
  point at lint W017 for the historical ambiguity.
- catch binding (#406): a built-in runtime error binds `{kind, message,
  line}`, not just a message string; thrown values still bind unchanged.

Runtime-verified: one of [7]->7, one of ([7])->[7], fib bracketed->55,
built-in error e.kind=undefined_name, thrown string/dict preserved.
Docs-only (no code/scripts); follow-up: no doc-drift gate covers
LANGUAGE_CONTRACT/GRAMMAR (only SPEC/COMPARISON are byte-checked).

Closes #492

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@InauguralPhysicist InauguralPhysicist merged commit 5427e5b into main Jul 9, 2026
17 checks passed
@InauguralPhysicist InauguralPhysicist deleted the docs/492-contract-grammar-405-406 branch July 9, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: LANGUAGE_CONTRACT + GRAMMAR still document pre-#405 / pre-#406 semantics as Enforced

1 participant