3 ms·
This Stack Overflow answer[1] presents an interesting way to do tail call optimization in Python using the Y combinator. [1] https://stackoverflow.com/a/185066
by oefrha 7y ago
This Stack Overflow answer[1] presents an interesting way to do tail call optimization in Python using the Y combinator.
[1] https://stackoverflow.com/a/18506625 https://stackoverflow.com/a/18506625
- klmr 7y ago> tail recursion in Python using the Y combinator Small correction: this answer does not use the Y combinator to optimise tail recursion in Python (and this would be impossible). Instead, it modifies the Y combinator to do this, by using an iterative loop in its implementation.
- oefrha 7y agoYes, I wasn’t very precise with my wording, and you seem to have responded to an even more imprecise version of my comment which I immediately edited.