Design decisions

213. Indexed.at(k) takes a key; positional walks use nth (2026-11-22)

  • Decision. R12's Indexed.at(k: K) is s[k], and R05.6.3 says a[i] = 5 is a.at(i) = 5, but std.seq bodies (select, zip, merge_sorted, next_permutation, the partitions, radix_sort) used .at(i) as a 0-based walk offset. One meaning wins: .at is a key everywhere (R12.4.13), and generic code that counts from 0 reads with .nth(i). On w = s[2..], w.at(2) is s[2] and w.at(0) traps, as w[0] does. A key-shaped name for a positional read would make w.at(k) and w[k] disagree on every view.
  • Reverse. Define at as the walk offset, rename the trait method (get), and rewrite R05.6.3 and R12.4.13.