From 55f404607c503d8fe7d0b187f064e29667ac1496 Mon Sep 17 00:00:00 2001 From: Dan Leslie Date: Mon, 12 Nov 2018 23:48:43 -0800 Subject: Fixes autodoc in Chicken, #258 --- scheme/chicken/geiser/chicken5.scm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scheme/chicken') 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)) -- cgit v1.2.3