(match matcher data)
(match matcher data predicate)
Convenience function for applying a match combinator to some data. Primes the process with an empty frame and supplies a continuation which will return the pattern bindings if the match is successful, nil otherwise. If predicate is supplied, then the resulting frame of a match must satisfy this predicate; otherwise we continue searching.
Convenience function for applying a match combinator to some data. Primes the process with an empty frame and supplies a continuation which will return the pattern bindings if the match is successful, nil otherwise. If predicate is supplied, then the resulting frame of a match must satisfy this predicate; otherwise we continue searching.
(match-list matchers)
(match-one thing)
Combinator which succeeds iff the head of the data is equal to thing. The frame is not modified.
Combinator which succeeds iff the head of the data is equal to thing. The frame is not modified.
(match-segment var)
(match-var var)
(match-var var predicate?)
If the variable is not bound in the frame, and there is more matchable data (that satisfies the optional constraint predicate), this combinator will succeed by consuming the next item in the data and produces a frame in which the data seen is bound to the pattern variable. If the variable is bound, then the value seen must match the binding to succeed (the frame is not modified in this case).
If the variable is not bound in the frame, and there is more matchable data (that satisfies the optional constraint predicate), this combinator will succeed by consuming the next item in the data and produces a frame in which the data seen is bound to the pattern variable. If the variable is bound, then the value seen must match the binding to succeed (the frame is not modified in this case).
(pattern->matcher pattern)
Given a pattern (which is essentially a form consisting of constants mixed with pattern variables) returns a match combinator for the pattern.
Given a pattern (which is essentially a form consisting of constants mixed with pattern variables) returns a match combinator for the pattern.
(segment-reference? x)
True if x is a segment reference (i.e., it looks like (:?? ...))
or is a keyword ending in *
True if x is a segment reference (i.e., it looks like (:?? ...)) or is a keyword ending in `*`
(variable x)
Return the variable contained in a variable or segment reference form
Return the variable contained in a variable or segment reference form
(variable-reference-with-predicate? x)
True if x is a variable reference and is also equipped with a constraint on matched values
True if x is a variable reference and is also equipped with a constraint on matched values
(variable-reference? x)
True if x is a variable reference (i.e., it looks like (:? ...)) or is a simple keyword
True if x is a variable reference (i.e., it looks like (:? ...)) or is a simple keyword
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close