This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: srfi1 patch


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]