(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.
(walk-exprs predicate handler x)(walk-exprs predicate handler special-form? x)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.
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.
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 |