Liking cljdoc? Tell your friends :D
Clojure only.

clojure.core.match


*backtrack-stack*clj

source

*clojurescript*clj

source

*line*clj

source

*locals*clj

source

*match-lookup*clj

Allow map matching syntax to check for IMatchLookup

Allow map matching syntax to check for IMatchLookup
sourceraw docstring

*no-backtrack*clj

Flag to optimize performance over code size.

Flag to optimize performance over code size.
sourceraw docstring

*recur-present*clj

In the presence of recur we cannot apply code size optimizations

In the presence of recur we cannot apply code size optimizations
sourceraw docstring

*root*clj

source

*syntax-check*clj

Enable syntax check of match macros

Enable syntax check of match macros
sourceraw docstring

*vector-type*clj

Default vector type. Can be rebound allowing emission of custom inline code for vector patterns, for example type-hinted primitive array operations

Default vector type. Can be rebound allowing emission of
custom inline code for vector patterns, for example
type-hinted primitive array operations
sourceraw docstring

*warned*clj

source

action-for-rowclj

(action-for-row {rows :rows} j)
source

all-wildcards?clj

(all-wildcards? prow)
source

analyzeclj

(analyze form env)
source

app-patternclj

(app-pattern p form)
source

app-pattern-matrix-ocrsclj

(app-pattern-matrix-ocrs [focr :as ocrs] form)
source

app-pattern?clj

(app-pattern? x)
source

array-tagclj

(array-tag x)
source

as-patternclj

source

backtrackclj

Pre-allocated exception used for backtracing

Pre-allocated exception used for backtracing
sourceraw docstring

backtrack-exprclj

(backtrack-expr)
source

backtrack-symclj

(backtrack-sym)
source

bind-nodeclj

(bind-node bindings node)
source

bind-variablesclj

(bind-variables ocrs)
source

BindNodeclj

source

calc-rest?-and-min-sizeclj

(calc-rest?-and-min-size rows env)
source

casesclj

(cases matrix)
source

catch-errorclj

(catch-error & body)
source

check-matrix-argsclj

(check-matrix-args vars clauses)
source

check-patternclj

(check-pattern pat vars nvars rownum)
source

check-size?cljmultimethod

source

choose-columnclj

(choose-column matrix)
source

clj-formclj

(clj-form vars clauses)
source

columnclj

(column {rows :rows} i)
source

column-splitterclj

(column-splitter col)
source

compileclj

(compile {:keys [rows ocrs] :as pm})
source

constructor?clj

(constructor? p)
source

constructors-above?clj

(constructors-above? pm i j)
source

count-inlinecljmultimethod

source

dag-clause-to-cljclj

(dag-clause-to-clj occurrence pattern action)
source

default-caseclj

(default-case matrix)
source

default-specialize-matrixclj

(default-specialize-matrix p matrix)
source

defpredcljmacro

(defpred name)
(defpred name f)
source

dimclj

(dim pm)
source

drop-nth-bindclj

(drop-nth-bind prow n ocr)
source

emit-matrixclj

(emit-matrix vars clauses)
(emit-matrix vars clauses default)

Take the list of vars and sequence of unprocessed clauses and return the pattern matrix. The pattern matrix contains the processed pattern rows and the list of vars originally specified. Inserts a last match - :else if provided by the user or a default match that throws.

Take the list of vars and sequence of unprocessed clauses and
return the pattern matrix. The pattern matrix contains the processed
pattern rows and the list of vars originally specified. Inserts
a last match - :else if provided by the user or a default match that
throws.
sourceraw docstring

emit-patterncljmultimethod

Returns the corresponding pattern for the given syntax. Dispatches on the class of its argument. For example, [(:or 1 2) 2] is dispatched as clojure.lang.IPersistentVector

Returns the corresponding pattern for the given syntax. Dispatches
on the class of its argument. For example, `[(:or 1 2) 2]` is dispatched
as clojure.lang.IPersistentVector
sourceraw docstring

emit-pattern-for-syntaxcljmultimethod

