Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 479 Bytes

promise.md

File metadata and controls

9 lines (6 loc) · 479 Bytes

promise

(promise)

clojure.core/promise: a promise, undelivered: deref (and @) blocks until deliver delivers it. future? is false of it, realized? whether it was delivered, and the timed deref answers its default while nothing was delivered. On the WASM backends, single-threaded by construction, the call refuses instead. As a value a zero-argument function.

(let [p (promise)] (deliver p 7) (println @p (realized? p))) ; 7 true