From 2032f3d1db09aa63de4ec060081a5bf9053f0d3c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 21 May 2009 21:39:37 +0200 Subject: [PATCH] fix multiple values returning from srfi-18's `with-exception-handler' * module/srfi/srfi-18.scm (with-exception-handler): Hah! Fixed a scurrilous bug in which we assumed that the thunk returned one or more values. Hah. --- module/srfi/srfi-18.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/srfi/srfi-18.scm b/module/srfi/srfi-18.scm index 75f1088ab..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)))