From 38bb7375b93b048be6331e3376e091e7506e0fde Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 5 Feb 2017 16:11:00 -0800 Subject: Adding whena macro. We have ifa and conda; whena is conspicuously absent. * lisplib.c (ifa_set_entries): Add autoload entry for whena. * share/txr/stdlib/ifa.tl (whena): New macro. * txr.1: Documented whena. --- share/txr/stdlib/ifa.tl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/txr/stdlib/ifa.tl b/share/txr/stdlib/ifa.tl index 170e8eb5..e99d5d40 100644 --- a/share/txr/stdlib/ifa.tl +++ b/share/txr/stdlib/ifa.tl @@ -66,6 +66,9 @@ (if (,sym ,*(if (eq 'dwim sym) ^(,(second test))) ,*temps) ,then ,else))))))))) +(defmacro whena (test . body) + ^(ifa ,test (progn ,*body))) + (macro-time (defun sys:if-to-cond (if-oper cond-oper pairs) (tree-case pairs -- cgit v1.2.3