|
|
|
|
|
by gergo_barany
722 days ago
|
|
> I'd say that "pattern matching" is unification, where there are no free variables on the right side and the left side is the "pattern" to match. Plus the restriction that the left hand side must be linear, that is, must not contain any variable more than once. So you usually can't write a pattern match like match list with
| [x, y, x] -> ...
but languages with pattern matching usually allow you to add side conditions like this: match list with
| [x, y, x'] if x = x' -> ...
|
|