diff --git a/contrib/05.r7rs/src/file.c b/contrib/05.r7rs/src/file.c index f0410f9d..4147bd84 100644 --- a/contrib/05.r7rs/src/file.c +++ b/contrib/05.r7rs/src/file.c @@ -7,7 +7,11 @@ PIC_NORETURN static void file_error(pic_state *pic, const char *msg) { - pic_throw(pic, pic->sFILE, msg, pic_nil_value()); + struct pic_error *e; + + e = pic_make_error(pic, pic->sFILE, msg, pic_nil_value()); + + pic_raise(pic, pic_obj_value(e)); } static pic_value diff --git a/extlib/benz/error.c b/extlib/benz/error.c index b4964172..15e34087 100644 --- a/extlib/benz/error.c +++ b/extlib/benz/error.c @@ -154,21 +154,15 @@ pic_raise(pic_state *pic, pic_value err) } void -pic_throw(pic_state *pic, pic_sym *type, const char *msg, pic_value irrs) +pic_error(pic_state *pic, const char *msg, pic_value irrs) { struct pic_error *e; - e = pic_make_error(pic, type, msg, irrs); + e = pic_make_error(pic, pic_intern_cstr(pic, ""), msg, irrs); pic_raise(pic, pic_obj_value(e)); } -void -pic_error(pic_state *pic, const char *msg, pic_value irrs) -{ - pic_throw(pic, pic_intern_cstr(pic, ""), msg, irrs); -} - static pic_value pic_error_with_exception_handler(pic_state *pic) { diff --git a/extlib/benz/include/picrin/error.h b/extlib/benz/include/picrin/error.h index 7200ddf9..1435faa3 100644 --- a/extlib/benz/include/picrin/error.h +++ b/extlib/benz/include/picrin/error.h @@ -56,7 +56,6 @@ struct pic_proc *pic_pop_handler(pic_state *); pic_value pic_raise_continuable(pic_state *, pic_value); PIC_NORETURN void pic_raise(pic_state *, pic_value); -PIC_NORETURN void pic_throw(pic_state *, pic_sym *, const char *, pic_list); PIC_NORETURN void pic_error(pic_state *, const char *, pic_list); #if defined(__cplusplus) diff --git a/extlib/benz/read.c b/extlib/benz/read.c index c8cf6d70..50498ac2 100644 --- a/extlib/benz/read.c +++ b/extlib/benz/read.c @@ -10,7 +10,11 @@ static pic_value read_nullable(pic_state *pic, struct pic_port *port, int c); PIC_NORETURN static void read_error(pic_state *pic, const char *msg) { - pic_throw(pic, pic->sREAD, msg, pic_nil_value()); + struct pic_error *e; + + e = pic_make_error(pic, pic->sREAD, msg, pic_nil_value()); + + pic_raise(pic, pic_obj_value(e)); } static int