From: Taylor R Campbell Date: Thu, 3 Jan 2019 05:36:58 +0000 (+0000) Subject: Fix nested promises. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~31 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1a3496b8c7f7fcd61cc34c13a5f8f3e3f8ed5f86;p=mit-scheme.git Fix nested promises. --- diff --git a/src/runtime/boot.scm b/src/runtime/boot.scm index ff5a7a5ef..33a226a8e 100644 --- a/src/runtime/boot.scm +++ b/src/runtime/boot.scm @@ -436,9 +436,7 @@ USA. (object-type? (ucode-type delayed) (cell-contents object)))) (define (make-promise object) - (if (promise? object) - object - (make-cell (system-pair-cons (ucode-type delayed) #t object)))) + (make-cell (system-pair-cons (ucode-type delayed) #t object))) (define (make-unforced-promise thunk) ;(guarantee thunk? thunk 'make-unforced-promise) diff --git a/tests/runtime/test-promise.scm b/tests/runtime/test-promise.scm index 0378b0167..703baba85 100644 --- a/tests/runtime/test-promise.scm +++ b/tests/runtime/test-promise.scm @@ -30,9 +30,7 @@ USA. (define-test 'force-force-delay-delay (lambda () - (expect-error - (lambda () - (assert-eqv (force (force (delay (delay 0)))) 0))))) + (assert-eqv (force (force (delay (delay 0)))) 0))) ;; Adapted from SRFI 45.