(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))))
Comments top
No comments for defn!. Log in to add a comment.