From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: Re: [bug #30070] multiple returns from map Date: Sat, 13 Aug 2011 17:56:53 +0200 Message-ID: References: <20100607-182303.sv74648.31837@savannah.gnu.org> <20110715-104507.sv78157.85748@savannah.gnu.org> <20110812-210321.sv20118.97813@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec5299f17274ae104aa65145b X-Trace: dough.gmane.org 1313251026 26771 80.91.229.12 (13 Aug 2011 15:57:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2011 15:57:06 +0000 (UTC) Cc: Szavai Gyula , bug-guile@gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Aug 13 17:57:02 2011 Return-path: Envelope-to: guile-bugs@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 1QsGa5-0005jV-DT for guile-bugs@m.gmane.org; Sat, 13 Aug 2011 17:57:01 +0200 Original-Received: from localhost ([::1]:35182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsGa4-0008VJ-Ub for guile-bugs@m.gmane.org; Sat, 13 Aug 2011 11:57:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsGa2-0008VB-74 for bug-guile@gnu.org; Sat, 13 Aug 2011 11:56:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QsGa0-0003VR-VG for bug-guile@gnu.org; Sat, 13 Aug 2011 11:56:58 -0400 Original-Received: from mail-iy0-f175.google.com ([209.85.210.175]:58884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsGZz-0003VB-Br; Sat, 13 Aug 2011 11:56:55 -0400 Original-Received: by iyn15 with SMTP id 15so3025949iyn.6 for ; Sat, 13 Aug 2011 08:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T2gEQ0Woz+7U1NNBqgtYkhhroYCN6/YiNmL47Gb13aU=; b=rTgwSX1fOI6XZW4LjuTrKDYOTKNDeObmz16WXP39PsuChgrSfje3RXliUCrbqJ0bHM BlBsjefzbX+tB3kWQOSjDzMZn6FuaIrKuMG5aP4G5LLl2AtjW2ZBqu4jih/5RXUpI5Pt iUAG9O9meQv3OLFResUtH9RTk5OGsRcNyCyLA= Original-Received: by 10.43.50.134 with SMTP id ve6mr1939975icb.42.1313251013380; Sat, 13 Aug 2011 08:56:53 -0700 (PDT) Original-Received: by 10.231.182.134 with HTTP; Sat, 13 Aug 2011 08:56:53 -0700 (PDT) In-Reply-To: <20110812-210321.sv20118.97813@savannah.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.175 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5770 Archived-At: --bcaec5299f17274ae104aa65145b Content-Type: text/plain; charset=ISO-8859-1 Yes a tail pointer was a mind slip . But I did changed the final reverse! to the functional reverse in the srfi-1 version of map and doing that should be enough. You pay at most 2x time wise due to the need to allocate twice as many conses, But there is no need to introduce new stack features as far as I can see. /Stefan On Fri, Aug 12, 2011 at 11:03 PM, Andy Wingo wrote: > Follow-up Comment #2, bug #30070 (project guile): > > Stefan, the tail pointer does preserve performance, but it does not > preserve > the R6RS invariant about multiple returns. > > Szavai is right. Perhaps we should provide some other definition of `map' > within R6RS to satisfy this requirement. However, a proper solution looks > more like recursion than iteration, and to do that with arbitrary-sized > lists > will require Guile to implement extendable stacks, which is a significant > hack. > > _______________________________________________________ > > Reply to this item at: > > > > _______________________________________________ > Message sent via/by Savannah > http://savannah.gnu.org/ > > --bcaec5299f17274ae104aa65145b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes a tail pointer was a mind slip . But I did
changed the final revers= e! to the functional reverse in the srfi-1 version of map
and doing tha= t should be enough. You pay at most 2x time wise due to the need to
allo= cate twice as many conses, But there is no need to introduce new stack feat= ures
as far as I can see.

/Stefan


O= n Fri, Aug 12, 2011 at 11:03 PM, Andy Wingo <INVALID.NOREPLY@gnu.org> = wrote:
Follow-up Comment= #2, bug #30070 (project guile):

Stefan, the tail pointer does preserve performance, but it does not preserv= e
the R6RS invariant about multiple returns.

Szavai is right. =A0Perhaps we should provide some other definition of `map= '
within R6RS to satisfy this requirement. =A0However, a proper solution look= s
more like recursion than iteration, and to do that with arbitrary-sized lis= ts
will require Guile to implement extendable stacks, which is a significant hack.

=A0 =A0_______________________________________________________

Reply to this item at:

=A0<h= ttp://savannah.gnu.org/bugs/?30070>

_______________________________________________
=A0Message sent via/by Savannah
=A0http://savannah.= gnu.org/


--bcaec5299f17274ae104aa65145b--