Am 20.11.2014 um 20:54 schrieb Vibhu Mohindra:
One idea I have is to use deftro (described below) instead of defun for tail recursive functions. On TCO Lisps define deftro to just be defun. On others define it to rewrite the body. It won't optimise all tail calls, just those are self-recursive.
http://www.wispym.com/notes/tech/lisp/tco.txt
I haven't used this myself. But I might start, because it's not ugly in the following sense. Writing a tail recursive function and depending implicitly on TCO is non-portable. deftro is a portability layer.
How about something like scheme's named let, or clojure's loop?
Furthermore, I wonder whether it is possible to do something similar to chicken scheme, and let the stack overflow, but then handle the overflow accordingly.
Armedbear-devel mailing list Armedbear-devel@common-lisp.net http://mailman.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
_______________________________________________ Armedbear-devel mailing list Armedbear-devel@common-lisp.net http://mailman.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel