summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-10 07:39:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-10 07:39:55 -0700
commit5761d2e6c82f5234d4e63a49bc0a59ab69bbf0ed (patch)
treec3846797884f74c0958c3ce3005395c08de9178e /lisplib.c
parente4fe68098144ea52eb9d4b35c381988dbf387be2 (diff)
downloadtxr-5761d2e6c82f5234d4e63a49bc0a59ab69bbf0ed.tar.gz
txr-5761d2e6c82f5234d4e63a49bc0a59ab69bbf0ed.tar.bz2
txr-5761d2e6c82f5234d4e63a49bc0a59ab69bbf0ed.zip
New macro: pic.
* lisplib.c (pic_instantiate, pic_set_entries): New static functions. (lisplib_init): Register autoloading of pic.tl module via new functions. * share/txr/stdlib/pic.tl: New file.
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 21c1ac59..90bdc987 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -918,6 +918,23 @@ static val doc_set_entries(val dlt, val fun)
return nil;
}
+static val pic_instantiate(val set_fun)
+{
+ funcall1(set_fun, nil);
+ load(scat2(stdlib_path, lit("pic")));
+ return nil;
+}
+
+static val pic_set_entries(val dlt, val fun)
+{
+ val name[] = {
+ lit("pic"),
+ nil
+ };
+ set_dlt_entries(dlt, name, fun);
+ return nil;
+}
+
val dlt_register(val dlt,
val (*instantiate)(val),
val (*set_entries)(val, val))
@@ -974,6 +991,7 @@ void lisplib_init(void)
dlt_register(dl_table, quips_instantiate, quips_set_entries);
dlt_register(dl_table, match_instantiate, match_set_entries);
dlt_register(dl_table, doc_instantiate, doc_set_entries);
+ dlt_register(dl_table, pic_instantiate, pic_set_entries);
reg_fun(intern(lit("try-load"), system_package), func_n1(lisplib_try_load));
}