Interface to Compiler's analyze.
Entry point analyze-path
and analyze-one
Interface to Compiler's analyze. Entry point `analyze-path` and `analyze-one`
If true, evaluate the output AST before returning. Otherwise, AST is unevaluated. Defaults to true.
If true, evaluate the output AST before returning. Otherwise, AST is unevaluated. Defaults to true.
(analysis->map aobj env opt)
Recursively converts the output of the Compiler's analysis to a map. Takes a map of options:
Recursively converts the output of the Compiler's analysis to a map. Takes a map of options: - :children when true, include a :children key with all child expressions of each node - :java-obj when true, include a :java-obj key with the node's corresponding Java object
(analyze-file source-path
&
{:keys [reader opt]
:or {reader (LineNumberingPushbackReader.
(io/reader (io/resource source-path)))}})
Takes a file path and optionally a pushback reader. Returns a vector of maps representing the ASTs of the forms in the target file.
Options:
eg. (analyze-file "my/ns.clj")
Takes a file path and optionally a pushback reader. Returns a vector of maps representing the ASTs of the forms in the target file. Options: - :reader a pushback reader to use to read the namespace forms - :opt a map of analyzer options - :children when true, include a :children key with all child expressions of each node - :java-obj when true, include a :java-obj key with the node's corresponding Java object eg. (analyze-file "my/ns.clj")
(analyze-ns source-nsym
&
{:keys [reader opt] :or {reader (pb-reader-for-ns source-nsym)}})
Takes a LineNumberingPushbackReader and a namespace symbol. Returns a vector of maps, with keys :op, :env. If expressions have children, will have :children entry.
Options:
eg. (analyze-ns 'my-ns :opt {:children true} :reader (pb-reader-for-ns 'my.ns))
Takes a LineNumberingPushbackReader and a namespace symbol. Returns a vector of maps, with keys :op, :env. If expressions have children, will have :children entry. Options: - :reader a pushback reader to use to read the namespace forms - :opt a map of analyzer options - :children when true, include a :children key with all child expressions of each node - :java-obj when true, include a :java-obj key with the node's corresponding Java object eg. (analyze-ns 'my-ns :opt {:children true} :reader (pb-reader-for-ns 'my.ns))
(analyze-one env form)
(analyze-one env form opt)
Analyze a single form
Analyze a single form
(ast form)
(ast form opt)
Returns the abstract syntax tree representation of the given form, evaluated in the current namespace
Returns the abstract syntax tree representation of the given form, evaluated in the current namespace
(ast-in-ns nsym form)
(ast-in-ns nsym form opt)
Returns the abstract syntax tree representation of the given form, evaluated in the given namespace
Returns the abstract syntax tree representation of the given form, evaluated in the given namespace
(children expr)
Returns a lazy sequence of the immediate children of the expr in order of evaluation, where defined.
Returns a lazy sequence of the immediate children of the expr in order of evaluation, where defined.
(field class-obj field)
(field class-obj field obj)
Call a private field, must be known at compile time. Throws an error if field is already publicly accessible.
Call a private field, must be known at compile time. Throws an error if field is already publicly accessible.
(forms-seq rdr)
Lazy seq of forms in a Clojure or ClojureScript file.
Lazy seq of forms in a Clojure or ClojureScript file.
(macroexpand f)
Fully macroexpand a form.
Fully macroexpand a form.
(pb-reader-for-ns ns-sym)
Returns a LineNumberingPushbackReader for namespace ns-sym
Returns a LineNumberingPushbackReader for namespace ns-sym
(uri-for-ns ns-sym)
Returns a URI representing the namespace. Throws an exception if URI not found.
Returns a URI representing the namespace. Throws an exception if URI not found.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close