lua-users home
lua-l archive

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


Alex Queiroz wrote:
Hallo,

On 3/16/07, Doug Rogers <rogers@innocon.com> wrote:

Alex, that is comparing apples and oranges. The first example is true
recursion, the second is iteration. SICP (Structure and Interpretation
of Computer Programs) makes this distinction very early on. If your
point is that C does not provide support for tail recursion, say so. The
proper Scheme example would be:


    This is implemented iteration-like because of the tail calls, but
syntactically it's clearly recursion. I, as a programmer, do not use a
loop, and this is what is called abstraction. You did write a scheme
example to look like  the C one so the stack would explode. Could you
write a C example mimicking the scheme example I gave, without
exploding the stack?

As long as you let me compile it on gcc, yes.