11. Leaning since 2026-11-20: the ergonomics audit
A read of all 30 ports as code (research/archive/audits/ergonomics-audit.md) changed
the prototype in the ways below. They are implemented in proto/cpc/,
eleven ports use them, and crates/cpl-cli/tests/cases/ergo/ locks them. None is
confirmed by Ryan yet, so each is Leaning. Per the rules at the top of
this file, each says what is library code and what is not.
- The optional step (2.9, revised).
i + kandi - kon a position are a?I. In the library this isimpl Add<Int>on anySeq, the body of theoffsetthat 12 §1.3 already had. It revises a settled row:v + 1was an error. The reason is the six ports that did the step on raw.idxwith a separate guard; the step can still never produce a position outside the domain. if let a = x and let b = y. Syntax. It extends the existingif let a = x and cond, so two optional steps need no nesting.- Open ranges
..i,..=i,i... Syntax: a range literal may omit an end, and takes its type from the end it has.Range<I>is the library struct of plan/19 §4.1. - A boundary may end a range. Library:
Range<I>is twoBounds<I>, so..bandb..are the cells before and after boundaryb...=bis an error. span(a, b),r.prefix(k),r.suffix(k),b.left,b.right. Library functions and methods onRangeandBounds;leftandrightare already in plan/19 §4.1.- Code after a
lend(write-back). Already designed in plan/19 §3.4; now prototyped. It is what lets a container keep a derived value right on every write. Counter<K>andcounts(xs). A library struct whoseatis a projection with a write-back;crates/cpl-cli/tests/cases/lend/writeback.cpis that struct in.cp. The prototype compiles it in, as it doesSegTree.prefix(a)withpre.sum(range)/pre.sum(rows, cols). A library struct over[I.bounds]T, compiled in for the same reason.x f= yfor any two-argument fn. Syntax, and one rule in place of two:min=andmax=are now instances of it.[domain S]Letter = read(). Library:readfor an array whose element is a domain ofChar.