[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chez 6a83bee 08/37: rewritten geiser:eval to fix th
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-chez 6a83bee 08/37: rewritten geiser:eval to fix the following bug: |
Date: |
Sun, 1 Aug 2021 18:25:56 -0400 (EDT) |
branch: elpa/geiser-chez
commit 6a83beef6b949bcc51ae56bff7bdb3acf67ae69b
Author: Chaos Eternal <chaos@shlug.org>
Commit: Chaos Eternal <chaos@shlug.org>
rewritten geiser:eval to fix the following bug:
when eval (make-violation)
it shall return: \#<condition &violation>
but previous impletement will treat it as an ERROR.
---
scheme/chez/geiser/geiser.ss | 53 ++++++++++++++++++++++++--------------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/scheme/chez/geiser/geiser.ss b/scheme/chez/geiser/geiser.ss
index e833e47..ca50295 100644
--- a/scheme/chez/geiser/geiser.ss
+++ b/scheme/chez/geiser/geiser.ss
@@ -30,35 +30,40 @@
(define (geiser:eval module form . rest)
rest
- (let* ((try-eval (lambda (x . y)
- (call/cc
- (lambda (k)
- (with-exception-handler
- (lambda (e)
- (k e))
- (lambda ()
- (if (null? y) (eval x)
- (eval x (car y)))
- ))))))
+ (let* ((body (lambda ()
+ (if module
+ (eval form (environment module))
+ (eval form))))
(result-mid (call-with-values
- (lambda () (if module
- (try-eval form (environment module))
- (try-eval form)))
- (lambda (x . y)
- (if (null? y)
- x
- (cons x y)))))
- (result result-mid)
- (error (if (condition? result-mid)
+ (lambda ()
+ (call/cc
+ (lambda (k)
+ (with-exception-handler
+ (lambda (e)
+ (k 'error e))
+ (lambda ()
+ (call-with-values
+ (lambda ()
+ (body))
+ (lambda (x . y)
+ (if (null? y)
+ (k 'single x)
+ (k 'multi (cons x y))))))))))
+ (lambda (t v)
+ (cons t v))))
+ (result (if (eq? (car result-mid) 'error)
+ ""
+ (with-output-to-string
+ (lambda ()
+ (pretty-print (cdr result-mid))))))
+ (error (if (eq? (car result-mid) 'error)
(cons 'error (list
(cons 'key
(with-output-to-string
- (lambda () (display-condition
result-mid))))))
+ (lambda () (display-condition (cdr
result-mid)))))))
'())))
- (write `((result ,(with-output-to-string
- (lambda ()
- (pretty-print result))))
- (output . "")
+ (write `((result ,result)
+ (output . "")
,error))
(newline)))
- [nongnu] branch elpa/geiser-chez created (now 03da1c1), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 2a7a3f6 01/37: Add preliminary support for Chez Scheme, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 1f1ee00 02/37: Clean-up elisp code, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 1bb0a87 06/37: Handle exceptions of ChezScheme and multi-value as well, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 993b630 07/37: Alway pretty-print for results, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez ab13b7f 03/37: Chez: add rudimentary autodoc support, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez e4c15a7 04/37: fix call the chez scheme executable., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 6a83bee 08/37: rewritten geiser:eval to fix the following bug:,
Philip Kaludercic <=
- [nongnu] elpa/geiser-chez 2fb484b 05/37: Use (car (process-lines ...)) instead of (shell-command ...), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez a5a6176 11/37: fix compile and load for chez, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 2d682c0 13/37: fix for geiser-chez-parameters, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 7bc8f62 14/37: Capture stdout in ChezScheme's eval:geiser, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 352515c 16/37: Begin the summary lines of all elisp libraries with three semicolons, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez a0f6fc3 15/37: Add rudimentary Chez support for macro expansion, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 146d4a7 18/37: Fix indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 9d66c63 24/37: chez: pretty printing macroexpand results., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 502b3ac 20/37: Use cl-lib instead of cl, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chez 086dbba 23/37: make chez display output and error messages., Philip Kaludercic, 2021/08/01