From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: early termination for `map' Date: Thu, 05 May 2011 17:24:21 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1304609121 16594 80.91.229.12 (5 May 2011 15:25:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 15:25:21 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 05 17:25:14 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 1QI0QS-00029i-Jk for guile-devel@m.gmane.org; Thu, 05 May 2011 17:25:12 +0200 Original-Received: from localhost ([::1]:34746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI0QS-00022b-0z for guile-devel@m.gmane.org; Thu, 05 May 2011 11:25:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI0QP-00022T-Ku for guile-devel@gnu.org; Thu, 05 May 2011 11:25:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QI0QO-00062W-E7 for guile-devel@gnu.org; Thu, 05 May 2011 11:25:09 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:59088 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QI0QO-0005sH-Bq for guile-devel@gnu.org; Thu, 05 May 2011 11:25:08 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 028A34C14 for ; Thu, 5 May 2011 11:26:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-type; s=sasl; bh=u qg3J6lhO9C4SNQvfi9EJhtrBJ8=; b=bLtzDFRAlaRBKmStQ5PtBdImYQfT0+qaK Qbjlg6UKA8UZTzpxY/j1hr9XfRqF/WYQgmAXCQo/1pbrFWCOALs+wCVKtlwlQzo3 MmLpXc6mC23zYjFjspxPNTVqcYtdC3zYfoutITyaWM+A4XiAGMI62i2wPK2TAxIb IfmnyYzdhE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:mime-version:content-type; q=dns; s=sasl; b=UEe 37Bijv6g4l7X8UyyoaMF77qkDOJasKPL5HIvk17p2gPh5cGYnsPhPL9nEJoE0OGp bgHds5Ta9x1QQV/LDXrbm3alQYs1SXx8T7jSfeOmITKH747RsKeZmp8KXBa5Vbua hkaeN62xKuPc9yonmbAnNUBLhsxjkF/BHW1vN7zs= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id EF1474C13 for ; Thu, 5 May 2011 11:26:28 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 925614C10 for ; Thu, 5 May 2011 11:26:28 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 0C416C84-772C-11E0-A2B4-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:12427 Archived-At: Hello, 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. 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 ;-) Andy -- http://wingolog.org/