Design decisions

93. One-spelling syntax rulings & position/range/enum ergonomics (2026-11-21)

  1. Built-in MemberKind::Get properties (len, is_empty, first, last, rev, items) are read without parentheses (xs.len, not xs.len()).
    • Reason: One spelling per idea. Calling a built-in getter with empty () now fails cpl check (E0306 with fix-it) and triggers L0206 (getter_parens) in cpl fix. Removed the temporary zero-arg compatibility arm and the special rev() arm in cpl-check.
    • Reverse: Restore the zero-arg Get compatibility in crates/cpl-check/src/check/call.rs and remove L0206 from crates/cpl-lint.
  2. Comprehension/generator/loop filters use if only; power uses ** only; multitest uses @!multitest only.
    • Reason: One spelling per idea. Removed where filter guards and --- multitest --- / --- with multitest() --- wrap lines from cpl-syntax (E0503 with machine-applicable fixes applied by cpl fix), moved Mod<P>.pow / Mat<T>.pow onto impl Pow with .pow(...) rejected in cpl-check and codemodded by L0205 (pow_method), and kept ^ strictly as bitwise xor.
    • Reverse: Re-enable the removed parser branches in crates/cpl-syntax, restore .pow on Mod<P>/Mat<T>, and drop L0205.
  3. Position p.back(k) / p.ahead(k) -> ?D, Range<T>.drop(k) / .take(k) -> Range<T>, and enum is / if let variant patterns (phase is Seeking, Split(base)).
    • Reason: Accepted from dream rewrites (cf2150g et al.). ahead(k)/back(k) lower via Builtin::PosOffset beside prev/next; Range<T>.drop(k)/.take(k) clamp k to [0, max(0, hi - lo)] without overflow; Cond::Let in cpl-ir dispatches PatternKind::Variant on Ty::Enum through self.pattern (IsVariant + Payload) so phase is Seeking and payload match agree in interpreter and C++17.
    • Reverse: Remove the ahead/back/drop/take arms in crates/cpl-check/src/check/expr.rs and crates/cpl-ir/src/lower/call.rs, and revert cond_let in crates/cpl-ir/src/lower/stmt.rs.