PatternMatchable SΒΆ
patmatch1.spad line 165 [edit on github]
S: SetCategory
A set R
is PatternMatchable over S
if elements of R
can be matched to patterns over S
.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- latex: % -> String
from SetCategory
- patternMatch: (%, Pattern S, PatternMatchResult(S, %)) -> PatternMatchResult(S, %)
patternMatch(expr, pat, res)
matches the patternpat
to the expressionexpr
. res contains the variables ofpat
which are already matched and their matches (necessary for recursion). Initially, res is just the result of new which is an empty list of matches.