It appears recursion is nice but *iteration* takes up less space than
recursion?....

And tail recursion allows us to nest our recursion as insanely as we want
knowing that compiler/interpreter will convert it under the hood to
a for loop for us!?!??

I tried this in Python....

def f(x):
        print x,
        f(x)

It didn't go on forever but bombed with a "maximum recursion depth exceeded"
message.

If all the smart kids know about tail recursion then how come the Python
interpreter couldn't/didn't use tail recursion to prevent my infinite loop from
bombing?

Chris

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to