->ExceptionThrown
function
Usage: (->ExceptionThrown e ast)
Positional factory function for class clojure.core.typed.analyzer.jvm.ExceptionThrown.
Source
analyze
function
Usage: (analyze form)
(analyze form env)
(analyze form env opts)
Analyzes a clojure form using tools.analyzer augmented with the JVM specific special ops
and returns its AST, after running #'run-passes on it.
If no configuration option is provides, analyze will setup tools.analyzer using the extension
points declared in this namespace.
If provided, opts should be a map of options to analyze, currently the only valid
options are :bindings and :passes-opts (if not provided, :passes-opts defaults to the
value of `default-passes-opts`).
If provided, :bindings should be a map of Var->value pairs that will be merged into the
default bindings for tools.analyzer, useful to provide custom extension points.
If provided, :passes-opts should be a map of pass-name-kw->pass-config-map pairs that
can be used to configure the behaviour of each pass.
E.g.
(analyze form env {:bindings {#'ana/macroexpand-1 my-mexpand-1}})
Source
analyze+eval
function
Usage: (analyze+eval form)
(analyze+eval form env)
(analyze+eval form env {:keys [additional-gilardi-condition eval-fn annotate-do statement-opts-fn stop-gildardi-check analyze-fn], :or {additional-gilardi-condition (fn [form env] true), eval-fn eval-ast, annotate-do (fn [a _ _] a), statement-opts-fn identity, stop-gildardi-check (fn [form env] false), analyze-fn analyze}, :as opts})
Like analyze but evals the form after the analysis and attaches the
returned value in the :result field of the AST node.
If evaluating the form will cause an exception to be thrown, the exception
will be caught and wrapped in an ExceptionThrown object, containing the
exception in the `e` field and the AST in the `ast` field.
The ExceptionThrown object is then passed to `handle-evaluation-exception`,
which by defaults throws the original exception, but can be used to provide
a replacement return value for the evaluation of the AST.
Unrolls `do` forms to handle the Gilardi scenario.
Useful when analyzing whole files/namespaces.
Source
create-var
function
Usage: (create-var sym {:keys [ns]})
Creates a Var for sym and returns it.
The Var gets interned in the env namespace.
Source
default-passes
var
Set of passes that will be run by default on the AST by #'run-passes
Source
default-passes-opts
var
Default :passes-opts for `analyze`
Source
macroexpand-1
function
Usage: (macroexpand-1 form)
(macroexpand-1 form env)
If form represents a macro form or an inlineable function, returns its expansion,
else returns form.
Source
resolve-ns
function
Usage: (resolve-ns ns-sym {:keys [ns]})
Resolves the ns mapped by the given sym in the global env
Source
resolve-sym
function
Usage: (resolve-sym sym {:keys [ns], :as env})
Resolves the value mapped by the given sym in the global env
Source
specials
var
Set of the special forms for clojure in the JVM
Source