unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* doco srfi-1 count
@ 2003-05-01  0:48 Kevin Ryde
  0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2003-05-01  0:48 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

I noticed "count" from srfi-1 doesn't appear in the manual.  Assuming
that's only an accidental ommision I thought to propose the addition
below.

	* srfi-modules.texi (SRFI-1 Length Append etc): Add count.

What's described is per the srfi-1 spec, but the words are by me.  For
ease of reading the text is:

 - Scheme Procedure: count pred lst1 ... lstN
     Return a count of the number of times PRED returns true when
     called on elements from the given lists.

     PRED is called with N parameters `(PRED ELEM1 ... ELEMN)', each
     element being from the corresponding LST1 ... 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.


[-- Attachment #2: srfi-modules.texi.count.diff --]
[-- Type: text/plain, Size: 850 bytes --]

--- srfi-modules.texi.~1.8.~	2002-08-06 04:52:27.000000000 +1000
+++ srfi-modules.texi	2003-05-01 10:41:46.000000000 +1000
@@ -381,6 +381,20 @@
 containing the second elements of each lists, and so on.
 @end deffn
 
+@deffn {Scheme Procedure} count pred lst1 ... 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

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-01  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-01  0:48 doco srfi-1 count Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).