produces a lazy evaluation
Returns a promise in the form of a function. The provided expression will only be evaluated when the promise function is invoked. The expression will only be evaluated once, and then memoized.
(define p (delay (begin (println "hello once") "hello"))) (p) ;; prints "hello once" (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”.