From 2bb2ffc51325a19b466fd0bb116800fb8be70c14 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 21 Apr 2010 16:55:30 -0400 Subject: [PATCH] fix to handle multiple value return --- collects/unstable/debug.ss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/collects/unstable/debug.ss b/collects/unstable/debug.ss index dd48296c8b..750c573cd8 100644 --- a/collects/unstable/debug.ss +++ b/collects/unstable/debug.ss @@ -15,7 +15,9 @@ (let ([e (with-handlers ([values (lambda (exn) (printf "~a raised exception ~a~n" 'f exn) (raise exn))]) - (apply f l))]) - (printf "~a result was ~a~n" 'f e) - e)))] + (call-with-values (lambda () (apply f l)) list))]) + (if (and (pair? e) (null? (cdr e))) + (printf "~a result was ~a~n" 'f (car e)) + (printf "~a results were ~a~n" 'f e)) + (apply values e))))] [(_ f . args) (debug (f . args))])) \ No newline at end of file