> On Apr 25, 2017, at 3:37 PM, brendan <
bre...@cannells.com> wrote:
>
> Scheme implementations are required to have proper tail recursion. Racket goes further and lets the programmer make recursive calls from any position without fear because, to paraphrase Dr. Flatt, it's the 21st century and stack overflows should not be a thing. My questions are: Is there a name for this feature? And do any other major languages or implementations have it? Thanks.
Sadly, there are *many* names for this feature.
But first, a correction! Like Racket, Scheme implementations are also required to have the desired memory behavior (specifically, they must not grow without bound on a class of programs that makes only tail calls). It’s true that the standard uses the phrase “tail recursion,” but if you check it out, you’ll see that it’s not just recursive calls that are covered.
In answer to your actual question, the most common name is “Tail Call Optimization,” which many people correctly object to because it’s not an optimization, it’s a change to the meaning of terms in the language, at least if you can distinguish stack overflows from programs that run forever.
I once invented the name “tail-cursion” for this, which everyone hated.
Finally, I’m moderately fond of Dave Herman’s phrase “properly tail-calling,” though I admit that it’s not as short as it could be.
John Clements