Liking cljdoc? Tell your friends :D

meander.match.gamma


*collection-context*clj/s

The current collection context e.g. :vector, :seq, etc.

The current collection context e.g. :vector, :seq, etc.
sourceraw docstring

*negating*clj/s

sourceraw docstring

analyze-find-argsclj/s

(analyze-find-args match-args)
(analyze-find-args match-args env)

Analyzes arguments as would be supplied to the find macro e.g.

(expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of clojure.lang.Exception and are derived by applying check to the pattern of each clause. :expr The expression which is the target of pattern matching, the first argument to the match macro. :matrix The pattern matrix derived from the (clause action ,,,) forms. Each action expression is wrapped in a list.

Analyzes arguments as would be supplied to the find macro e.g.

  (expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of
  clojure.lang.Exception and are derived by applying check to the
  pattern of each clause.
:expr The expression which is the target of pattern matching, the
  first argument to the match macro.
:matrix The pattern matrix derived from the (clause action ,,,)
  forms. Each action expression is wrapped in a list.
sourceraw docstring

analyze-match-argsclj/s

(analyze-match-args match-args)
(analyze-match-args match-args env)

Analyzes arguments as would be supplied to the match macro e.g.

(expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of clojure.lang.Exception and are derived by applying check to the pattern of each clause. :expr The expression which is the target of pattern matching, the first argument to the match macro. :exhaustive? Boolean value indicating whether or not the match clauses are exhaustive. true if :final-clause is present, false otherwise. :final-clause The pattern matrix row which is the first catch-all pattern matching clause. :matrix The pattern matrix derived from the (clause action ,,,) forms. If :final-clause is present contains all of the rows above :final-clause and none of the rows below it.

Analyzes arguments as would be supplied to the match macro e.g.

  (expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of
  clojure.lang.Exception and are derived by applying check to the
  pattern of each clause.
:expr The expression which is the target of pattern matching, the
  first argument to the match macro.
:exhaustive? Boolean value indicating whether or not the match
  clauses are exhaustive. true if :final-clause is present, false
  otherwise.
:final-clause The pattern matrix row which is the first catch-all
  pattern matching clause.
:matrix The pattern matrix derived from the (clause action ,,,)
  forms. If :final-clause is present contains all of the rows above
  :final-clause and none of the rows below it.
sourceraw docstring

analyze-search-argsclj/s

(analyze-search-args match-args)
(analyze-search-args match-args env)

Analyzes arguments as would be supplied to the search macro e.g.

(expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of clojure.lang.Exception and are derived by applying check to the pattern of each clause. :expr The expression which is the target of pattern matching, the first argument to the match macro. :matrix The pattern matrix derived from the (clause action ,,,) forms. Each action expression is wrapped in a list.

Analyzes arguments as would be supplied to the search macro e.g.

  (expr clause action ,,,)

Returns a map containing the following keys:

:errors A sequence of semantic errors. These are instances of
  clojure.lang.Exception and are derived by applying check to the
  pattern of each clause.
:expr The expression which is the target of pattern matching, the
  first argument to the match macro.
:matrix The pattern matrix derived from the (clause action ,,,)
  forms. Each action expression is wrapped in a list.
sourceraw docstring

checkclj/s

(check node search?)

Checks if node is semantically valid. Returns an instance of clojure.lang.Exception if an error can be found and nil otherwise.

Checks if node is semantically valid. Returns an instance of
clojure.lang.Exception if an error can be found and nil otherwise.
sourceraw docstring

check*clj/s

(check* node env search?)

Checks if node is semantically valid with respect to env. Returns

[:error [{:message string?, :ex-data map?} & syntax-trace] whenever an error is detected. syntax-trace is a sequence forms which represent the path to the invalid pattern from the leaf to the root.

[:okay exit-env] whenever the semantics of node are valid. exit-env is a set of all logic and memory variables which would be bound by a succesful pattern match; equivalent to (meander.syntax.gamma/variables node).

Checks if node is semantically valid with respect to env. Returns

[:error [{:message string?, :ex-data map?} & syntax-trace]
  whenever an error is detected. syntax-trace is a sequence forms
  which represent the path to the invalid pattern from the leaf
  to the root.


[:okay exit-env]
  whenever the semantics of node are valid. exit-env is a set of all
  logic and memory variables which would be bound by a succesful
  pattern match; equivalent to (meander.syntax.gamma/variables node).
sourceraw docstring

check-nodeclj/smultimethod

(check-node node env search?)

Validates the semantics of node returning

[:error [{:message string, :ex-data map?}] whenever validation fails.

[:okay child-nodes new-env] whenever validation succeeds. child-nodes are the child nodes of node. new-env is env extended with variables that would be bound during the process of matching node but not it's children.

Validates the semantics of node returning

[:error [{:message string, :ex-data map?}]
  whenever validation fails.

[:okay child-nodes new-env]
  whenever validation succeeds. child-nodes are the child nodes of
  node. new-env is env extended with variables that would be bound
  during the process of matching node but not it's children.
sourceraw docstring

compileclj/s

(compile targets matrix)

Compile the pattern matrix with respect to targets to a decision tree.

Compile the pattern matrix with respect to targets to a decision
tree.
sourceraw docstring

compile-groundclj/s

(compile-ground node)

Compile node as a literal if possible.

Compile node as a literal if possible.
sourceraw docstring

compile-specialized-matrixclj/smultimethod

(compile-specialized-matrix tag targets matrix)

Compile the matrix specialized for tag with respect to targets to a sequence of decision trees.

Compile the matrix specialized for tag with respect to targets to a
sequence of decision trees.
sourceraw docstring

drop-formclj/s

(drop-form n target)

Form for dropping n elements from target with respect to the current value of collection-context.

Form for dropping n elements from target with respect to the
current value of *collection-context*.
sourceraw docstring

emitclj/s

(emit tree fail kind)

Rewrite the decision tree as Clojure code with optimizations.

Rewrite the decision tree as Clojure code with optimizations.
sourceraw docstring

emit*clj/s

(emit* tree fail kind)

Rewrite the decision tree as Clojure code without optimizations.

Rewrite the decision tree as Clojure code without optimizations.
sourceraw docstring

findclj/s≠macro

clj
(find x & clauses)
cljs
(find &form &env & match-args)

Like search but returns only the first successful match.

Like search but returns only the first successful match.
source (clj)source (cljs)raw docstring

js-array-context?clj/s

(js-array-context?)

true if the current value of collect-context is :js-array.

true if the current value of *collect-context* is :js-array.
sourceraw docstring

js-array-equals-formclj/s

(js-array-equals-form a b)

Form used to test if two arrays a and b are equal in ClojureScript.

Form used to test if two arrays a and b are equal in
ClojureScript.
sourceraw docstring

literal?clj/s

(literal? node)

true if node is ground and does not contain :map or :set subnodes, false otherwise.

The constraint that node may not contain :map or :set subnodes is due to the semantics of map and set patterns: they express submap and subsets respectively. Compiling these patterns to literals as part of an equality check would result in false negative matches.

See also: compile-ground

true if node is ground and does not contain :map or :set subnodes,
false otherwise.

The constraint that node may not contain :map or :set subnodes is
due to the semantics of map and set patterns: they express submap
and subsets respectively. Compiling these patterns to literals as
part of an equality check would result in false negative matches.

See also: compile-ground
sourceraw docstring

matchclj/s≠macro

clj
(match x & clauses)
cljs
(match &form &env & match-args)
source (clj)source (cljs)

negating?clj/s

(negating?)

true if currently compiling a matrix dervied from a not pattern, false otherwise.

true if currently compiling a matrix dervied from a not pattern,
false otherwise.
sourceraw docstring

clj
(search x & clauses)
cljs
(search &form &env & match-args)

Like match but allows for patterns which may match x in more than one way. Returns a lazy sequence of clause action values.

Example:

(search [1 2 3] [!xs ... !ys ...] {'!xs !xs, '!ys !ys}) ;; => ({!xs [], !ys [1 2 3]} {!xs [1], !ys [2 3]} {!xs [1 2], !ys [3]} {!xs [1 2 3], !ys []})

Note: If only the first value is needed, use find instead.

Like match but allows for patterns which may match x in more than
one way. Returns a lazy sequence of clause action values.

Example:

(search [1 2 3]
  [!xs ... !ys ...]
  {'!xs !xs, '!ys !ys})
;; =>
({!xs [], !ys [1 2 3]}
 {!xs [1], !ys [2 3]}
 {!xs [1 2], !ys [3]}
 {!xs [1 2 3], !ys []})

Note: If only the first value is needed, use find instead.
source (clj)source (cljs)raw docstring

solved?clj/s

(solved? node env)

true if all logic variables occuring in node are bound in env and node is free of memory variables, false otherwise.

true if all logic variables occuring in node are bound in env and
node is free of memory variables, false otherwise.
sourceraw docstring

specialize-matrixclj/s

(specialize-matrix tag matrix)

Retains rows of the matrix whose tag is tag or :any.

Retains rows of the matrix whose tag is tag or :any.
sourceraw docstring

take-formclj/s

(take-form n target)

Form for taking n elements from target with respect to the current value of collection-context.

Form for taking n elements from target with respect to the current
value of *collection-context*.
sourceraw docstring

vector-context?clj/s

(vector-context?)

true if the current value of collect-context is :vector.

true if the current value of *collect-context* is :vector.
sourceraw docstring

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

× close