(capture-output job-id f)
This printing wrapper is responsible for capturing printed output and presenting it via present-output
.
This printing wrapper is responsible for capturing printed output and presenting it via `present-output`.
(eval job-id eval-mode wrap-mode job-fn)
This is the main entrypoint for evaluation of a snippet of code in the context of REPL. Please note that this code runs in the context of the app and uses ClojureScript runtime built together with the app.
job-id - a numeric id of the REPL job eval-mode - 'captured' or 'special' wrap-mode - 'short-circuit-presentation' or nil job-fn - code to be executed in the form of a function
Note that normally we want to support capturing REPL specials *1 *2 *3 and *e. Only when we are executing their retrieval we don't want to capture them and we want to use the 'special' path.
Also normally we want to wrap our code in a supporting wrapper which will present results directly via cljs-devtools, or present exceptions in a friendly way. Also we want to capture any printing which might occur during evaluation. In some special cases we might not want to do that.
Finally we want to postprocess evaluation result and prepare Weasel's nREPL response.
See https://github.com/binaryage/dirac/blob/master/docs/about-repls.md for conceptual overview.
This is the main entrypoint for evaluation of a snippet of code in the context of REPL. Please note that this code runs in the context of the app and uses ClojureScript runtime built together with the app. job-id - a numeric id of the REPL job eval-mode - 'captured' or 'special' wrap-mode - 'short-circuit-presentation' or nil job-fn - code to be executed in the form of a function Note that normally we want to support capturing REPL specials *1 *2 *3 and *e. Only when we are executing their retrieval we don't want to capture them and we want to use the 'special' path. Also normally we want to wrap our code in a supporting wrapper which will present results directly via cljs-devtools, or present exceptions in a friendly way. Also we want to capture any printing which might occur during evaluation. In some special cases we might not want to do that. Finally we want to postprocess evaluation result and prepare Weasel's nREPL response. See https://github.com/binaryage/dirac/blob/master/docs/about-repls.md for conceptual overview.
(eval-captured job-id wrap-mode job-fn)
Evaluates a REPL job in the captured mode. Compare it to eval-special. Captured mode keeps track of *1 *2 *3 and *e REPL specials.
Evaluates a REPL job in the captured mode. Compare it to eval-special. Captured mode keeps track of *1 *2 *3 and *e REPL specials.
(eval-special job-id wrap-mode job-fn)
Evaluates a REPL job in the special mode. Compare it to eval-captured.
Evaluates a REPL job in the special mode. Compare it to eval-captured.
(execute-job job-id wrap-mode job-fn)
Execute a REPL job by optionally wrapping it in a requested wrapper.
Execute a REPL job by optionally wrapping it in a requested wrapper.
(postprocess-successful-eval value)
This is a postprocessing function wrapping Weasel's Javascript evaluation attempt. This structure is needed for building response to nREPL server (see dirac.implant.weasel in Dirac project) In our case weasel is running in the context of Dirac DevTools and could potentially have different version of cljs runtime. To be correct we have to do this post-processing in app's context to use the same cljs runtime as app evaluating the code.
Also we have to be careful to not enter into infinite printing with cyclic data structures. We limit printing level and length via with-safe-printing.
This is a postprocessing function wrapping Weasel's Javascript evaluation attempt. This structure is needed for building response to nREPL server (see dirac.implant.weasel in Dirac project) In our case weasel is running in the context of Dirac DevTools and could potentially have different version of cljs runtime. To be correct we have to do this post-processing in app's context to use the same cljs runtime as app evaluating the code. Also we have to be careful to not enter into infinite printing with cyclic data structures. We limit printing level and length via with-safe-printing.
(present job-id job-fn)
A presentation wrapper which takes care of presenting REPL evaluation to Dirac user. We short-circuit nREPL feedback mechanism and display REPL results immediately to the user as native data. This is especially important for cljs-devtools.
Please note that for traditional nREPL clients we still serialize the result, send it over the wire to nREPL server and in turn that result is sent back to clients and presented. The Dirac client has just some special logic and ignores this echoed output because it was already presented directly.
See https://github.com/binaryage/dirac/blob/master/docs/about-repls.md for conceptual overview.
A presentation wrapper which takes care of presenting REPL evaluation to Dirac user. We short-circuit nREPL feedback mechanism and display REPL results immediately to the user as native data. This is especially important for cljs-devtools. Please note that for traditional nREPL clients we still serialize the result, send it over the wire to nREPL server and in turn that result is sent back to clients and presented. The Dirac client has just some special logic and ignores this echoed output because it was already presented directly. See https://github.com/binaryage/dirac/blob/master/docs/about-repls.md for conceptual overview.
(present-repl-exception request-id exception)
Called by our nREPL boilerplate when we capture a REPL evaluation exception.
Called by our nREPL boilerplate when we capture a REPL evaluation exception.
(present-repl-result request-id value)
Called by our nREPL boilerplate when we capture a REPL evaluation result.
Called by our nREPL boilerplate when we capture a REPL evaluation result.
(request-eval-cljs code)
Automates Dirac REPL from the app. This way you can request evaluation of ClojureScript code as it would be entered directly by the user.
Automates Dirac REPL from the app. This way you can request evaluation of ClojureScript code as it would be entered directly by the user.
(request-eval-js code)
Automates Dirac REPL from the app. This way you can request evaluation of Javascript code as it would be entered directly by the user.
Automates Dirac REPL from the app. This way you can request evaluation of Javascript code as it would be entered directly by the user.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close