From 8d4246f0b5cf3cfbe3a0cc3a9526d370ea9c26e1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 3 May 2009 01:49:40 +0200 Subject: PLT: handling correctly multiple values in evaluations. --- scheme/plt/geiser/eval.ss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scheme/plt') diff --git a/scheme/plt/geiser/eval.ss b/scheme/plt/geiser/eval.ss index 2345e14..090b517 100644 --- a/scheme/plt/geiser/eval.ss +++ b/scheme/plt/geiser/eval.ss @@ -91,13 +91,16 @@ (set! last-result `((error (key . ,(exn-key e)) (subr) (msg . ,(exn-message e)))))) -(define (set-last-result v) - (set! last-result `((result ,v)))) + +(define (set-last-result v . vs) + (set! last-result `((result ,v ,@vs)))) (define (eval-in form spec) (set-last-result (void)) (with-handlers ((exn? set-last-error)) - (set-last-result (eval form (ensure-namespace spec)))) + (call-with-values + (lambda () (eval form (ensure-namespace spec))) + set-last-result)) last-result) (define compile-in eval-in) -- cgit v1.2.3