summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-15 15:11:25 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-15 15:11:25 -0800
commit06b285ac2c60fd5f8dd5eee24c794d7ef21fee46 (patch)
treec78baf400f6358cee1de8dc748578c246497d669 /lisplib.c
parent29e448c01f92b1fe54511bdaf5564c774a91cb09 (diff)
downloadtxr-06b285ac2c60fd5f8dd5eee24c794d7ef21fee46.tar.gz
txr-06b285ac2c60fd5f8dd5eee24c794d7ef21fee46.tar.bz2
txr-06b285ac2c60fd5f8dd5eee24c794d7ef21fee46.zip
Functions for error reporting out of macros.
* eval.c (eval_init): Register sys:ctx-form and sys:ctx-name intrinsics. * lisplib.c (error_set_entries, error_instantiate): New static functions. (lisplib_init): Register autoloading of error.tl via new functions. * share/txr/stdlib/error.tl: New file. * struct.c (make_struct_type): Purge deferred warnings. * unwind.c (uw_late_init): Register purge-deferred-warning intrinsic.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lisplib.c b/lisplib.c
index 9d0472e4..b9aaf349 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -481,6 +481,23 @@ static val pmac_instantiate(val set_fun)
return nil;
}
+static val error_set_entries(val dlt, val fun)
+{
+ val name[] = {
+ lit("compile-error"), lit("compile-warning"), lit("compile-defr-warning"),
+ nil
+ };
+ set_dlt_entries(dlt, name, fun);
+ return nil;
+}
+
+static val error_instantiate(val set_fun)
+{
+ funcall1(set_fun, nil);
+ load(format(nil, lit("~aerror.tl"), stdlib_path, nao));
+ return nil;
+}
+
val dlt_register(val dlt,
val (*instantiate)(val),
val (*set_entries)(val, val))
@@ -518,6 +535,7 @@ void lisplib_init(void)
dlt_register(dl_table, getput_instantiate, getput_set_entries);
dlt_register(dl_table, tagbody_instantiate, tagbody_set_entries);
dlt_register(dl_table, pmac_instantiate, pmac_set_entries);
+ dlt_register(dl_table, error_instantiate, error_set_entries);
}
val lisplib_try_load(val sym)