mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
Stubbing out exception handling
This commit is contained in:
parent
25c3cc68c3
commit
dd7a8c1846
1 changed files with 25 additions and 0 deletions
25
runtime.h
25
runtime.h
|
@ -456,6 +456,31 @@ static void clear_mutations() {
|
|||
}
|
||||
/* END mutation table */
|
||||
|
||||
/* Exception handler */
|
||||
list exception_handler_stack = nil;
|
||||
|
||||
static object default_exception_handler(object err) {
|
||||
printf("Error: ");
|
||||
Cyc_display(err);
|
||||
printf("\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static object add_exception_handler(object handler) {
|
||||
// TODO: error checking on handler?
|
||||
exception_handler_stack = mcons(handler, exception_handler_stack);
|
||||
return handler;
|
||||
}
|
||||
|
||||
// TODO: remove ex handler, err if all are removed?
|
||||
// TODO: raise - call current exception handler
|
||||
|
||||
static void init_exception_handler(){
|
||||
// TODO: package default_exception_handler into a closure??
|
||||
// add_exception_handler(
|
||||
}
|
||||
/* END exception handler */
|
||||
|
||||
/* Global variables. */
|
||||
|
||||
static clock_t start; /* Starting time. */
|
||||
|
|
Loading…
Add table
Reference in a new issue