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.
sourceraw 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.
sourceraw 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.
sourceraw 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`
sourceraw 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`.
sourceraw docstring

evaluateclj/s

(evaluate ef middleware forms)

Evaluate a sequence of forms in order. Returns the sequence of evaluations.

To do so an 'eval-forms' function is create from ef. This function is wrapped by middleware to then be passed forms as parameter.

Args:

  • ef: an 'evaluate-form' function that take 1 form and returns the result of evaluating it.
  • middleware: an 'eval-forms -> eval-forms' function
  • forms: the sequence to forms to evaluate
Evaluate a sequence of forms in order. Returns the sequence of evaluations.

To do so an 'eval-forms' function is create from `ef`. This function is wrapped by `middleware` to then be passed
`forms` as parameter.

Args:
- `ef`: an 'evaluate-form' function that take 1 form and returns the result of evaluating it.
- `middleware`: an 'eval-forms -> eval-forms' function
- `forms`: the sequence to forms to evaluate
sourceraw 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 a new key associated:

  • :result: in the case of a successful evaluation the sequence of evaluation 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 a new key associated:
- `:result`: in the case of a successful evaluation the sequence of evaluation is returned here
- `:error`: in the case of an error, the exception is returned here.
sourceraw 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.
sourceraw 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
sourceraw 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.
sourceraw docstring

wrap-eval-formsclj/s

Middleware used in eval-forms namely:

Middleware used in [[eval-forms]] namely:
- [[wrap-eval-result]]
- [[wrap-snapshot-ns]]
sourceraw 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]]
sourceraw 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.
sourceraw docstring

wrap-eval-resultclj/s

(wrap-eval-result eval-ctxt)

Middleware that either returns the result of the evaluation or throw any error raised.

Middleware that either returns the result of the evaluation or throw any error raised.
sourceraw 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.
sourceraw docstring

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

× close