From e508c8630c831181e12d53015365dded77ecef9b Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sat, 3 May 2003 22:27:14 +0000 Subject: [PATCH] (SRFI-1 Length Append etc): Add count. --- doc/ref/srfi-modules.texi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index 3b751acda..121f448db 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -381,6 +381,20 @@ first containing the first elements of each lists and the second containing the second elements of each lists, and so on. @end deffn +@deffn {Scheme Procedure} count pred lst1 @dots{} lstN +Return a count of the number of times @var{pred} returns true when +called on elements from the given lists. + +@var{pred} is called with @var{N} parameters @code{(@var{pred} +@var{elem1} @dots{} @var{elemN})}, each element being from the +corresponding @var{lst1} @dots{} @var{lstN}. The first call is with +the first element of each list, the second with the second element +from each, and so on. + +Counting stops when the end of the shortest list is reached. At least +one list must be non-circular. +@end deffn + @node SRFI-1 Fold and Map @subsection Fold, Unfold & Map