Appendix A

Practice Index

Looking for where a specific practice or language feature shows up in this book, rather than reading a project's whole chapter for it? Start here.

PracticeWhere it's exercised
require / ensureThroughout, first as the CLI's own boundary in Ch. 1; a precondition/postcondition pair guarding an evaluator in Ch. 4.
Class invariantCh. 3 — the entire specification of a generic LRU cache.
old in a postconditionCh. 2Task_Store.add's ensure grew: tasks.length = old tasks.length + 1.
Refinement types (declare type ... where)Ch. 2Priority, checked at a constructor boundary.
union + exhaustive matchCh. 2 (Task_Status, Hub_Event in Ch. 6); Ch. 4 — a full AST (Expr).
Detachable types (?T)Ch. 2 (Task_Store.find), Ch. 3 (a cache miss), Ch. 6 (end of stream).
Generics ([K, V])Ch. 3Lru_Cache [K, V].
intern and the module-naming constraintEvery chapter; the naming rule itself discussed in Ch. 5.
do ... rescue ... endCh. 4 (division by zero, undefined variables), Ch. 7 and Ch. 9 (turning a caught failure into an HTTP error response).
Process and command-line argumentsCh. 1.
io/Path, io/DirectoryCh. 1, Ch. 2, Ch. 5 (recursive tree walking), Ch. 9.
text/RegexCh. 1 (word splitting), Ch. 4 (tokenizing), Ch. 7 and Ch. 9 (a targeted response-field extraction workaround).
data/JsonCh. 2 (persistence + schema migration), Ch. 7, Ch. 9.
Task, spawn, await_allCh. 5 — the book's clearest fan-out/fan-in; also Ch. 6, Ch. 9.
Task.await(ms), Task.cancel()Ch. 5 — a worked, separate illustration.
Channel[T]Ch. 6 — the single-owner-no-locks hub design.
net/Tcp_Socket, net/Server_SocketCh. 6.
net/Http_Server, net/Http_ClientCh. 7, Ch. 9.
Java interop — import, with "java" do ... end, inherit a Java interfaceCh. 8 — the book's only crossing into the host platform; reused in Ch. 9's dashboard.
Integration testing against real infrastructure (real sockets, a real server, a real HTTP client) rather than mocksCh. 6, Ch. 7, Ch. 9.