Handles patterns wrapped in the special list syntax. Dispatches on the first or second keyword in the list. For example, the pattern (:or 1 ...) is dispatches as :or, and(1 :as a)` is dispatched by :as.

Handles patterns wrapped in the special list syntax. Dispatches
on the first or second keyword in the list. For example, the pattern 
`(:or 1 ...) is dispatches as :or, and `(1 :as a)` is dispatched by :as.
sourceraw docstring

emit-patternsclj

(emit-patterns ps t)
(emit-patterns ps t v)
source

empty-matrix?clj

(empty-matrix? pm)
source

empty-row?clj

(empty-row? row)
source

empty-rows-caseclj

(empty-rows-case)

Case 1: If there are no pattern rows to match, then matching always fails

Case 1: If there are no pattern rows to match, then matching always fails
sourceraw docstring

executable-formclj

(executable-form node)
source

existential-pattern?clj

(existential-pattern? x)
source

expand-matrixclj

(expand-matrix matrix col)
source

expression?clj

(expression? ocr)
source

fail-nodeclj

(fail-node)
source

FailNodeclj

source

find-duplicate-wildcardsclj

(find-duplicate-wildcards pattern)
source

first-column-chosen-caseclj

(first-column-chosen-case matrix col ocrs)

Case 3a: The first column is chosen. Compute and return a switch/bind node with a default matrix case

Case 3a: The first column is chosen. Compute and return a
switch/bind node with a default matrix case
sourceraw docstring

first-column?clj

(first-column? i)
source

first-row-empty-caseclj

(first-row-empty-case rows ocr)

Case 2: If the first row is empty then matching always succeeds and yields the first action.

Case 2: If the first row is empty then matching always succeeds 
and yields the first action.
sourceraw docstring

first-row-wildcards-caseclj

(first-row-wildcards-case rows ocrs)

Case 2: If the first row is constituted by wildcards then matching matching always succeeds and yields the first action.

Case 2: If the first row is constituted by wildcards then matching
matching always succeeds and yields the first action.
sourceraw docstring

gen-map-pattern-ocrclj

(gen-map-pattern-ocr ocr k)
source

get-all-keysclj

(get-all-keys rows env)
source

get-loop-localsclj

(get-loop-locals)
source

get-ocr-mapclj

(get-ocr-map p {:keys [only all-keys wc-map]})
source

group-keywordsclj

(group-keywords pattern)

Returns a pattern with pattern-keywords (:when and :as) properly grouped. The original pattern may use the 'flattened' syntax. For example, a 'flattened' pattern row like [a b :when even?] is grouped as [a (b :when even?)].

Returns a pattern with pattern-keywords (:when and :as) properly
grouped.  The original pattern may use the 'flattened' syntax.
For example, a 'flattened' pattern row like [a b :when even?] is
grouped as [a (b :when even?)].
sourceraw docstring

group-rowsclj

(group-rows cs rows)
source

groupable?cljmultimethod

Determine if two patterns may be grouped together for simultaneous testing.

Determine if two patterns may be grouped together for simultaneous
testing.
sourceraw docstring

guard-patternclj

source

guard-pattern?clj

(guard-pattern? x)
source

heightclj

(height {rows :rows})
source

leaf-bind-exprcljmultimethod

source

leaf-nodeclj

(leaf-node value)
(leaf-node value bindings)
source

LeafNodeclj

source

literal-case-matrix-splitterclj

(literal-case-matrix-splitter matrix)
source

literal-patternclj

(literal-pattern l)
source

literal-pattern?clj

(literal-pattern? x)
source

map-key-patternclj

(map-key-pattern p)
source

map-key-pattern?clj

(map-key-pattern? x)
source

map-patternclj

(map-pattern)
(map-pattern m)
source

map-pattern-matrix-ocr-symclj

(map-pattern-matrix-ocr-sym k env)
source

map-pattern-matrix-ocrsclj

(map-pattern-matrix-ocrs ocrs env)
source

map-pattern?clj

(map-pattern? x)
source

MapKeyPatternclj

