(macroexpand x)
(macroexpand x special-form?)
Expands both macros and inline functions. Optionally takes a special-form?
predicate which
identifies first elements of expressions that shouldn't be macroexpanded, and honors local
bindings.
Expands both macros and inline functions. Optionally takes a `special-form?` predicate which identifies first elements of expressions that shouldn't be macroexpanded, and honors local bindings.
(macroexpand-all x)
Recursively macroexpands all forms, preserving the &env special variables.
Recursively macroexpands all forms, preserving the &env special variables.
(special-form? x)
Given sym, a symbol produced by walk-exprs, returns true if sym is a special form.
Given sym, a symbol produced by walk-exprs, returns true if sym is a special form.
(walk-exprs predicate handler x)
(walk-exprs predicate handler special-form? x & {:keys [try-clause?]})
A walk function which only traverses valid Clojure expressions. The predicate
describes
whether the sub-form should be transformed. If it returns true, handler
is invoked, and
returns a transformed form.
Unlike clojure.walk
, if the handler is called, the rest of the sub-form is not walked.
The handler function is responsible for recursively calling walk-exprs
on the form it is
given.
Macroexpansion can be halted by defining a set of special-form?
which will be left alone.
Including fn
, let
, or other binding forms can break local variable analysis, so use
with caution.
The :try-clause? option indicates that a try
clause is being walked. The special forms
catch
and finally
are only special in try
clauses.
A walk function which only traverses valid Clojure expressions. The `predicate` describes whether the sub-form should be transformed. If it returns true, `handler` is invoked, and returns a transformed form. Unlike `clojure.walk`, if the handler is called, the rest of the sub-form is not walked. The handler function is responsible for recursively calling `walk-exprs` on the form it is given. Macroexpansion can be halted by defining a set of `special-form?` which will be left alone. Including `fn`, `let`, or other binding forms can break local variable analysis, so use with caution. The :try-clause? option indicates that a `try` clause is being walked. The special forms `catch` and `finally` are only special in `try` clauses.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close