mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 16:27:35 +02:00
Transitioning away from Cyc_current_exception_handler2
This commit is contained in:
parent
87c266a44a
commit
02317f940d
3 changed files with 8 additions and 8 deletions
|
@ -368,7 +368,7 @@ extern object Cyc_exception_handler_stack;
|
|||
#define __glo__85exception_91handler_91stack_85 Cyc_exception_handler_stack
|
||||
|
||||
object Cyc_default_exception_handler(void *data, int argc, closure _, object err);
|
||||
object Cyc_current_exception_handler();
|
||||
object Cyc_current_exception_handler(void *data);
|
||||
object Cyc_current_exception_handler2(void *data); // TODO: this is temporary, will consolidate with above function
|
||||
void Cyc_rt_raise(void *data, object err);
|
||||
void Cyc_rt_raise2(void *data, const char *msg, object err);
|
||||
|
|
12
runtime.c
12
runtime.c
|
@ -372,9 +372,9 @@ object Cyc_default_exception_handler(void *data, int argc, closure _, object err
|
|||
}
|
||||
|
||||
object Cyc_current_exception_handler2(void *data) {
|
||||
return Cyc_current_exception_handler();
|
||||
return Cyc_current_exception_handler(data);
|
||||
}
|
||||
object Cyc_current_exception_handler() {
|
||||
object Cyc_current_exception_handler(void *data) {
|
||||
if (nullp(Cyc_exception_handler_stack)) {
|
||||
return primitive_Cyc_91default_91exception_91handler;
|
||||
} else {
|
||||
|
@ -387,7 +387,7 @@ void Cyc_rt_raise(void *data, object err) {
|
|||
make_cons(c2, err, nil);
|
||||
make_cons(c1, boolean_f, &c2);
|
||||
make_cons(c0, &c1, nil);
|
||||
apply(data, nil, Cyc_current_exception_handler2(data), &c0);
|
||||
apply(data, nil, Cyc_current_exception_handler(data), &c0);
|
||||
// Should never get here
|
||||
fprintf(stderr, "Internal error in Cyc_rt_raise\n");
|
||||
exit(1);
|
||||
|
@ -398,7 +398,7 @@ void Cyc_rt_raise2(void *data, const char *msg, object err) {
|
|||
make_cons(c2, &s, &c3);
|
||||
make_cons(c1, boolean_f, &c2);
|
||||
make_cons(c0, &c1, nil);
|
||||
apply(data, nil, Cyc_current_exception_handler2(data), &c0);
|
||||
apply(data, nil, Cyc_current_exception_handler(data), &c0);
|
||||
// Should never get here
|
||||
fprintf(stderr, "Internal error in Cyc_rt_raise2\n");
|
||||
exit(1);
|
||||
|
@ -1961,7 +1961,7 @@ void _cyc_system(void *data, object cont, object args) {
|
|||
// integer_type argc = Cyc_length(args);
|
||||
// dispatch_va(data, argc.value, dispatch_error, cont, cont, args); }
|
||||
void _Cyc_91current_91exception_91handler(void *data, object cont, object args) {
|
||||
object handler = Cyc_current_exception_handler2(data);
|
||||
object handler = Cyc_current_exception_handler(data);
|
||||
return_closcall1(data, cont, handler); }
|
||||
void _Cyc_91default_91exception_91handler(void *data, object cont, object args) {
|
||||
// TODO: this is a quick-and-dirty implementation, may be a better way to write this
|
||||
|
@ -2630,7 +2630,7 @@ static primitive_type _121_123_primitive = {{0}, primitive_tag, "<=", &__121_123
|
|||
static primitive_type apply_primitive = {{0}, primitive_tag, "apply", &_apply};
|
||||
static primitive_type _75halt_primitive = {{0}, primitive_tag, "%halt", &__75halt};
|
||||
static primitive_type exit_primitive = {{0}, primitive_tag, "exit", &_cyc_exit};
|
||||
static primitive_type Cyc_91current_91exception_91handler_primitive = {{0}, primitive_tag, "Cyc_current_exception_handler2", &_Cyc_91current_91exception_91handler};
|
||||
static primitive_type Cyc_91current_91exception_91handler_primitive = {{0}, primitive_tag, "Cyc_current_exception_handler", &_Cyc_91current_91exception_91handler};
|
||||
static primitive_type Cyc_91default_91exception_91handler_primitive = {{0}, primitive_tag, "Cyc_default_exception_handler", &_Cyc_91default_91exception_91handler};
|
||||
static primitive_type cons_primitive = {{0}, primitive_tag, "cons", &_cons};
|
||||
static primitive_type cell_91get_primitive = {{0}, primitive_tag, "cell-get", &_cell_91get};
|
||||
|
|
|
@ -472,7 +472,7 @@
|
|||
((eq? p '%halt) "__halt")
|
||||
((eq? p 'exit) "__halt")
|
||||
((eq? p 'Cyc-default-exception-handler) "Cyc_default_exception_handler")
|
||||
((eq? p 'Cyc-current-exception-handler) "Cyc_current_exception_handler2")
|
||||
((eq? p 'Cyc-current-exception-handler) "Cyc_current_exception_handler")
|
||||
((eq? p 'open-input-file) "Cyc_io_open_input_file")
|
||||
((eq? p 'open-output-file) "Cyc_io_open_output_file")
|
||||
((eq? p 'close-port) "Cyc_io_close_port")
|
||||
|
|
Loading…
Add table
Reference in a new issue