3 ms·
Given that Python has no tail-recursion optimisation, you really shouldn't be writing functions in this style to begin with. If you really want to though, I thi
by anon4 11y ago
Given that Python has no tail-recursion optimisation, you really shouldn't be writing functions in this style to begin with. If you really want to though, I think there is a way to make the fixed-point combinator also mess with the function internals and make the tail-call into a loop.
- boomlinde 11y agoI'd say that this depends very much on the problem. There are problems that are more elegantly and intuitively solved recursively without necessarily ascending very far on the, e.g. parsers for nested-but-not-terribly-so data, say some applications of S-expressions or a protocol like DHCPv6, or traversal of tree structures known not to be tall.