diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-11-29 23:15:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-11-29 23:15:48 -0800 |
commit | 65189fb5a549a4149db9a6b59bd89d2d8009b89b (patch) | |
tree | c6d0e395b6466c01d1739f2e034cd9ff2ab77f5a /txr.1 | |
parent | 5cdd2fd5ff14c113b867df969779c75fca79932e (diff) | |
download | txr-65189fb5a549a4149db9a6b59bd89d2d8009b89b.tar.gz txr-65189fb5a549a4149db9a6b59bd89d2d8009b89b.tar.bz2 txr-65189fb5a549a4149db9a6b59bd89d2d8009b89b.zip |
* eval.c (eval_init): New functions countqual, countql, countq
and count_if registered as intrinsics.
* lib.c (countqual, countql, countq, count_if): New functions.
* lib.h (countqual, countql, countq, count_if): Declared.
* txr.1: New functions documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -6626,6 +6626,21 @@ Examples: [(remql* 13 (range 1)) 0..100] +.SS Functions countqual, countql and countq + +.TP +Syntax: + + (countq <object> <list>) + (countql <object> <list>) + (countqual <object> <list>) + +.TP +Description + +The countq, countql and countqual functions count the number of objects +in <list> which are eq, eql or equal to <object>, and return the count. + .SH APPLICATIVE LIST PROCESSING .SS Functions remove-if, keep-if, remove-if* and keep-if* @@ -6676,6 +6691,24 @@ Examples: '(("abcd" 4) ("defg" 5))) -> (("defg 5)) +.SS Function count-if + +.TP +Syntax: + + (count-if <predicate-function> <list> : <key-function>) + +.TP +Description: + +The countove-if function counts the numer of elements of <list> which satisfy +<predicate-function> and returns the count. + +The optional <key-function> specifies how each element from the <list> is +transformed to an argument to <predicate-function>. If this argument is omitted +or specified as nil, then the predicate function is applied to the elements +directly, a behavior which is identical to <key-function> being (fun identity). + .SS Function tree-find .TP |