Delay

typesince v0.0-927 clojure.lang/DelayEdit
satisfies IDeref IPending IPrintWithWriter

(Delay. f value)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(deftype Delay [^:mutable f ^:mutable value]
  IDeref
  (-deref [_]
    (when f
      (set! value (f))
      (set! f nil))
    value)

  IPending
  (-realized? [x]
    (not f))

  IPrintWithWriter
  (-pr-writer [x writer opts]
    (-write writer "#object[cljs.core.Delay ")
    (pr-writer {:status (if (nil? f) :ready :pending), :val value} writer opts)
    (-write writer "]")))