[Top][All Lists]

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

Re: proper tail recursion for gcc

From: Richard Stallman
Subject: Re: proper tail recursion for gcc
Date: Mon, 4 Sep 2000 04:59:29 -0600 (MDT)

    The Dybvig paper explains their solution, where the first few results
    are stored in registers, while the rest is stored on the stack, in the
    same space where the arguments of the function were stored.

(In some cases the values take up more space than the arguments.
I suppose there are various ways to handle that rare case.)

Anyway, it would be reasonable to add a feature to GCC to do this job,
and it would not I think be terribly hard.

Does Scheme require returning multiple values to be done in a way that
will work with a caller that expects only the first value?  I don't
know, but Common Lisp does require this.  To make multiple value
returning compatible with an ordinary call probably requires a new
compiler feature.  At least I don't see a clean way to do that without
adding a compiler feature.

reply via email to

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