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: Re: [Patch] Re-implement srfi-1 partition in C to avoid stack overflow Date: Thu, 10 Jul 2003 09:11:30 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87isqbqorh.fsf@zip.com.au> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1057792931 25546 80.91.224.249 (9 Jul 2003 23:22:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2003 23:22:11 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jul 10 01:22:08 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 19aOGG-0006dd-00 for ; Thu, 10 Jul 2003 01:22:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19aOGJ-00038z-Gw for guile-devel@m.gmane.org; Wed, 09 Jul 2003 19:22:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19aODx-0002JE-Sf for guile-devel@gnu.org; Wed, 09 Jul 2003 19:19:45 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19aOCm-0001ru-C8 for guile-devel@gnu.org; Wed, 09 Jul 2003 19:18:33 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19aO8L-0000Gj-Mh for guile-devel@gnu.org; Wed, 09 Jul 2003 19:13:58 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.3) with ESMTP id h69NDuZY019701; Thu, 10 Jul 2003 09:13:56 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h69NDtQg010593; Thu, 10 Jul 2003 09:13:55 +1000 (EST) Original-Received: from localhost (ppp84.dyn228.pacific.net.au [203.143.228.84]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h69NBdnh026713; Thu, 10 Jul 2003 09:11:42 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19aO5z-00017J-00; Thu, 10 Jul 2003 09:11:31 +1000 Original-To: Matthias Koeppe Mail-Copies-To: never In-Reply-To: (Matthias Koeppe's message of "Thu, 19 Jun 2003 17:58:10 +0200") User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.lisp.guile.devel:2615 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2615 Matthias Koeppe writes: > > The partition procedure in srfi-1 does not work well in Guile. Even > for not-very-long input lists (like 500 elements), a stack overflow is > signaled. The reason seems to be the recursive use of receive and > values. There a few unfortunate places like that. I've been having a bit of a go (not yet quite ready) at new alist-delete, alist-delete! and alist-copy to that end too. append-map looks like another, and count (the general case, not count1) if I'm not mistaken. > + /* In this implementation, the output lists don't share memory with > + list, because it's probably not worth the effort. */ It might be nice to share everywhere it's permitted, if you could be bothered. (The non-tail recursion you're fixing is clearly the worst problem though.) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel