From a3406394c2681fd729f1febb49849a413e841f01 Mon Sep 17 00:00:00 2001 From: Brummel Date: Sun, 10 May 2026 12:23:49 +0200 Subject: [PATCH] design-md-consolidation 2.1: delete Decision 7 (Term::If REVERTED block) --- docs/DESIGN.md | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 20791a0..95cb488 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -590,38 +590,6 @@ server, LSP) was deferred — all three layer additively on the static-prompt path ships, which remains the lowest-common-denominator fallback that always works. -## Decision 7: redundancy removal — `Term::If` is not a primitive - -This decision was made on shaky grounds — -applying CLAUDE.md's "no redundancies" rule to a case that turned out to -be primitive control flow, not redundancy. The post-removal match-on-Bool -form (3× the tokens, asymmetric `pat-wild` for the false case) was -worse for token economy and worse for the natural shape of the language. -`Term::If` is restored. The text below is preserved for the audit trail. - -`Term::If { cond, then, else_ }` is semantically a subset of -`Term::Match` on `Bool`. Per CLAUDE.md the language must contain no -redundancies; two AST nodes for the same operation produces an -authoring decision with no semantic content and an extra codegen -path. `Term::If` was removed. Migration shape on the JSON side: - - {"t":"if","cond":C,"then":A,"else":B} - → - {"t":"match","scrutinee":C, - "arms":[ - {"pat":{"p":"lit","lit":{"kind":"bool","value":true}},"body":A}, - {"pat":{"p":"wild"},"body":B}]} - -The wildcard arm satisfies the typechecker's -`primitive-needs-wildcard` rule. A future iter may upgrade the -exhaustiveness check to recognise the `true`+`false` arm pair as -covering Bool without a wildcard; until then, wildcard is the -canonical migration target. - -No schema version bump (no third-party consumes `ailang/v0`). -Hash invalidation for the three migrated fixtures (`sum`, `sort`, -`max3`) is intentional; the new hashes become the new identity. - ## Decision 8: explicit, verified tail calls For an LLM author, recursion is the natural iteration form