4 ms·
In 2013, I made Common Lisp macros that provide something that looks like labels but is guaranteed tail recursive. https://www.kylheku.com/cgit/lisp-snippets/t
by kazinator 2y ago
In 2013, I made Common Lisp macros that provide something that looks like labels but is guaranteed tail recursive.
https://www.kylheku.com/cgit/lisp-snippets/tree/tail-recursion.lisp https://www.kylheku.com/cgit/lisp-snippets/tree/tail-recursi...
No docs or test suite, sorry. Just block comments.
A trampoline based thing, deftail, is provided for global tail calls.
In the paradigm implemented in this file, calls to tail functions are always tail calls, even if not in a tail context. If it looks like the return value of a tail call is used, too bad; that will never be reached.