summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-29 07:16:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-29 07:16:02 -0700
commitc0fd923158dd56e4c8c19a7f60c64c39c7c8a1d4 (patch)
treeba9905767897a4e34d8fae3a33c2b8e03bd4da39 /eval.c
parent7a9786b4154f939e60bb2923b8b90a81f38e20ad (diff)
downloadtxr-c0fd923158dd56e4c8c19a7f60c64c39c7c8a1d4.tar.gz
txr-c0fd923158dd56e4c8c19a7f60c64c39c7c8a1d4.tar.bz2
txr-c0fd923158dd56e4c8c19a7f60c64c39c7c8a1d4.zip
New function: find-true.
This is like find-if, but returns the value of the predicate function rather than the item. * eval.c (eval_init): Register find-true instrinsic. * lib.c (find_true): New function. * lib.c (find_true): Declared. * stdlib/doc-syms.tl: Updated. * txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index f32608e2..48045bec 100644
--- a/eval.c
+++ b/eval.c
@@ -7150,6 +7150,7 @@ void eval_init(void)
reg_fun(intern(lit("rfind-if"), user_package), func_n3o(rfind_if, 2));
reg_fun(intern(lit("find-max"), user_package), func_n3o(find_max, 1));
reg_fun(intern(lit("find-min"), user_package), func_n3o(find_min, 1));
+ reg_fun(intern(lit("find-true"), user_package), func_n3o(find_true, 2));
reg_fun(intern(lit("multi-sort"), user_package), func_n3o(multi_sort, 2));
reg_fun(intern(lit("set-diff"), user_package), func_n4o(set_diff, 2));
reg_fun(intern(lit("diff"), user_package), func_n4o(diff, 2));