The current collection context e.g. :vector, :seq, etc.
The current collection context e.g. :vector, :seq, etc.
(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.
(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.
(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.
(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.
(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.beta/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.beta/variables node).
(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.
(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.
(compile-ground node)
Compile node as a literal if possible.
Compile node as a literal if possible.
(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.
(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*.
(emit tree fail kind)
Rewrite the decision tree as Clojure code with optimizations.
Rewrite the decision tree as Clojure code with optimizations.
(emit* tree fail kind)
Rewrite the decision tree as Clojure code without optimizations.
Rewrite the decision tree as Clojure code without optimizations.
(find x & clauses)
(find &form &env & match-args)
Like search but returns only the first successful match.
Like search but returns only the first successful match.
(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.
(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
(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.
(search x & clauses)
(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.
(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.
(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.
(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*.
(vector-context?)
true if the current value of collect-context is :vector.
true if the current value of *collect-context* is :vector.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close