core: WIP exceptions

This commit is contained in:
Jan Nieuwenhuizen 2019-11-10 13:55:22 +01:00 committed by Jan (janneke) Nieuwenhuizen
parent 18df035abc
commit 23ba160476
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 5 additions and 4 deletions

View File

@ -177,11 +177,11 @@ along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
(loop (acons id e a))))))))) (loop (acons id e a)))))))))
(lambda (key . args) (lambda (key . args)
(if (defined? 'with-output-to-string) (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 (begin
(display "exception:" (current-error-port)) (display "exception: " (current-error-port))
(display key (current-error-port)) (display key (current-error-port))
(display ":" (current-error-port)) (display ": " (current-error-port))
(display args (current-error-port)) (write args (current-error-port))
(newline (current-error-port)))) (newline (current-error-port))))
(loop a)))))) (loop a))))))

View File

@ -32,6 +32,7 @@ assert_number (char const *name, struct scm *x)
if (x->type != TNUMBER) if (x->type != TNUMBER)
{ {
eputs (name); eputs (name);
eputs (": ");
error (cell_symbol_not_a_number, x); error (cell_symbol_not_a_number, x);
} }
} }