3 ms·
I find this... still an odd definition. To quote Sussman/Abelson[1], "An evaluator that can execute a procedure such as sqrt-iter without requiring increasing
by taeric 10y ago
I find this... still an odd definition. To quote Sussman/Abelson[1], "An evaluator that can execute a procedure such as sqrt-iter without requiring increasing storage as the procedure continues to call itself is called a tail-recursive evaluator."
Specifically, the caller of this function will have to clear out the stack of all operations that were pushed. Something you wouldn't have to do on a tail or non-recursive function.
[1] https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-34.html#%_idx_6088 https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-34.htm...
- qwertyuiop924 10y agoIt is an odd definition, I won't deny that. I was trying to talk about possible implementation, as opposed to the typical definition, so it's possible that I should have used another term. By the way, this is the paper I was talking about. It won't explain my bizarre choice of words, but it might explain what I meant when I said that Scheme tail-call optimizes unconditionally: http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-379.pdf http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-...
- taeric 10y agoI think I see the difference. There are tail call optimizations, and then there is tail call recursion. They are two different things, potentially. Thanks for linking the paper!
- qwertyuiop924 10y agoYeah, there you go. That paper is part of a collection of papers, known as The Lambda Papers. If you enjoyed this one, you'll probably want to read the rest: http://library.readscheme.org/page1.html http://library.readscheme.org/page1.html