Allow map matching syntax to check for IMatchLookup
Allow map matching syntax to check for IMatchLookup
Flag to optimize performance over code size.
Flag to optimize performance over code size.
In the presence of recur we cannot apply code size optimizations
In the presence of recur we cannot apply code size optimizations
Enable syntax check of match macros
Enable syntax check of match macros
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
(action-for-row {rows :rows} j)
(all-wildcards? prow)
(app-pattern p form)
(app-pattern-matrix-ocrs [focr :as ocrs] form)
(app-pattern? x)
(array-tag x)
Pre-allocated exception used for backtracing
Pre-allocated exception used for backtracing
(backtrack-expr)
(backtrack-sym)
(bind-node bindings node)
(bind-variables ocrs)
(calc-rest?-and-min-size rows env)
(cases matrix)
(catch-error & body)
(check-matrix-args vars clauses)
(check-pattern pat vars nvars rownum)
(choose-column matrix)
(clj-form vars clauses)
(column {rows :rows} i)
(column-splitter col)
(compile {:keys [rows ocrs] :as pm})
(constructor? p)
(constructors-above? pm i j)
(dag-clause-to-clj occurrence pattern action)
(default-case matrix)
(default-specialize-matrix p matrix)
(defpred name)
(defpred name f)
(dim pm)
(drop-nth-bind prow n ocr)
(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.
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
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.
(emit-patterns ps t)
(emit-patterns ps t v)
(empty-matrix? pm)
(empty-row? row)
(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
(executable-form node)
(existential-pattern? x)
(expand-matrix matrix col)
(expression? ocr)
(fail-node)
(find-duplicate-wildcards pattern)
(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
(first-column? i)
(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.
(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.
(gen-map-pattern-ocr ocr k)
(get-all-keys rows env)
(get-loop-locals)
(get-ocr-map p {:keys [only all-keys wc-map]})
(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?)].
(group-rows cs rows)
Determine if two patterns may be grouped together for simultaneous testing.
Determine if two patterns may be grouped together for simultaneous testing.
(guard-pattern? x)
(height {rows :rows})
(leaf-node value)
(leaf-node value bindings)
(literal-case-matrix-splitter matrix)
(literal-pattern l)
(literal-pattern? x)
(map-key-pattern p)
(map-key-pattern? x)
(map-pattern)
(map-pattern m)
(map-pattern-matrix-ocr-sym k env)
(map-pattern-matrix-ocrs ocrs env)
(map-pattern? x)
(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))
(match-let bindings & body)
(matchm vars & clauses)
Same as match but supports IMatchLookup when matching maps.
Same as match but supports IMatchLookup when matching maps.
(matchv type vars & clauses)
(matrix-splitter matrix)
(named-wildcard-pattern? x)
(necessary-column pm)
(non-local-literal-pattern? p)
(occurrences pm)
(or-pattern? x)
(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
(pattern-at {rows :rows} i j)
(pattern-matrix rows ocrs)
(pattern-row ps action)
(pattern-row ps action bindings)
(pattern-score pm i j)
(predicate-pattern? x)
(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.
(pseudo-pattern? x)
(pseudo-patterns matrix i)
(recur-present? actions)
(regroup-keywords pattern)
(rest-pattern p)
(rest-pattern? x)
(return-split S D)
(root-bind-node matrix)
(row {rows :rows} j)
(row-bindings f ocrs)
(row-keys row env)
(rows {rows :rows})
(score-column i col)
(select pm)
(seq-pattern s)
(seq-pattern-matrix-ocrs ocrs focr)
(seq-pattern-matrix-rest-ocrs ocrs focr)
(seq-pattern? x)
(specialize matrix)
(specialize matrix p)
(specialize-app-pattern-matrix rows form)
(specialize-guard-pattern-matrix rows)
(specialize-map-key-pattern-matrix rows)
(specialize-map-pattern-matrix rows env)
(specialize-map-pattern-row row {:keys [all-keys only? focr] :as env})
(specialize-or-pattern-matrix rows pat ps)
(specialize-or-pattern-row row pat ps)
(specialize-predicate-pattern-matrix rows)
(specialize-seq-pattern-matrix rows focr)
(specialize-seq-pattern-rest-matrix rows focr)
(specialize-seq-pattern-rest-row focr row)
(specialize-seq-pattern-row focr row)
(specialize-vector-pattern-matrix rows env)
(specialize-vector-pattern-row row {:keys [focr min-size]})
(specialize-vector-pattern-row-non-rest row {:keys [focr min-size]})
(split-matrix matrix)
(switch-node occurrence cases default)
(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.
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.
(update-pattern prow i p)
(useful-matrix pm)
(val-at* m k)
(val-at* m k not-found)
(val-at-expr & args)
(vector-pattern-matrix-ocrs ocrs {:keys [focr tag min-size rest?] :as env})
(vector-pattern-ocr-sym {:keys [pat focr tag]} i)
(vector-pattern? x)
(vector-type t & r)
(warn msg)
(width {rows :rows})
(wildcard-or-existential? x)
(wildcard-pattern)
(wildcard-pattern sym)
(wildcard-pattern? x)
(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.
(with-tag t ocr)
(wrap-values m)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close