PatternMatchAssertionsΒΆ
expr.spad line 1041 [edit on github]
Attaching assertions to symbols for pattern matching. Date Created: 21 Mar 1989
- constant: Symbol -> Expression Integer
constant(x)tells the pattern matcher thatxshould match only the symbol'xand no other quantity.
- multiple: Symbol -> Expression Integer
multiple(x)tells the pattern matcher thatxshould preferably match a multi-term quantity in a sum or product. For matching on lists, multiple(x) tells the pattern matcher thatxshould match a list instead of an element of a list.
- optional: Symbol -> Expression Integer
optional(x)tells the pattern matcher thatxcan match an identity (0 in a sum, 1 in a product or exponentiation).