store/[org.clojure/clojure "1.8.0"] clj::clojure.core/delay

Official Documentation

Add notes
Arities
==================================================
   [& body]

Docstring
==================================================
  Takes a body of expressions and yields a Delay object that will
  invoke the body only the first time it is forced (with force or deref/@), and
  will cache the result and return it on all subsequent force
  calls. See also - realized?

Source

(defmacro delay
  "Takes a body of expressions and yields a Delay object that will
  invoke the body only the first time it is forced (with force or deref/@), and
  will cache the result and return it on all subsequent force
  calls. See also - realized?"
  {:added "1.0"}
  [& body]
    (list 'new 'clojure.lang.Delay (list* `^{:once true} fn* [] body)))

Example 1

Edit
;; In this example you can see that the first time the delay is forced
;; the println is executed however the second dereference shows just the
;; precomputed value.

(def my-delay
  (delay
   (println "did some work")
   100))
;; => #'user/my-delay

@my-delay
;; > did some work
;; => 100

@my-delay
;; => 100

Uses on crossclj