9. Approved on 2026-11-20
Ryan approved plan/19-index-and-lends.md: one mechanism for domain,
Str, Grid and Perm, and lexical exclusivity as the borrow model.
The design. A bounded index is a sealed struct with impl Index
(2.1, 2.15). Indexing is the Indexed trait and [I]T is a library
struct (2.15). Slices, rows and element access are projections that lend
part of their receiver (5.12), lent values are second-class (5.14), and
two lends of the same container are allowed when the projection's
disjoint law is proven (5.13). No borrow is ever stored or returned
(5.3). Sub<V> is removed (2.4, 2.8). Decisions 3.8, 4.8 and 5.5, which
were open, are settled by it.
His three changes.
let K = n, notconst K = n, for a size frozen from a run-time value.conststays strictly compile-time (3.8, 7.10).v.l/v.r, withv.l(k)/v.r(k), as the short spellings ofv.before/v.after(2.2).CharandStrare ASCII only: one byte perChar, a flat[S]CharorList<Char>, and no UTF-8 (1.6).
Also locked in. / and % are Euclidean on integers, and cost
nothing when the operands are proven non-negative and positive (1.9).
Prototype. proto/cpc/ implements the surface rules of the above and
keeps the 30 corpus ports passing; plan/19-index-and-lends.md §11 lists
what it covers and what it leaves out. One call made there and not yet
confirmed by Ryan: v.l(k) and v.r(k) count v itself, so v.l is
v.l(1).