Skip to content

clojure.core/defonce

View this page on ClojureDocs

Type: macro Added: Clojure 1.0 Examples: 3 Runnable: 0
([name expr])

defs name to have the root value of the expr iff the named var has no root value, else expr is unevaluated

Examples

by dakrone on . May have evaluation errors.
by DanBurton on . May have evaluation errors.
by luiszambon on . May have evaluation errors.

Note by lnostdal

Note that this isn't thread safe. I.e. EXPR for the same NAME can be evaluated more than once.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.