| Practice | Where it's exercised |
|---|---|
require / ensure | Throughout, first as the CLI's own boundary in Ch. 1; a precondition/postcondition pair guarding an evaluator in Ch. 4. |
Class invariant | Ch. 3 — the entire specification of a generic LRU cache. |
old in a postcondition | Ch. 2 — Task_Store.add's ensure grew: tasks.length = old tasks.length + 1. |
Refinement types (declare type ... where) | Ch. 2 — Priority, checked at a constructor boundary. |
union + exhaustive match | Ch. 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. 3 — Lru_Cache [K, V]. |
intern and the module-naming constraint | Every chapter; the naming rule itself discussed in Ch. 5. |
do ... rescue ... end | Ch. 4 (division by zero, undefined variables), Ch. 7 and Ch. 9 (turning a caught failure into an HTTP error response). |
Process and command-line arguments | Ch. 1. |
io/Path, io/Directory | Ch. 1, Ch. 2, Ch. 5 (recursive tree walking), Ch. 9. |
text/Regex | Ch. 1 (word splitting), Ch. 4 (tokenizing), Ch. 7 and Ch. 9 (a targeted response-field extraction workaround). |
data/Json | Ch. 2 (persistence + schema migration), Ch. 7, Ch. 9. |
Task, spawn, await_all | Ch. 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_Socket | Ch. 6. |
net/Http_Server, net/Http_Client | Ch. 7, Ch. 9. |
Java interop — import, with "java" do ... end, inherit a Java interface | Ch. 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 mocks | Ch. 6, Ch. 7, Ch. 9. |
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.