Skip to content

Patternia v0.5.2 Release Note

Release Date: December 10, 2025 Version: 0.5.2


Overview

Patternia v0.5.2 introduced the wildcard pattern _ and clarified the fallback rules that still define the library today.

This historical page has been normalized to the current pipeline API. The original release note used the removed chained builder syntax.


Highlights

Wildcard Fallback

ptn::_ was introduced as the catch-all pattern for the final case in a match.

using namespace ptn;

const char *label(int value) {
  return match(value) | on(
    lit(0) >> "zero",
    _ >> "other"
  );
}

First-Match Semantics

  • Cases are evaluated in order.
  • The first matching case wins.
  • _ matches any subject and binds nothing.

Design Direction

This release established a direction that remains valid after later API cleanup:

  • Fallback behavior belongs in the case list.
  • Matching stays expression-oriented.
  • Wildcard usage should be explicit and visible.

What Still Matters

  • Prefer a final _ case when you need a total match.
  • Keep the wildcard last so earlier cases stay reachable.
  • Treat _ as a pattern-level fallback, not as a binding form.

Historical Note

The original v0.5.2 note documented the old chained builder flow. That surface has since been removed from the repository. Current code should use match(subject) | on(...) instead.