← Back to AILP Home

Result Handling Cookbook

This subsection is the canonical v0.33.6 guide for Nitpick's Result<T> handling surface. It supersedes older scattered notes in guide/types/result.md, guide/functions/result_system.md, and guide/operators/result_operators.md where those pages disagree with the v0.33.x audits.

The v0.33.x cycle locked the shipped behavior of every Result-family operator and keyword: pass, fail, ?, ??, ?!, ?|, defaults, drop, raw, _?, _!, safe navigation, and contextual catch.

Chapters

  1. Cheatsheet — one-page table for every Result, Optional/null, shorthand, and contextual handler surface.
  2. Pass and fail — implicit Result<T> returns, pass, fail, Result<NIL>, and nested call frames.
  3. ? fallback unwrapexpr ? fallback, nested explicit fallback, and await parser shape.
  4. ?? and ?. — Optional/pointer null coalescing and safe navigation; not Result error handling.
  5. defaults and ?| — scoped fallback for expression chains and the primary-expression fallback rule.
  6. ?! emphatic fallback — Result-only fallback unwrap with emphatic spelling; no source-level failsafe dispatch.
  7. raw, drop, _!, _? — explicit unwrap/discard surfaces and shorthand operand-shape details.
  8. Contextual catchresult catch (err) { handler }, error binding scope, and identifier compatibility.
  9. Diagnostics and validation — common errors, decision IDs, bug fixtures, K coverage, and v0.33.6 counters.

Quick mental model

Validation snapshot (v0.33.6)