Issue 1684603: Add tail recursion (original) (raw)

Consider the following code: def fac(m): def iter(acc,n): if n <= 0 : return acc else: return iter(acc * n, n - 1) return iter(1,m)

#When called wtih a large parameter, you get exceed the recursion limit

fac(10000)

In a future release, I suggest updating the interpreter and byte code compiler to handle tail recursion properly as in scheme.