(no title)
rabbut | 5 years ago
No, it’s not “tail call”, it’s “tail recursion” or “tail-end recursion”.
“Tail call” could be interpreted as any call from a function’s end, even one that adds to the stack.
rabbut | 5 years ago
No, it’s not “tail call”, it’s “tail recursion” or “tail-end recursion”.
“Tail call” could be interpreted as any call from a function’s end, even one that adds to the stack.
joppy|5 years ago
chriswarbo|5 years ago
Tail calls might add to the stack, or they might not; but they don't need to (whether or not they do depends on the particular language, implementation and possibly compiler options). If a call needs to use stack space (or equivalent, e.g. growing the term size in a rewrite system), then it's certainly not a tail call.
> No, it’s not “tail call”, it’s “tail recursion” or “tail-end recursion”.
I wouldn't be so dogmatic about terminology, especially since it's at odds with others' usage. This article is a particularly poor choice to get hung up on too, since most of the examples use a pair of mutually-recursive functions (go+eval or up+down), which both call each other and themselves (depending on which branch is taken). How do they fit into your overly-precise terminology?
What about the top-level 'map' definitions themselves? Most of them consist of a single call to the go/down function: that doesn't need to add to the stack. Would you insist on naming that 'tail recursion' or 'tail-end recursion', even though there are no calls back into these functions from anywhere else?
mst|5 years ago
That's why he said "I assume that tail-calls ... do not actually use stack space".
Also, 'tail recursion' is more likely to be read by people as referring to a tail call to the same function as is currently executing, whereas 'tail call' refers to the general case.
balfirevic|5 years ago