Api providing tools to facilitate the evaluation of documents.
Api providing tools to facilitate the evaluation of documents.
A intended to be bound to a map containing data about an evaluation. This is intented to be the input / environment of an evaluation.
A intended to be bound to a map containing data about an evaluation. This is intented to be the input / environment of an evaluation.
(bind-env bindings & body)Utility allowing to merge kvs keys to the *evaluation-env* map.
Args:
bindings: a map that will be merged into *evaluation-env*.body: code to execute in this new environment.Utility allowing to merge kvs keys to the [[*evaluation-env*]] map. Args: - `bindings`: a map that will be merged into [[*evaluation-env*]]. - `body`: code to execute in this new environment.
(eval-forms forms)(eval-forms eval-form forms)Evaluate a sequence of forms ensuring the the current namespace doesn't change after the evaluation.
Evaluate a sequence of forms ensuring the the current namespace doesn't change after the evaluation.
(eval-forms* eval-form forms)Evaluate a sequences of forms forms in sequence with eval-form
Evaluate a sequences of forms `forms` in sequence with `eval-form`
(eval-forms-in-temp-ns forms)(eval-forms-in-temp-ns eval-form forms)Evaluate a sequence of forms in a temporary namespace.
Args:
forms; a sequence of forms to evaleval-form: a function a evaluates one form defaulting to clojure.core/eval.Evaluate a sequence of forms in a temporary namespace. Args: - `forms`; a sequence of forms to eval - `eval-form`: a function a evaluates one form defaulting to `clojure.core/eval`.
(evaluate ef middleware forms)Evaluate a sequence of forms in order. Returns the sequence of evaluations.
To do so an evaluation context is created using make-evaluation-ctxt. This
context is passed to evaluate-ctxt that has been wrapped with middleware.
Args:
ef: an 'evaluate-form' function that take 1 form and returns the result of evaluating it.middleware: an 'evaluate-ctxt -> evaluate-ctxt' functionforms: the sequence to forms to evaluateEvaluate a sequence of forms in order. Returns the sequence of evaluations. To do so an evaluation context is created using [[make-evaluation-ctxt]]. This context is passed to [[evaluate-ctxt]] that has been wrapped with `middleware`. Args: - `ef`: an 'evaluate-form' function that take 1 form and returns the result of evaluating it. - `middleware`: an 'evaluate-ctxt -> evaluate-ctxt' function - `forms`: the sequence to forms to evaluate
(evaluate-ctxt {:keys [forms eval-form] :as ctxt})Function evaluating a context (produced by make-evaluation-ctxt).
Returns the context with one of two keys associated:
:result: in the case of a successful evaluation the sequence of evaluations is returned here:error: in the case of an error, the exception is returned here.Function evaluating a context (produced by [[make-evaluation-ctxt]]). Returns the context with one of two keys associated: - `:result`: in the case of a successful evaluation the sequence of evaluations is returned here - `:error`: in the case of an error, the exception is returned here.
(get-env)(get-env key)Get the evaluation environment or a specific key from it.
Get the evaluation environment or a specific `key` from it.
(make-evaluation-ctxt eval-form forms)Make an evaluation context.
This context is a map of 2 keys:
:forms: a sequence of forms to evaluate:eval-form: a function that evaluates one formMake an evaluation context. This context is a map of 2 keys: - `:forms`: a sequence of forms to evaluate - `:eval-form`: a function that evaluates one form
(wrap-eval-form-exception e)Wraps an eval function so that exceptions thrown are caught and rethrown in an ex-info containing the form that threw in its ex-data.
Wraps an eval function so that exceptions thrown are caught and rethrown in an ex-info containing the form that threw in its ex-data.
Middleware used in eval-forms namely:
Middleware used in [[eval-forms]] namely: - [[wrap-eval-result]] - [[wrap-snapshot-ns]]
Middleware used in eval-forms-in-temp-ns namely:
Middleware used in [[eval-forms-in-temp-ns]] namely: - [[wrap-eval-result]] - [[wrap-snapshot-ns]] - [[wrap-eval-in-temp-ns]]
(wrap-eval-in-temp-ns eval-ctxt)(wrap-eval-in-temp-ns eval-ctxt temp-ns)Middleware that makes the evaluation take place in a temporary namespace.
Middleware that makes the evaluation take place in a temporary namespace.
(wrap-eval-result eval-ctxt)Middleware that either returns the result of the evaluation or throws any error raised.
Middleware that either returns the result of the evaluation or throws any error raised.
(wrap-snapshot-ns eval-ctxt)Middleware making sure the current ns stays the same after an evaluation.
Middleware making sure the current ns stays the same after an evaluation.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |