2 ms·
I've amusingly noticed that my 1988 edition of the book does not mention tail calls whatsoever, except in one early chapter where it is in relation to the imple
by kazinator 6y ago
I've amusingly noticed that my 1988 edition of the book does not mention tail calls whatsoever, except in one early chapter where it is in relation to the implementation of some parsing.
Index: [...] Tail recursion 52-53
On pages 52-53, they show how, in a token matching procedure that takes no arguments, and returns nothing, the recursive self call can be manually replaced by a backwards goto: "[w]e can speed up a program by replacing tail recursion by iteration. For a procedure without parameters, a tail-recursive call can be simply replaced by a jump to the beginning of the procedure."
There is no mention about the possibility of compilers doing this for you, or that there are other reasons for tail calls, like eliminating stack growth. The rest of the book is mum about tail calls.
- deleted 6y ago[deleted]