diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-07-18 06:15:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-07-18 06:15:49 -0700 |
commit | 1fcd2951cbca8b1a72b0a7665032859139f03d10 (patch) | |
tree | 12e4d72a84f2f32495bd0a0e1790ebe1d92e52cb /lib.h | |
parent | 980942732a366f2042eac777b2d1e259a19d3652 (diff) | |
download | txr-1fcd2951cbca8b1a72b0a7665032859139f03d10.tar.gz txr-1fcd2951cbca8b1a72b0a7665032859139f03d10.tar.bz2 txr-1fcd2951cbca8b1a72b0a7665032859139f03d10.zip |
New function: count.
The general count function, with keyfun and testfun,
is noticeably absent. Let's implement it.
* lib.[ch] (count): New function.
* eval.c (eval_init): Register count intrinsic.
* tests/012/seq.tl: Some tests for count.
* txr.1: Add count to count-if section. Revise documentation
based on pos/pos-if.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -724,6 +724,7 @@ val countqual(val obj, val list); val countql(val obj, val list); val countq(val obj, val list); val count_if(val pred, val list, val key); +val count(val item, val seq, val testfun_in, val keyfun_in); val some_satisfy(val list, val pred, val key); val all_satisfy(val list, val pred, val key); val none_satisfy(val list, val pred, val key); |