clojure.tools.analyzer.*
namespace prefixs to clojure.jvm.tools.analyzer.*
cljs.tools.analyzer
-> cljs.jvm.tools.analyzer
clojure.tools.analyzer
and clojure.tools.analyzer.jvm
clojure.jvm.tools.analyzer/*eval-ast*
to toggle automatic evaluation
of AST's
(ast (let [a 1] a) {:children true})
get-in
true
indicates child is a sequence of expressionseg. :children of the :if node
[[[:the-expr] {}]
[[:tests] {:exprs? true}]
[[:thens] {:exprs? true}]
[[:default] {}]]})
eg. How to iterate over these children
(let [expr (ast (let [a 1] a) {:children true})]
(for [[path {:keys [exprs?]}] (:children expr)
:let [in (get-in expr path)]
child-expr (if exprs?
in
[in])]
;child-expr here is the child expr
))
jvm
from namespacesmap->form
caseanalyze.hygiene
ast-hy
, AST -> hygienic ASTemit-hy
, hygienic AST -> hygienic formmap->form
now extensiblemap->form
case for :fn-expreval
forms after analysing themmap->form
map->form
, now emits fn*
instead of fn
map->form
analyze.emit-form/map->form
eval
ing forms before analysingeval
forms before analysing themCan you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close