source

matchcljmacro

(match vars & clauses)

Pattern match a row of occurrences. Take a vector of occurrences, vars. Clause question-answer syntax is like cond. Questions must be wrapped in a vector, with same arity as vars. Last question can be :else, which expands to a row of wildcards. Optionally may take a single var not wrapped in a vector, questions then need not be wrapped in a vector.

Example: (let [x 1 y 2] (match [x y 3] [1 2 3] :answer1 :else :default-answer))

Pattern match a row of occurrences. Take a vector of occurrences, vars.
Clause question-answer syntax is like `cond`. Questions must be
wrapped in a vector, with same arity as vars. Last question can be :else,
which expands to a row of wildcards. Optionally may take a single
var not wrapped in a vector, questions then need not be wrapped in a
vector.

Example:
(let [x 1
      y 2]
  (match [x y 3]
    [1 2 3] :answer1
    :else :default-answer))
sourceraw docstring

match-letcljmacro

(match-let bindings & body)
source

matchmcljmacro

(matchm vars & clauses)

Same as match but supports IMatchLookup when matching maps.

Same as match but supports IMatchLookup when
matching maps.
sourceraw docstring

matchvcljmacro

(matchv type vars & clauses)
source

matrix-splitterclj

(matrix-splitter matrix)
source

named-wildcard-pattern?clj

(named-wildcard-pattern? x)
source

necessary-columnclj

(necessary-column pm)
source

non-local-literal-pattern?clj

(non-local-literal-pattern? p)
source

nth-inlinecljmultimethod

source

nth-offset-inlinecljmultimethod

source

nthnext-inlinecljmultimethod

source

occurrencesclj

(occurrences pm)
source

or-patternclj

source

or-pattern?clj

(or-pattern? x)
source

other-column-chosen-caseclj

(other-column-chosen-case matrix col)

Case 3b: A column other than the first is chosen. Swap column col with the first column and compile the result

Case 3b: A column other than the first is chosen. Swap column 
col with the first column and compile the result
sourceraw docstring

pattern-atclj

(pattern-at {rows :rows} i j)
source

pattern-matrixclj

(pattern-matrix rows ocrs)
source

pattern-rowclj

(pattern-row ps action)
(pattern-row ps action bindings)
source

pattern-scoreclj

(pattern-score pm i j)
source

PatternMatrixclj

source

predicate-patternclj

source

predicate-pattern?clj

(predicate-pattern? x)
source

predsclj

source

process-varsclj

(process-vars vars)

Process the vars for the pattern matrix. If user provides an expression, create a var and annotate via metadata with the original expression.

Process the vars for the pattern matrix. If user provides an
expression, create a var and annotate via metadata with the
original expression.
sourceraw docstring

pseudo-pattern?clj

(pseudo-pattern? x)
source

pseudo-patternsclj

(pseudo-patterns matrix i)
source

recur-present?clj

(recur-present? actions)
source

regroup-keywordsclj

(regroup-keywords pattern)
source

rest-patternclj

(rest-pattern p)
source

rest-pattern?clj

(rest-pattern? x)
source

RestPatternclj

source

return-splitclj

(return-split S D)
source

root-bind-nodeclj

(root-bind-node matrix)
source

rowclj

(row {rows :rows} j)
source

row-bindingsclj

(row-bindings f ocrs)
source

row-keysclj

(row-keys row env)
source

rowsclj

(rows {rows :rows})
source

score-columnclj

(score-column i col)
source

selectclj

(select pm)
source

seq-patternclj

(seq-pattern s)
source

seq-pattern-matrix-ocrsclj

(seq-pattern-matrix-ocrs ocrs focr)
source

seq-pattern-matrix-rest-ocrsclj

(seq-pattern-matrix-rest-ocrs ocrs focr)
source

seq-pattern?clj

(seq-pattern? x)
source

specializeclj

(specialize matrix)
(specialize matrix p)
source

specialize-app-pattern-matrixclj

(specialize-app-pattern-matrix rows form)
source

specialize-guard-pattern-matrixclj

