summaryrefslogtreecommitdiff
path: root/scheme/chicken/geiser/chicken5.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/chicken/geiser/chicken5.scm')
-rw-r--r--scheme/chicken/geiser/chicken5.scm17
1 files changed, 12 insertions, 5 deletions
diff --git a/scheme/chicken/geiser/chicken5.scm b/scheme/chicken/geiser/chicken5.scm
index 6c8ceae..5409058 100644
--- a/scheme/chicken/geiser/chicken5.scm
+++ b/scheme/chicken/geiser/chicken5.scm
@@ -142,11 +142,18 @@
(newline)))
(define (eval* str)
- (handle-exceptions exn #f
- (with-all-output-to-string
- (eval
- (with-input-from-string (->string str)
- (lambda () (read)))))))
+ (cond
+ ((string? str)
+ (handle-exceptions exn
+ (with-all-output-to-string (write-exception exn))
+ (eval
+ (with-input-from-string str
+ (lambda () (read))))))
+ ((symbol? str)
+ (handle-exceptions exn
+ (with-all-output-to-string (write-exception exn))
+ (eval str)))
+ (else (eval* (->string str)))))
(define (fmt node)
(let* ((mod (cadr node))