Liking cljdoc? Tell your friends :D

pattern.match


matchclj

(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.
sourceraw docstring

match-listclj

(match-list matchers)
source

match-oneclj

(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.
sourceraw docstring

match-segmentclj

(match-segment var)
source

match-varclj

(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).
sourceraw docstring

pattern->matcherclj

(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.
sourceraw docstring

segment-reference?clj

(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 `*`
sourceraw docstring

variableclj

(variable x)

Return the variable contained in a variable or segment reference form

Return the variable contained in a variable or segment reference
form
sourceraw docstring

variable-reference-with-predicate?clj

(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
sourceraw docstring

variable-reference?clj

(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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close