diff options
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))))) |