Design decisions

326. Lints for newcomer loops std names: argmax, mex, copy, queue, range, map count (2026-11-22)

loop_argmax (L0547), manual_mex (L0548), copy_comprehension (L0549), queue_head_index (L0550), split_range_check (L0551) and contains_then_add (L0552), in crates/cpl-lint/src/rules/hand_loops.rs, teach the std call for loop and guard shapes the corpus/newcomer/ set marks. All are idiom, warn, help only: each rewrite depends on a type (a Map, a domain) or on what the loop goes on to compute. split_range_check fires on one name bounded by two adjacent and terms only; two coordinates checked together are diagnostics' grid_bounds_check (L0535). queue_head_index matches .len by name, so lint_std_names goes from 149 to 151 (the other line is 05f4013dc's adjacency rule, which landed without raising it). Their findings in spec/std (L0549 91, mostly [x for x in s] in tests; L0551 75, mostly 0 <= i and i < cap asserts; L0550 6; L0547 1) and the corpus specs (L0551 2) are real spellings and enter the shrink-only baseline. Reverse: delete the six records and rules/hand_loops.rs, and restore corpus_warnings.txt and the ratchet baseline.

spec/lib/search-dp.md specified V.ranges, but nothing implemented it. The cell type is Range<V> itself, not a new position type, so r.len, r.first!, r.drop(1), r.drop_last(1) and r.splits all work on it with no conversion, and [V.ranges]T shares the triangle storage of [Sym<V>]T: l..r is the pair (l, r - 1). Indexing with an empty range traps in every build. A Range<Int> index also traps when it leaves V. for r in V.ranges lowers to two nested loops (length, then left end) with no list, the way V.pairs does. Range.drop_last / take_last joined drop / take as lowered range members, and with ranges they add 3 string-matched names to lower/call.rs. Reverse: give V.ranges its own position type (Piece<V>) and convert at the index; move the range members into std bodies once a Range<D> method can overload a Seq one, and lower the baseline. The for r in V.ranges lowering grew the capped crates/cpl-ir/src/lower/stmt.rs from 6398 to 6431 lines (baseline raised with --update rs_over_cap); reverse by moving the domain-iteration lowerings (V.pairs, V.ranges) into their own module.