X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/a5720988bb39845d7845ace6cea32c5d7f89dfb4..2032f3d1db09aa63de4ec060081a5bf9053f0d3c:/module/srfi/srfi-18.scm diff --git a/module/srfi/srfi-18.scm b/module/srfi/srfi-18.scm index 925ecb304..dd92079be 100644 --- a/module/srfi/srfi-18.scm +++ b/module/srfi/srfi-18.scm @@ -151,8 +151,10 @@ (hashq-set! thread-exception-handlers ct hl) (handler obj)) (lambda () - (let ((r (thunk))) - (hashq-set! thread-exception-handlers ct hl) r)))))) + (call-with-values thunk + (lambda res + (hashq-set! thread-exception-handlers ct hl) + (apply values res)))))))) (define (current-exception-handler) (car (current-handler-stack))) @@ -249,8 +251,8 @@ (define (wrap thunk) (lambda (continuation) (with-exception-handler (lambda (obj) - (apply (current-exception-handler) (list obj)) - (apply continuation (list))) + ((current-exception-handler) obj) + (continuation)) thunk))) ;; A pass-thru to cancel-thread that first installs a handler that throws