1.3.0 permalink Arrow_down_16x16

macroexpand-1

clojure.core

  • (macroexpand-1 form)
If form represents a macro form, returns its expansion,
else returns form.

2 Examples top

  • user=> (macroexpand-1 '(defstruct mystruct[a b]))
    (def mystruct (clojure.core/create-struct [a b]))
    
  • user=> (macroexpand-1 '(-> c (+ 3) (* 2)))
    (clojure.core/-> (clojure.core/-> c (+ 3)) (* 2))
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:3556 top

(defn macroexpand-1
  "If form represents a macro form, returns its expansion,
  else returns form."
  {:added "1.0"
   :static true}
  [form]
    (. clojure.lang.Compiler (macroexpand1 form)))
Vars in clojure.core/macroexpand-1:
Used in 0 other vars

Comments top

No comments for macroexpand-1. Log in to add a comment.