3 ms·
From my point of view TCO is exactly most useful when you are dealing with mutually recursive functions. Like eg a state machine where one state = one function
by eru 6y ago
From my point of view TCO is exactly most useful when you are dealing with mutually recursive functions.
Like eg a state machine where one state = one function. That's also the example in the corresponding Lambda the Ultimate paper.
But yes, getting TCO for simple self-recursive function is better than nothing.
- tomp 6y agoTCO is exactly as useful as async/await. Could you write an equivalent state machine manually? Yes. Do you want to? No.
- eru 6y agoWhat do you mean by 'exactly as useful'? I can see how they are both useful, and there are even some problems were either approach works. But I don't see an exact correspondence?