produces a delayed evaluation
Returns a promise that, when forced, evaluates the exprs, returning the final evaluated result. The result is then cached, so further uses of force return the cached value immediately.
(define p (delay (println "hello once") "hello")) (force p) ;; prints "hello once" (force p)
The first invocation of
p will print “hello once” to the console, and also return the string “hello”. Subsequent invocations of
p will only return “hello”.