← Back to AILP Home

Special Values Cookbook

This subsection of the guide is a focused, example-driven reference for Nitpick's special-value surface as it stands at the close of the v0.31.9.x sub-cycle (Phase 3 of the v0.31.x cycle, runtime-taint arc).

A special value is a typed inhabitant whose meaning is "the absence or the impossibility of the ordinary value": Nitpick recognises four of them, and each pairs with a specific type shape.

The four special values

Special value Pairs with Meaning Cookbook chapter
NIL Optional<T>, NIL-shaped slots "value-side absence" nil-and-null.md
NULL Pointer<T> (T->) "pointer-side absence" nil-and-null.md
ERR tbb8 / tbb16 / tbb32 / tbb64 "arithmetic failure sentinel" tbb-err.md
unknown any binding (via taint) "value was never determined" unknown-and-ok.md

Each is enforced at compile time by the type checker; mixing them across type kinds is a hard error with a "did you mean the other one?" hint (D-15 in META/NITPICK/ROADMAP/0.31/AUDIT_v0.31.2.0.md).

Chapters

  1. Immutability — fixed vs const — the Nitpick-side immutability qualifier (fixed) and the extern-only const qualifier; ARIA-044; comptime-fold interaction.
  2. NIL and NULL — value-side vs pointer-side absence; assignment rules at both the var-decl site and at statement-level =.
  3. tbb and ERR — the tbb sentinel bit pattern, sticky semantics on arithmetic / comparison / bitwise ops, and the D-16a "no bool ERR" convention.
  4. unknown and ok(...) — the unknown literal, how Symbol::mayBeUnknown taints a binding, when you must wrap with ok(val), and ARIA-045.
  5. Result<T> and fail — the implicit Result<T> wrap on every body-bearing Nitpick function, pass val vs fail(code), the .is_error / .value / .error_code accessors, and the D-20 "value reads as NIL on failure" rule.
  6. pick exhaustiveness for special values — how the exhaustiveness checker treats Optional NIL, Pointer NULL, tbb ERR, and unknown-tainted selectors; the wildcard (*) escape hatch.
  7. Runtime taint and T?unknown — how the is unknown boolean test, the callee-summary path, and the declared T?unknown return-flow marker interact at runtime. Landed across v0.31.9.1–v0.31.9.5.

Each chapter is short and self-contained.

Conventions used in these chapters

Validation status (v0.31.9.6)

Scope and non-scope

In scope as of Phase 3 + v0.31.9.x sub-cycle:

Not yet in scope (deferred to a future cycle):