This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: srfi1 patch
- From: Per Bothner <per at bothner dot com>
- To: Chris Dean <ctdean at sokitomi dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Tue, 13 Jul 2004 14:13:16 -0700
- Subject: Re: srfi1 patch
- References: <9800.1089594905@mercedsystems.com>
Chris Dean wrote:
Below is a patch for srfi1.scm to make all the functions accept very
large lists. We do this by constructing the functions so that Kawa can
eliminate the tail calls and compile it down to purely iterative code.
Comments welcome.
Checked this in with two trivial tweaks:
(1) Made %cars+cdrs/pair private
(2) Commented-out old implementation of partition!
using #|...|#, mainly to make it easier to bring it
back, if/when Kawa handles mutually tail-recursive
functions (in --no-full-tailcalls mode).
(It shouldn't be that difficult to optimize scan-in/scan-out
in partition!. Each is just a "label" in the code, and the
tail-calls are jumps to the labels. We would need to write
an analysis phase to determine when inlining is possible,
and generalize the existing tail-calling framework.)
I haven't gone through the patch line-by-line, to
see if all the algorithms are correct. That would take
a bit of work, thouh it would probably be a good idea for
for someone else wants to double-check this code.
--
--Per Bothner
per@bothner.com http://per.bothner.com/