unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: doco srfi-1 count
Date: Thu, 01 May 2003 10:48:41 +1000	[thread overview]
Message-ID: <873cjzcx06.fsf@zip.com.au> (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

                 reply	other threads:[~2003-05-01  0:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873cjzcx06.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).