summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-16 06:42:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-16 06:42:51 -0700
commit193cf80ca30c3f99fba965ed8dade31eddb8e098 (patch)
treee68d85fdce4d6701393b39df945bb23470bee55e /lisplib.c
parent23eb2f71b79935622b19353fab1fc1fec2597381 (diff)
downloadtxr-193cf80ca30c3f99fba965ed8dade31eddb8e098.tar.gz
txr-193cf80ca30c3f99fba965ed8dade31eddb8e098.tar.bz2
txr-193cf80ca30c3f99fba965ed8dade31eddb8e098.zip
Adding compiler.
* lisplib.c (compiler_instantiate, compiler_set_entries): New static functions. (lisplib_init): Register auto-load for compiler via new functions. * share/txr/stdlib/compiler.tl: New file.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lisplib.c b/lisplib.c
index a8e68c4a..b4d20e59 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -644,6 +644,28 @@ static val asm_set_entries(val dlt, val fun)
return nil;
}
+static val compiler_instantiate(val set_fun)
+{
+ funcall1(set_fun, nil);
+ load(format(nil, lit("~acompiler.tl"), stdlib_path, nao));
+ return nil;
+}
+
+static val compiler_set_entries(val dlt, val fun)
+{
+ val sys_name[] = {
+ lit("compiler"),
+ nil
+ };
+ val name[] = {
+ lit("compile-toplevel"),
+ nil
+ };
+
+ set_dlt_entries_sys(dlt, sys_name, fun);
+ set_dlt_entries(dlt, name, fun);
+ return nil;
+}
static val op_set_entries(val dlt, val fun)
{
@@ -705,6 +727,7 @@ void lisplib_init(void)
dlt_register(dl_table, doloop_instantiate, doloop_set_entries);
dlt_register(dl_table, stream_wrap_instantiate, stream_wrap_set_entries);
dlt_register(dl_table, asm_instantiate, asm_set_entries);
+ dlt_register(dl_table, compiler_instantiate, compiler_set_entries);
if (!opt_compat || opt_compat >= 185)
dlt_register(dl_table, op_instantiate, op_set_entries);