Content deleted Content added
Introduce section on terminology relating to pattern matching. |
m →External links: HTTP to HTTPS for Cornell University |
||
(4 intermediate revisions by 4 users not shown) | |||
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
: Often written as a single underscore, <code>_</code>, the wildcard pattern accepts all values without examining them further, ignoring their structure. Also known as '''discard''', the '''wild pattern''', the '''catch-all pattern''', or as a '''hole'''.
; [[Guard (computer science)|Guard]]
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
Line 314:
*[https://archive.today/19990225161739/http://www.haskell.org/development/views.html Views: An Extension to Haskell Pattern Matching]
* Nikolaas N. Oosterhof, Philip K. F. Hölzenspies, and Jan Kuper. [https://web.archive.org/web/20060304053330/http://wwwhome.cs.utwente.nl/~tina/apm/applPatts.pdf Application patterns]. A presentation at Trends in Functional Programming, 2005
*[
*[https://archive.today/20130630081135/http://www.showtrend.com/ ShowTrend]: Online pattern matching for stock prices
*[https://web.archive.org/web/20060211020429/http://cm.bell-labs.com/cm/cs/who/dmr/qed.html An incomplete history of the QED Text Editor] by [[Dennis Ritchie]] - provides the history of regular expressions in computer programs
|