summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-10-21 06:56:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-10-21 06:56:53 -0700
commitf9d4303ea0875da3feba4b5eb0dd372b676b8652 (patch)
tree2b180a51b214f57562ab4b82a38538b174137842 /lib.c
parent81f7dcca6528252c1f0a57d3b5581c628efa4bf1 (diff)
downloadtxr-f9d4303ea0875da3feba4b5eb0dd372b676b8652.tar.gz
txr-f9d4303ea0875da3feba4b5eb0dd372b676b8652.tar.bz2
txr-f9d4303ea0875da3feba4b5eb0dd372b676b8652.zip
* eval.c (eval_init): Register notf intrinsic function.
* lib.c (do_not): New static function. (notf): New function. * lib.h (notf): Declared. * txr.1: Documented notf. * share/txr/stdlib/txr-case.txr (bindable): Eliminated. (txr-if): Use functional expression, taking advantage of notf. * txr.vim: Regenerated.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index acac10dd..920b53cf 100644
--- a/lib.c
+++ b/lib.c
@@ -4572,6 +4572,16 @@ val orv(val funlist)
return func_f0v(nullify(funlist), do_or);
}
+static val do_not(val fun, val args)
+{
+ return null(apply(fun, args, nil));
+}
+
+val notf(val fun)
+{
+ return func_f0v(fun, do_not);
+}
+
static val do_iff(val env, val args)
{
cons_bind (condfun, choices, env);