Content deleted Content added
m Reverted edit by RedactedUser15 (talk) to last version by Leastfixedpoint |
m →Terminology of patterns: {{code}} |
||
Line 46:
; [[Name binding|Binding]]
: A way of associating a ''name'' with a portion of the discriminant, so that the name is [[Name binding|bound to]] that portion when the continuation executes. For example, in Rust,
; Wildcard
Line 55:
; Predicate
: Some pattern languages allow user-defined ''predicate'' functions to be embedded in a pattern. The predicate is applied to the portion of the discriminant corresponding to the position of the predicate in the pattern; if the predicate responds with boolean false, the pattern is considered to have failed. For example, in Racket, the pattern
; View pattern
Line 61:
; Constraint
: Some pattern languages allow direct comparison of portions of the discriminant with previously-computed (or constant) data structures. For example, the pattern
; Literal pattern; atomic pattern
|