From 23ba16047662b06a9941fe747e8a751e9536d77a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 10 Nov 2019 13:55:22 +0100 Subject: [PATCH] core: WIP exceptions --- mes/module/mes/repl.mes | 8 ++++---- src/math.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mes/module/mes/repl.mes b/mes/module/mes/repl.mes index 9f2c3547..f3f2f30f 100644 --- a/mes/module/mes/repl.mes +++ b/mes/module/mes/repl.mes @@ -177,11 +177,11 @@ along with GNU Mes. If not, see . (loop (acons id e a))))))))) (lambda (key . args) (if (defined? 'with-output-to-string) - (simple-format (current-error-port) "exception:~a:~a\n" key args) + (simple-format (current-error-port) "exception: ~a: ~s\n" key args) (begin - (display "exception:" (current-error-port)) + (display "exception: " (current-error-port)) (display key (current-error-port)) - (display ":" (current-error-port)) - (display args (current-error-port)) + (display ": " (current-error-port)) + (write args (current-error-port)) (newline (current-error-port)))) (loop a)))))) diff --git a/src/math.c b/src/math.c index 8bc3d9c9..db456c92 100644 --- a/src/math.c +++ b/src/math.c @@ -32,6 +32,7 @@ assert_number (char const *name, struct scm *x) if (x->type != TNUMBER) { eputs (name); + eputs (": "); error (cell_symbol_not_a_number, x); } }