2. Pattern Matching
Description of Letlang's pattern matching mechanism
Variables are bound to values through the pattern matching mechanism.
Pattern matching occurs when evaluating a
match expression, a
intercept expression and a match operator (
In a pattern matching, a left-hand side pattern is matched against a right-hand side expression. If the matching succeeds, any unbound variables in the pattern become bound. If the matching fails, a run-time error occurs.