Design decisions

290. Descending order is a key, desc(x); sort/sorted lose desc: Bool (2026-11-22)

  • Decision. One spelling: xs.sorted(by: x => desc(x)), and mixed orders like by: c => (c.start, desc(c.end)). Decided by its recommendation under Ryan's rule that reversible calls are ours. std-seq/sort-sorted-last.cp now uses the key; stdlib drops the flag from spec/std/seq.cp.
  • Why. Chapter 7 already says descending is a key; a flag can't express mixed orders, and 9 of the 100 hill-climb spec.cp files use desc(), none the flag.
  • Reverse. Re-add desc: Bool = false to sort and sorted.