• (defn! name & forms)
Like defn, but raises an error if the name already is bound.

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 circumspec/utils.clj:62 top

(defmacro defn! 
  "Like defn, but raises an error if the name already is bound."
  [name & forms]
  `(let [v# (def ~name)]
     (if (and (not *allow-re-defn*) (.hasRoot v#))
       (throw (RuntimeException. (str "The name " '~name " is already bound in " *ns*)))
       (defn ~name ~@forms))))
Vars in circumspec.utils/defn!: defmacro name *ns* and apply concat defn let list not seq str vector
Used in 0 other vars

Comments top

No comments for defn!. Log in to add a comment.