6 Pattern Matching
This module provides tools for pattern matching with match.
Returns #t if the result of val-expr matches any of
pat, and returns #f otherwise.
Defines pat-id as a match expander that takes one pattern argument per
field of the structure described by struct-id. The resulting match
expander recognizes instances of the structure and matches their fields against
the corresponding patterns.
|(as ([lhs-id rhs-expr] ...) pat ...)|
As a match expander, binds each lhs-id as a pattern variable with the
result value of rhs-expr, and continues matching each subsequent
|($ struct-id expr ...)|
|($ struct-id pat ...)|
As an expression, constructs an instance of the structure described by
struct-id with fields specified by each expr.
As a match expander, matches instances of the structure described by
struct-id with fields matched by each pat.
| > ($ pair 1 2)|
(pair 1 2)