• (defsymbolmacro symbol expansion)
Define a symbol macro. Because symbol macros are not part of
Clojure's built-in macro expansion system, they can be used only
inside a with-symbol-macros form.

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:222 top

(defmacro defsymbolmacro
  "Define a symbol macro. Because symbol macros are not part of
   Clojure's built-in macro expansion system, they can be used only
   inside a with-symbol-macros form."
  [symbol expansion]
  (let [meta-map (if (meta symbol) (meta symbol) {})
	meta-map (assoc meta-map :symbol-macro true)]
  `(def ~(with-meta symbol meta-map) (quote ~expansion))))
Vars in clojure.contrib.macro-utils/defsymbolmacro: defmacro let symbol with-meta concat list seq
Used in 0 other vars

Comments top

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