(specialize-guard-pattern-matrix rows)
source

specialize-map-key-pattern-matrixclj

(specialize-map-key-pattern-matrix rows)
source

specialize-map-pattern-matrixclj

(specialize-map-pattern-matrix rows env)
source

specialize-map-pattern-rowclj

(specialize-map-pattern-row row {:keys [all-keys only? focr] :as env})
source

specialize-or-pattern-matrixclj

(specialize-or-pattern-matrix rows pat ps)
source

specialize-or-pattern-rowclj

(specialize-or-pattern-row row pat ps)
source

specialize-predicate-pattern-matrixclj

(specialize-predicate-pattern-matrix rows)
source

specialize-seq-pattern-matrixclj

(specialize-seq-pattern-matrix rows focr)
source

specialize-seq-pattern-rest-matrixclj

(specialize-seq-pattern-rest-matrix rows focr)
source

specialize-seq-pattern-rest-rowclj

(specialize-seq-pattern-rest-row focr row)
source

specialize-seq-pattern-rowclj

(specialize-seq-pattern-row focr row)
source

specialize-vector-pattern-matrixclj

(specialize-vector-pattern-matrix rows env)
source

specialize-vector-pattern-rowclj

(specialize-vector-pattern-row row {:keys [focr min-size]})
source

specialize-vector-pattern-row-non-restclj

(specialize-vector-pattern-row-non-rest row {:keys [focr min-size]})
source

split-matrixclj

(split-matrix matrix)
source

subvec-inlinecljmultimethod

source

switch-nodeclj

(switch-node occurrence cases default)
source

SwitchNodeclj

source

tagcljmultimethod

source

test-inlinecljmultimethod

source

test-with-min-size-inlinecljmultimethod

source

test-with-size-inlinecljmultimethod

source

to-pattern-rowclj

(to-pattern-row pat action)

Take an unprocessed pattern expression and an action expression and return a pattern row of the processed pattern expression plus the action epxression.

Take an unprocessed pattern expression and an action expression and return
a pattern row of the processed pattern expression plus the action epxression.
sourceraw docstring

to-sourcecljmultimethod

Returns a Clojure form that, when executed, is truthy if the pattern matches the occurrence. Dispatches on the type of the pattern. For instance, a literal pattern might return (= ~(:pattern pattern) ~ocr), using = to test for a match.

Returns a Clojure form that, when executed, is truthy if the
pattern matches the occurrence. Dispatches on the `type` of the
pattern. For instance, a literal pattern might return `(= ~(:pattern
pattern) ~ocr)`, using `=` to test for a match.
sourceraw docstring

update-patternclj

(update-pattern prow i p)
source

useful-matrixclj

(useful-matrix pm)
source

val-at*clj

(val-at* m k)
(val-at* m k not-found)
source

val-at-exprclj

(val-at-expr & args)
source

vector-patternclj

source

vector-pattern-matrix-ocrsclj

(vector-pattern-matrix-ocrs ocrs {:keys [focr tag min-size rest?] :as env})
source

vector-pattern-ocr-symclj

(vector-pattern-ocr-sym {:keys [pat focr tag]} i)
source

vector-pattern?clj

(vector-pattern? x)
source

vector-typeclj

(vector-type t & r)
source

warnclj

(warn msg)
source

widthclj

(width {rows :rows})
source

wildcard-or-existential?clj

(wildcard-or-existential? x)
source

wildcard-patternclj

(wildcard-pattern)
(wildcard-pattern sym)
source

wildcard-pattern?clj

(wildcard-pattern? x)
source

wildcards-and-duplicatesclj

(wildcards-and-duplicates patterns)

Returns a vector of two elements: the set of all wildcards and the set of duplicate wildcards. The underbar _ is excluded from both.

Returns a vector of two elements: the set of all wildcards and the 
set of duplicate wildcards.  The underbar _ is excluded from both.
sourceraw docstring

with-tagclj

(with-tag t ocr)
source

wrap-valuesclj

(wrap-values m)
source

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

× close