ERights Home elang / kernel 
Back to: List Pattern x On to: Auditors

Cdr Pattern


Matches only if the specimen is a list of at least the size of the left-hand list pattern, and the parts of the list match the corresponding subpatterns of the pattern.

To match, the list must have at least as many elements as the patterns between the square brackets on the left. Should these initial elements match, a tuple of the remaining elements is then matched against the rest pattern. Only if all these patterns successfully match does the tuple pattern as a whole match.

BNF:
listPattern "+" pattern
XML DTD:
<!ELEMENT cdrPattern (listPattern, %pattern;)>
Java:
 
Example:
see matchBindExpr
in Kernel-E:
 
in XML:
 
in Java:
 

The normal E left to right scoping and execution rules apply. Each pattern may use variables defined by patterns to its left, and all variables defined by any of these patterns are variables defined by the tuple pattern as a whole.
 
Unless stated otherwise, all text on this page which is either unattributed or by Mark S. Miller is hereby placed in the public domain.
ERights Home elang / kernel 
Back to: List Pattern x On to: Auditors
Download    FAQ    API    Mail Archive    Donate

report bug (including invalid html)

Golden Key Campaign Blue Ribbon Campaign