clojure.tools.analyzer.* namespace prefixs to clojure.jvm.tools.analyzer.*
cljs.tools.analyzer -> cljs.jvm.tools.analyzerclojure.tools.analyzer and clojure.tools.analyzer.jvmclojure.jvm.tools.analyzer/*eval-ast* to toggle automatic evaluation
of AST's
(ast (let [a 1] a) {:children true})get-intrue 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->formmap->form, now emits fn* instead of fnmap->formanalyze.emit-form/map->formevaling forms before analysingeval forms before analysing themCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |