| 6.1 | File as function body | Settled | top-level fns see the body's lets; calling before the lets are set is an error | | plan/15-program-structure.md §2 |
| 6.2 | Program vs library mode | Settled | decided by contents; use accepts only libraries | | plan/15-program-structure.md §2.4 |
| 6.3 | Multitest | Revised 2026-11-20 (0.2.2) | @!multitest is a standalone top-level divider: statements above it run once (precomputation), statements below it run once per test case (the count is read automatically; @!multitest(until_eof) reads to end of input), each case in a fresh scope with @memo caches reset. Single-test and multitest files are both flat top-level statements; no fn solve() wrapper. @! marks a file-level directive in force from its line down; @ always decorates the one item below it. Top-level return ends the program, or the current test case below the divider. @spec / @checker read the top-level input lets the same way in both modes | 6.1 | §16, §19.3, §20 |
| 6.4 | Modules beyond pub | Open | re-exports, private-to-folder, name clashes | | plan/40-tooling.md |
| 6.5 | Parts and purity | Settled | any fn is a part; tools record I/O; no pure keyword | | plan/15-program-structure.md §4 |
| 6.6 | Brutes, checkers, interactors | Revised 2026-11-20 (v2.2) | @brute, @checker (inherits input bindings, uses read_output() + assert), @interactor fn judge(sol: Interactor): (read() = hidden test, sol.recv() = sol stdout, sol.send(...) = sol stdin; paired with ask(..., limit: K), and print() auto-flushes whenever ask() is used) | 3.11 | §16, §19.8 |
| 6.7 | Staying under 64 KB | Locked v2.2 (2026-11-20) | Tree-shake all runtime/stdlib helpers and strip CP_GEN/debug/@brute in judge builds (target 4–10 KB typical, always < 64 KB) | 3.2 | §16, §19.1, research/perf/max-n-judge-audit-1.md |
| 6.8 | Grader-style (IOI) problems | Revised 2026-11-20 (v2.2) | @grader without new keywords: bodyless @grader fn = extern oracle (callable inside @memo), @grader fn with body = exported entry, top-level var or @grader struct = stateful grader; array params may size off sibling Int params left or right. @grader const and uninitialized file-scope grader domains deleted | 3.11, 6.1 | §16, §18.10, §19.3, §19.9 |
| 6.9 | Top-level var | Locked v2 (2026-11-20) | allowed; any nested fn declared after a var reads/writes it directly (5.10) | 5.10 | §16 |