core: WIP exceptions

This commit is contained in:
Jan Nieuwenhuizen 2019-11-10 13:55:22 +01:00
parent 91dba33bf3
commit 197416e285
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 5 additions and 4 deletions

View File

@ -176,11 +176,11 @@ along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
(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))))))

View File

@ -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);
}
}