<p dir="ltr">On Jul 28, 2015 1:36 PM, "Paul Rubin" <no.email@nospam.invalid> wrote:<br>
><br>
> Paul Rubin <no.email@nospam.invalid> writes:<br>
> > Chris Angelico was asking for examples of tail recursion that didn't<br>
> > have obvious looping equivalents.  Here's an Euler problem solution<br>
> > using memoization and (except that Python doesn't implement it) tail<br>
> > recursion with an accumulator.<br>
><br>
> Actually that's wrong, it's not really tail recursive because of the<br>
> addition in the memo combinator, whoops ;-).</p>
<p dir="ltr">Not just the addition, but the setdefault call as well. Without the addition that call could be tail-call optimized, but that's not the recursive call; the call to func is.</p>