SRFI 202: Pattern-matching Variant of the and-let* Form that Supports Multiple Values

by Panicz Maciej Godek

status: final (2020-11-28)

keywords: Binding, Control Flow, Pattern Matching

See also SRFI 2: AND-LET*: an AND with local bindings, a guarded LET* special form and SRFI 200: Pattern Matching.


The SRFI-2 library introduced the and-let* form for short-circuited evaluation in the style of the and form, with the ability to capture the (non-#f) results in the style of the let* form. This document extends the and-let* form with the ability to pattern-match (or "destructurally bind") the values of evaluated expressions (where the match failure causes short-circuiting rather than raising an error) and the ability to handle multiple values (where only the falsehood of the first value causes short-circuiting).