SRFI 257: Simple extendable pattern matcher with backtracking

by Sergei Egorov

status: draft (2024-12-29)

keywords: Pattern Matching

See also SRFI 200: Pattern Matching, SRFI 204: Wright-Cartwright-Shinn Pattern Matcher, and SRFI 241: Match — Simple Pattern-Matching Syntax to Express Catamorphisms on Scheme Data.

Abstract

Pattern matching extends Scheme's repertoire of conditional constructs, allowing decomposition of compound data structures and binding their parts to variables. This SRFI proposes one such construct, match, which provides all common-denominator functionality described in SRFI-200, adding on top of it support for non-linear patterns and backtracking. Also, the proposed construct is modular, and allows for convenient extension via the define-match-pattern mechanism.