From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doco srfi-1 count Date: Thu, 01 May 2003 10:48:41 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <873cjzcx06.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1051750229 6408 80.91.224.249 (1 May 2003 00:50:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 1 May 2003 00:50:29 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 01 02:50:24 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19B2HH-0001ev-00 for ; Thu, 01 May 2003 02:50:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B2HL-0008NA-00 for guile-devel@m.gmane.org; Wed, 30 Apr 2003 20:50:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19B2Gw-0008M7-00 for guile-devel@gnu.org; Wed, 30 Apr 2003 20:50:02 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19B2G3-00080a-00 for guile-devel@gnu.org; Wed, 30 Apr 2003 20:49:07 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B2Fz-0007zN-00 for guile-devel@gnu.org; Wed, 30 Apr 2003 20:49:03 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h410n0I4012304 for ; Thu, 1 May 2003 10:49:00 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h410n08D008436 for ; Thu, 1 May 2003 10:49:00 +1000 (EST) Original-Received: from localhost (ppp98.dyn228.pacific.net.au [203.143.228.98]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h410mwYZ018347 for ; Thu, 1 May 2003 10:48:59 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19B2Fd-0000fG-00; Thu, 01 May 2003 10:48:41 +1000 Original-To: guile-devel@gnu.org User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2242 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2242 --=-=-= 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. --=-=-= Content-Disposition: attachment; filename=srfi-modules.texi.count.diff --- 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--