guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] Re-implement srfi-1 partition in C to avoid stack overflow


From: Kevin Ryde
Subject: Re: [Patch] Re-implement srfi-1 partition in C to avoid stack overflow
Date: Thu, 10 Jul 2003 09:11:30 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

Matthias Koeppe <address@hidden> 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.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]