165. read/print signatures are written down, output mirrors input, and wire.ask is one query (2026-11-21)
- Decision. Chapter 10.5 gives the exact forms of the core
read,read_lineandprint(sep:,end:,none:,precision:), because those functions have no stub. Output mirrors input shape for shape, but never writes counts for you:[R, C]Charprints rows without separators, other 2-D shapes print one row per line, and[Pair<V>]Tprints its lower triangle.?Tis notPrint, so absent values print only throughnone:.Wire.ask<T>(query: Str) -> Tprints a query line, flushes, and reads the answer as the expected type. - Why. Ryan asked how I/O works, and the answer showed holes: the signatures existed only in
prose, output shapes for grids and nested lists were unspecified, and both interactive
problems in the hill-climb (cco18p4, yac6p3) had blind dreams that wrote a one-call query
(
wire.ask("? {x} {y}", read Int),query(...)) while their ports spent three lines on print-then-read. Withask, a query function is one line. - Reverse. Remove
Wire.askfromspec/std/io.cpand section 10.5 and the output-shape bullet from chapter 10, and restore the print-then-read bodies in the two ports.