1.2.0 permalink Arrow_down_16x16
  • (macrolet fn-bindings & exprs)
Define local macros that are used in the expansion of exprs. The
syntax is the same as for letfn forms.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/macro_utils.clj:201 top

(defmacro macrolet
  "Define local macros that are used in the expansion of exprs. The
   syntax is the same as for letfn forms."
  [fn-bindings & exprs]
  (let [names      (map first fn-bindings)
	name-map   (into {} (map (fn [n] [(list 'quote n) n]) names))
	macro-map  (eval `(letfn ~fn-bindings ~name-map))]
    (binding [macro-fns     (merge macro-fns macro-map)
	      macro-symbols (apply dissoc macro-symbols names)]
      `(do ~@(doall (map expand-all exprs))))))
Vars in clojure.contrib.macro-utils/macrolet: binding defmacro doall let map concat list seq
Used in 0 other vars

Comments top

No comments for macrolet. Log in to add a comment.