From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: early termination for `map' Date: Thu, 05 May 2011 18:26:08 +0200 Message-ID: <8739kt2jxb.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1304612796 8769 80.91.229.12 (5 May 2011 16:26:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 16:26:36 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 05 18:26:32 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QI1Nm-00053w-CC for guile-devel@m.gmane.org; Thu, 05 May 2011 18:26:30 +0200 Original-Received: from localhost ([::1]:47486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI1Nl-00023P-Lr for guile-devel@m.gmane.org; Thu, 05 May 2011 12:26:29 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI1Nj-00023J-FP for guile-devel@gnu.org; Thu, 05 May 2011 12:26:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QI1Ni-00043D-Ex for guile-devel@gnu.org; Thu, 05 May 2011 12:26:27 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI1Ni-00042z-2G for guile-devel@gnu.org; Thu, 05 May 2011 12:26:26 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QI1Nf-0004zb-9W for guile-devel@gnu.org; Thu, 05 May 2011 18:26:23 +0200 Original-Received: from 193.50.110.208 ([193.50.110.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 18:26:23 +0200 Original-Received: from ludo by 193.50.110.208 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 18:26:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.208 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 =?iso-8859-1?Q?Flor=E9al?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:xqB2tBrqIspjBw4cg5CrLJ2J0z0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12430 Archived-At: Hello! Andy Wingo writes: > If you call `map' or `for-each' with more than one list, our versions of > these operators will detect if the lists are of unequal length, and > throw an error in that case. > > However, SRFI-1 has long provided an extension to this, to allow for > early termination when any of the lists runs out. R6RS adopted this, > and it looks like R7RS will ratify that. > > So perhaps it's time for us to change as well. To change the default ‘map’ & ‘for-each’ to do like SRFI-1’s, right? > This would also allow us to get rid of the hack in srfi-1.c in which, > when and if GOOPS gets loaded, srfi-1 extends the `map' and `for-each' > primitive generics with its own early-termination code, which in effect > gives early termination to every `map' user, regardless of whether that > module has imported srfi-1 or goops. Sometimes I think that Mikael put > the Oops in Goops for a reason ;-) Heh. :-) Code not using GOOPS can tell the difference between the default and SRFI-1 versions, and it can arrange to explicitly use one or the other. So changing the default versions would be an incompatibility—arguably not an important one, but still maybe enough to wait until 2.2? Thanks, Ludo’.