3 ms·
I don't see how that's an issue, at least for Rust. If a variable is captured by the tail-called function (i.e. the function receives the unique or borrowed po
by tomp 6y ago
I don't see how that's an issue, at least for Rust.
If a variable is captured by the tail-called function (i.e. the function receives the unique or borrowed pointer) then you can do TCO with an extra argument (said variable, owned/unique) and clean up at the end of the "loop".
If the variable isn't captured by the tail-called function, then it's unobservable (except through side effects) if it's deallocated before the tail call.