15. Calls made fixing the prototype bugs of scout batches 5 to 12 (2026-11-20)
Bug fixes only: no syntax was added. Each rule below is the reading the
scouts expected and is locked by a test under crates/cpl-cli/tests/cases/.
-
15.1
printevaluates all its arguments before it writes. Arguments are evaluated left to right, and nothing is written until the last one has its value. A later argument that asks the judge or prints is then on its own line, before this one:print("!", best(r, c)) // best may `ask`; its question is not written after the "!"
- 15.2 A range is a value: its ends are read once.
for i in 0..xs.lengoes over the positionsxshad when the loop started, whatever the body pushes or pops.proto/cpialready did this;proto/cpcre-read the end at every step.
- 15.3
@memoover a large product stores only what is asked. A dense table has one slot per point of the parameters' domains. Past 2^26 slots at the domains' declared maximum sizes the function is hashed, as@memo(hash)is;into:andorder:, which need the table, are then a compile error that gives the size.
-
15.4 Destructuring owns what it binds.
let (a, b) = xs[i], the value anif letunwraps and the subject of amatchare copies. They were C++ references into the list, so axs.push(...)in the same block read freed memory (scout batch 12). Reading through a view of a container stays the job oflends.let (a, b) = xs[i] xs.push((a + 1, b)) // fine: a and b are values
- 15.5 A record of hashable fields is hashable.
Numbers, positions,
Bool,Charand records of them can key aHashMaporHashSet; any other key is a compile error.
- 15.6 A
gen:function's value is written asread()reads it. One format per type, shared by the default generator andgen:: a list after its length, a table row by row.
- 15.7 A generic function is only called.
f<P>(x)parses as two comparisons, so naming a generic function outside a call is an error that says so. How a type argument is written out,f::<P>(x)(2.13), is not in the prototype yet.
- 15.8
MinHeap<T>()takes no arguments.by:was accepted and ignored; it is an error until a heap with an order is designed.
- 15.9 An input that is not what the type says stops the run.
A word where a number is expected stops a local run; it was read as 0.
An enum with no fields and no
@tagshas no written form, so reading one is a compile error that gives the@tags(...)line to add; it was read as a number, which made every cell the first variant.
- 15.10 A declared type takes its name.
struct SegTree:orstruct Dsu:in a program is that program's type from the declaration on; the built-in of the same name is not consulted (it crashed the compiler). A built-in type written without its type arguments,ListforList<Int>, is a compile error that gives the form.
- 15.11
?Tis ordered whereTis, none first (superseded by 16.9). This was a C++-codegen stopgap in6f113c3so records with an optional field compiled underg++, whilea < bon two optionals stayed an error. §16.9 replaces this with one coherent rule:?Tdoes not implementOrd, and structs deriveOrdonly when every field implementsOrd.
- 15.12
var (a, b) = ...declares vars; a tuple is not assigned to (resolved by 16.9). The names of avarpattern are vars, as the one name ofvar a = ...is; they were constants.(a, b) = (b, a + b)built and assigned to a temporary, so7d1c976turned it into a compile error pending the language pass; §16.9 locks parallel tuple assignment(a, b) = (x, y)into v2.