From c8d5fd566e7acc5ed3f42d210d4f494efde0772b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 3 Sep 2021 07:01:03 -0700 Subject: 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. --- tests/019/load-hook.tl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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*))) -- cgit v1.2.3