diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-29 07:16:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-29 07:16:02 -0700 |
commit | c0fd923158dd56e4c8c19a7f60c64c39c7c8a1d4 (patch) | |
tree | ba9905767897a4e34d8fae3a33c2b8e03bd4da39 /eval.c | |
parent | 7a9786b4154f939e60bb2923b8b90a81f38e20ad (diff) | |
download | txr-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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)); |