summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-05 16:11:00 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-05 16:11:00 -0800
commit38bb7375b93b048be6331e3376e091e7506e0fde (patch)
tree4e9245ddd5b5a4d5844386b5512489a5f3fca40f /share
parent70ddb25b6534b1dbf0e69b53dc768a80bb4838e0 (diff)
downloadtxr-38bb7375b93b048be6331e3376e091e7506e0fde.tar.gz
txr-38bb7375b93b048be6331e3376e091e7506e0fde.tar.bz2
txr-38bb7375b93b048be6331e3376e091e7506e0fde.zip
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.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/ifa.tl3
1 files changed, 3 insertions, 0 deletions
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