> Agreed it's hard to replicate. What I'm getting at is that at present, it > seems they're rather hard to *support* everywhere, period. How useful are > tail calls if they only work in "very restricted" circumstances? It's a bit > of an offense against language orthogonality and compositionality, y'know?
The point of having a "be" keyword, in my mind, is to give programmers a way to tell the compiler "let me know if I'm doing anything that prevents this call from being optimized". Seen that way, it's essentially a static assertion. The offense against compositionality didn't come from the "be" keyword; it came from the inability to optimize the call, which exists with or without the "be" keyword. The error messages can make sense, right? I admit to not understanding most of the cases. "Cannot optimize tail call _here_ because resource 'ofile' is in scope. 'ofile' was declared _here_. Suggest adding braces or adding 'drop ofile;' or switching 'be' to 'ret'." "Cannot optimize tail call _here_ because it's a self call in a wrapped object. I'm terribly sorry." _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev