Design decisions

185. Rebuild holes, batch 3: reading, patterns, small grammar (2026-11-21)

  • Decision. read<Range<V>>() reads l r as l..=r; [m] in a domain declaration means 0..m; an integer enum tag compares as a number; the default io.answers is ("YES", "NO"). A record pattern without .. is closed (must name every field). A product position is a tuple: let (r, c) = p and p.0 work. Tuples and records derive +, - and Zero fieldwise. add is the prelude name of + as a value, and every act:/op: takes any operation value. With act:, segment-tree nodes are Int unless annotated. Dropping a non-unit result is a lint (unused-result) unless the fn is @droppable; dropping a ?T stays an error. name<...>( opens type arguments for lowercase names. One-line if c: s1 else: s2 is a statement. A range type in [D] position may have signed ends. x min= e is a condition through cond. std/prelude.cp is the authoritative prelude. take() exists only on types with an empty value; replace(x) covers the rest.
  • Why. Holes H-RANGE-READ, H-DOMAIN-COUNTED-DECL, H-ENUM-TAG-INT, H-YES-WORDS, H-ROW-PATTERN, H-PRODUCT-DESTRUCTURE, H-RECORD-MONOID, H-OP-NAMES, H-NODE-WIDTH-ACT, H-DROPPED-RESULT, H-LOWER-GENERIC-ARGS, H-INLINE-IF-STMT, H-NEG-RANGE-TYPE, H-MINEQ-COND, H-PRELUDE-MEMBERSHIP and H-TAKE-DEFAULT. Each pick is the rebuild agent's own guess where it was reasonable (it is the reading a fresh contestant makes), except two: patterns are closed so a new arc field can't silently change a match, and take() has no invented Default trait.
  • Reverse. Per item; open patterns and a Default trait are the two real alternatives.