There are a few problems with TCO in Common Lisp:
* some platforms don't provide useful support (in the History it were some stack-oriented Lisp Machines, nowadays it is the JVM - see ABCL)
* there is no consensus how it should be invoked, how its effect should be reported by a compiler, how the user should be noted about limitations (example: LispWorks limits the number of variables), ...
* it is not a good fit with Common Lisp, since the language supports all kinds of dynamic constructs: dynamic binding, unwind-protect, ... It is not clear how this should interoperate with TCO in CL.
* it makes debugging more diffcult (backtraces, trace, ...)
Re:A Common Lisp Bookshelf
by momo-reina on Tuesday July 30, 2013 @02:55PM
(#6129189)
These were the exact points raised at #lisp. They also tried to explain the CL idiom to a recursive problem which I don't really recall except the fact that I didn't understand it...
Re:A Common Lisp Bookshelf
by momo-reina on Tuesday July 30, 2013 @10:36AM
(#6127154)
Yeah I've blown the stack more times than I can recall when using non-tail recursion. I do enjoy recursion, it seems like a clean and elegant solution, though I'm ridiculously preoccupied with writing non idiomatic code.
Pascal Costanza has an interesting opinion[1] on why TCO wasn't included in the ANSI standard.
Anyway, it is worthwhile to practice writing recursive solutions (beginning with Scheme) to understand possible pitfalls in case of non-tail recursion, and then, proudly, switch to fixed-space looping techniques.)