patmatch1.spad line 879 [edit on github]
This package provides the top-level pattern matching functions.
Is(expr, pat)
matches the pattern pat on the expression expr
and returns a list of matches [v1 = e1, ..., vn = en]
; returns an empty list if either expr
is exactly equal to pat or if pat does not match expr
.
Is(expr, pat)
matches the pattern pat on the expression expr
and returns a list of matches [v1 = e1, ..., vn = en]
; returns an empty list if either expr
is exactly equal to pat or if pat does not match expr
.
Is([e1, ..., en], pat)
matches the pattern pat on the list of expressions [e1, ..., en]
and returns the result.
Is(expr, pat)
matches the pattern pat on the expression expr
and returns a match of the form [v1 = e1, ..., vn = en]
; returns an empty match if expr
is exactly equal to pat. returns a failed match if pat does not match expr
.
is?(expr, pat)
tests if the expression expr
matches the pattern pat.
is?([e1, ..., en], pat)
tests if the list of expressions [e1, ..., en]
matches the pattern pat.