From 547363acef3c40350382bea812a533c6dbd532cc Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 16 Jun 2009 23:14:34 +0200 Subject: PLT: Output included in retorts. --- scheme/plt/geiser/eval.ss | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'scheme/plt') diff --git a/scheme/plt/geiser/eval.ss b/scheme/plt/geiser/eval.ss index 8022a4c..ec86370 100644 --- a/scheme/plt/geiser/eval.ss +++ b/scheme/plt/geiser/eval.ss @@ -46,9 +46,8 @@ (vector-ref (struct->vector e) 0)) (define (set-last-error e) - (set! last-result `((error (key . ,(exn-key e)) - (subr) - (msg . ,(exn-message e)))))) + (set! last-result `((error (key . ,(exn-key e))) + (output . ,(exn-message e))))) (define (set-last-result v . vs) (set! last-result `((result ,v ,@vs)))) @@ -57,10 +56,13 @@ (set-last-result (void)) (with-handlers ((exn? set-last-error)) (update-module-cache spec form) - (call-with-values - (lambda () (eval form (module-spec->namespace spec))) - set-last-result)) - last-result) + (let ((out + (with-output-to-string + (lambda () + (call-with-values + (lambda () (eval form (module-spec->namespace spec))) + set-last-result))))) + (append last-result `((output . ,out)))))) (define compile-in eval-in) -- cgit v1.2.3