macro | since v0.0-2156 | clojure.core/defonce | Edit |
(defonce x init)
defs name to have the root value of init iff the named var has no root value, else init is unevaluated
(core/defmacro defonce
[x init]
(core/let [qualified (if (namespace x)
x
(symbol (core/str (core/-> &env :ns :name)) (name x)))]
`(when-not (exists? ~qualified)
(def ~x ~init))))