diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
commit | 8466d8cfa486fb30d1755c4261b781135083787b (patch) | |
tree | c8c12c67246f543c3cc4f64d1c07e003cb1d45ae /promise.scm | |
parent | 87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (diff) | |
download | slib-upstream/3a1.tar.gz slib-upstream/3a1.zip |
Import Upstream version 3a1upstream/3a1
Diffstat (limited to 'promise.scm')
-rw-r--r-- | promise.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/promise.scm b/promise.scm index f38aebf..44ffea1 100644 --- a/promise.scm +++ b/promise.scm @@ -1,5 +1,5 @@ ;;;"promise.scm" promise for force and delay -;;; From Revised^4 Report on the Algorithmic Language Scheme +;;; From Revised^5 Report on the Algorithmic Language Scheme ;;; Editors: William Clinger and Jonathon Rees ; ; We intend this report to belong to the entire Scheme community, and so @@ -7,9 +7,9 @@ ; particular, we encourage implementors of Scheme to use this report as ; a starting point for manuals and other documentation, modifying it as ; necessary. - -(define promise:force (lambda (object) (object))) - +;@ +(define force (lambda (object) (object))) +;@ (define make-promise (lambda (proc) (let ((result-ready? #f) @@ -23,7 +23,10 @@ (begin (set! result-ready? #t) (set! result x) result)))))))) - ;;; change occurences of (DELAY <expression>) to ;;; (MAKE-PROMISE (LAMBDA () <expression>)) -;;; and (define force promise:force) +;@ +(define-syntax delay + (syntax-rules () + ((delay expression) + (make-promise (lambda () expression))))) |