A new module for performing tail-call elimination
robin at reportlab.com
Thu Jul 16 11:28:07 CEST 2015
> The point is, people keep insisting that there are a vast number of
> algorithms which are best expressed using recursion and which require TCO to
> be practical, and yet when asked for examples they either can't give any
> examples at all, or they give examples that are not well-suited to
> recursion. Or, at best, examples which are equally good when written either
> using recursion or iteration.
> I do believe that such examples surely must exist. But I'm yet to see one.
I believe the classic answer is Ackermann's function
which is said to be not "primitive recursive" ie cannot be unwound into loops;
not sure whether that implies it has to be recursively defined or can perhaps be
broken down some other way. For more eye-glazing
More information about the Python-list