Liking cljdoc? Tell your friends :D

fr.jeremyschoffen.prose.alpha.eval.common

Api providing tools to facilitate the evaluation of documents.

Api providing tools to facilitate the evaluation of documents.
raw docstring

*evaluation-env*clj/s

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.
raw docstring

bind-envclj/smacro

(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.
raw docstring

eval-formsclj/s

(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.
raw docstring

eval-forms*clj/s

(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`
raw docstring

eval-forms-in-temp-nsclj/s

(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 eval
  • eval-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`.
raw docstring

evaluateclj/s

(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' function
  • forms: the sequence to forms to evaluate
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' function
- `forms`: the sequence to forms to evaluate
raw docstring

evaluate-ctxtclj/s

(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.
raw docstring

get-envclj/s

(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.
raw docstring

make-evaluation-ctxtclj/s

(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 form
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 form
raw docstring

wrap-eval-form-exceptionclj/s

(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.
raw docstring

wrap-eval-formsclj/s

Middleware used in eval-forms namely:

Middleware used in [[eval-forms]] namely:
- [[wrap-eval-result]]
- [[wrap-snapshot-ns]]
raw docstring

wrap-eval-forms-in-temp-nsclj/s

Middleware used in [[eval-forms-in-temp-ns]] namely:
- [[wrap-eval-result]]
- [[wrap-snapshot-ns]]
- [[wrap-eval-in-temp-ns]]
raw docstring

wrap-eval-in-temp-nsclj/s

(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.
raw docstring

wrap-eval-resultclj/s

(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.
raw docstring

wrap-snapshot-nsclj/s

(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.
raw docstring

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

× close