From ff9db4f3a6ee2a2bb5c821b73d59ffe792cbbc27 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 21 Jun 2015 20:02:40 -0700 Subject: * lisplib.c (ifa_set_entries): Add conda. * share/txr/stdlib/ifa.tl (conda): New macro. * tests/012/ifa.tl: Adding test for conda. * txr.1: Documenting conda. --- share/txr/stdlib/ifa.tl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share') diff --git a/share/txr/stdlib/ifa.tl b/share/txr/stdlib/ifa.tl index 180e5231..bffe8246 100644 --- a/share/txr/stdlib/ifa.tl +++ b/share/txr/stdlib/ifa.tl @@ -50,3 +50,10 @@ (it-temp [temps pos-candidate])) ^(let* (,*(zip temps args) (it ,it-temp)) (if (,sym ,*temps) ,then ,else)))))))) + +(defmacro conda (. pairs) + (tree-case pairs + (((test . forms) . rest) ^(ifa ,test (progn ,*forms) + (conda ,*rest))) + (() ()) + (else (throwf 'eval-error "conda: bad syntax: ~s" pairs)))) -- cgit v1.2.3