diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-10-21 06:56:53 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-10-21 06:56:53 -0700 |
commit | f9d4303ea0875da3feba4b5eb0dd372b676b8652 (patch) | |
tree | 2b180a51b214f57562ab4b82a38538b174137842 /lib.c | |
parent | 81f7dcca6528252c1f0a57d3b5581c628efa4bf1 (diff) | |
download | txr-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); |