summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-03 07:01:03 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-03 07:01:03 -0700
commitc8d5fd566e7acc5ed3f42d210d4f494efde0772b (patch)
tree51d85fd5cce309b9ca7fe14eb75a5a45821c4ede /tests
parent6cf10bb9919aa27735f7d13539aaa871400777e4 (diff)
downloadtxr-c8d5fd566e7acc5ed3f42d210d4f494efde0772b.tar.gz
txr-c8d5fd566e7acc5ed3f42d210d4f494efde0772b.tar.bz2
txr-c8d5fd566e7acc5ed3f42d210d4f494efde0772b.zip
load: new macros push-after-load and pop-after-load.
* eval.c (me_push_after_load, me_pop_after_load): New static functions. (eval_init): Register push-after-load and pop-after-load intrinsic macros. * tests/019/load-hook.tl: Tests for correct expansion. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests')
-rw-r--r--tests/019/load-hook.tl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/019/load-hook.tl b/tests/019/load-hook.tl
index 0f33d081..e62e689b 100644
--- a/tests/019/load-hook.tl
+++ b/tests/019/load-hook.tl
@@ -16,3 +16,13 @@
(set counter nil)
(load "../load-hook.tlo")
(test counter 1)
+
+(mtest
+ (macroexpand-1 '(push-after-load))
+ (set *load-hooks* (cons (lambda ()) *load-hooks*))
+
+ (macroexpand-1 '(push-after-load x))
+ (set *load-hooks* (cons (lambda () x) *load-hooks*))
+
+ (macroexpand-1 '(pop-after-load))
+ (set *load-hooks* (cdr *load-hooks*)))