A new module for performing tail-call elimination
Robin Becker
robin at reportlab.com
Thu Jul 16 05:28:07 EDT 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
http://demonstrations.wolfram.com/RecursionInTheAckermannFunction/
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
http://math.stackexchange.com/questions/75296/what-is-the-difference-between-total-recursive-and-primitive-recursive-functions
--
Robin Becker
More information about the Python-list
mailing list