Handling difficult tail-call optimization

We can look at the definition of Fibonacci numbers recursively. The following is one widely used definition for the nth Fibonacci number, :

A given Fibonacci number,  , is defined as the sum of the previous two numbers,  . This is an example of multiple recursion: it can't be trivially optimized as a simple ...

Get Functional Python Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.