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 22:21:27 +0200 Message-ID: <87r58clwzc.fsf@gnu.org> References: <8739kt2jxb.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1304626900 31201 80.91.229.12 (5 May 2011 20:21:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 20:21:40 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 05 22:21:36 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 1QI53G-0000M3-Bx for guile-devel@m.gmane.org; Thu, 05 May 2011 22:21:34 +0200 Original-Received: from localhost ([::1]:51382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI53F-0003sY-T3 for guile-devel@m.gmane.org; Thu, 05 May 2011 16:21:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI53D-0003sC-5F for guile-devel@gnu.org; Thu, 05 May 2011 16:21:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QI53B-0007La-4g for guile-devel@gnu.org; Thu, 05 May 2011 16:21:31 -0400 Original-Received: from solo.fdn.fr ([80.67.169.19]:33634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI53B-0007LQ-0V for guile-devel@gnu.org; Thu, 05 May 2011 16:21:29 -0400 Original-Received: from nixey (reverse-83.fdn.fr [80.67.176.83]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: lcourtes) by smtp.fdn.fr (Postfix) with ESMTPSA id 5D41144234; Thu, 5 May 2011 22:21:28 +0200 (CEST) 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 In-Reply-To: (Andy Wingo's message of "Thu, 05 May 2011 20:40:40 +0200") User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 80.67.169.19 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:12438 Archived-At: Andy Wingo writes: > On Thu 05 May 2011 18:26, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> 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 =E2=80=98map=E2=80=99 & =E2=80=98for-each=E2=80=99= to do like SRFI-1=E2=80=99s, right? > > Yeah, that was the proposal; but the argument is a bit weaker, now that > I found that the R6RS did not go with this change. So I don't really > know. Oh, OK. > The reason I was thinking of doing this is because it turns out to help > performance to have map in scheme, at this point; or at least not hurt > it, and things will get better when we grow an optimizer. Yes, and I think we can keep rewriting SRFI-1 in Scheme, even in 2.0. > So I implemented map in Scheme, with circularity detection and all, only > to find strange errors in the ecmascript compiler (!). Turns out those > errors happened when loading goops, because it tried to extend a > primitive generic, but map wasn't a primitive any more, and instead of > failing nicely it corrupted memory. Ooh, interesting. :-) Thanks, Ludo=E2=80=99.