Skip to content

docs: state the arity-1 carve-out that makes 'one rule, one sentence' true (fixes #635)#672

Merged
InauguralPhysicist merged 1 commit into
InauguralSystems:mainfrom
Nitjsefnie:docs/635-of-arity1-sentence
Jul 18, 2026
Merged

docs: state the arity-1 carve-out that makes 'one rule, one sentence' true (fixes #635)#672
InauguralPhysicist merged 1 commit into
InauguralSystems:mainfrom
Nitjsefnie:docs/635-of-arity1-sentence

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Docs only, per the issue — the implementation stays untouched (it's right and load-bearing).

Before writing a word I verified the mechanism against source and a live probe: src/vm.c re-collects all call-site arguments into a single list for a 1-parameter, non-defaulted callee in both the JIT fast path (:1801-1813) and the interpreter path (:1828-1844); one of [3, 4][3, 4], one of [3, 4, 5][3, 4, 5], one of [][], identical under EIGS_JIT_OFF=1, --lint silent — your reproduction exactly.

What changed:

  • SPEC.md §of: an "Arity-1 carve-out" paragraph right after the "one rule, one sentence" block — the rule describes the call site, not what a one-slot callee does with the list; includes the why (len of [1, 2] returning 2 depends on it) — plus your doc-gate example as a new executable SPEC example (the [89] gate now checks 72 examples, was 71; the new one passes).
  • SPEC.md evaluation-model reference, item 3: the same exception appended to the Argument spreading bullet.
  • LANGUAGE_CONTRACT.md: a parallel bullet under argument unpacking, cross-referencing the existing f of [] half of the exception under Default parameter values.

Item 4 of the issue's fix list (extending W017's hint) is a "consider" and a code change — left out of this docs PR deliberately; happy to take it separately if you want it.

Full suite green before and after: 3090/3090 baseline → 3091/3091 (exactly the one new doc example), doc-drift gates included.


Generated by Claude Fable 5 (brief, review), Claude Sonnet 4.6 (implementation)

SPEC.md's "one rule, one sentence" and LANGUAGE_CONTRACT.md's argument-
unpacking section both claim brackets after `of` always spread into
the callee's parameters positionally. That's false for a 1-parameter,
non-defaulted callee: it has only one slot, so a 2+-element literal
list re-collects whole and binds to that parameter instead of
spreading (`one of [3, 4]` binds `a = [3, 4]`, not `a = 3`, for
`define one(a)`). This is exactly what keeps `len of [1, 2]` and
`print of [1, 2]` working — the implementation is right and
load-bearing, so the docs are corrected to describe it instead.

Adds the carve-out next to both "one rule" statements in SPEC.md (the
call section and the evaluation-model reference) and alongside the
existing `f of []` note in LANGUAGE_CONTRACT.md, plus a new executable
SPEC.md example that pins the behavior under the doc-example gate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@InauguralPhysicist
InauguralPhysicist merged commit 6708c60 into InauguralSystems:main Jul 18, 2026
16 checks passed
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.

2 participants