[Armedbear-devel] Tail recursion

Christoph-Simon Senjak christoph.senjak at googlemail.com
Tue Nov 25 23:27:21 UTC 2014


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 at common-lisp.net
> http://mailman.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
> 


_______________________________________________
Armedbear-devel mailing list
Armedbear-devel at common-lisp.net
http://mailman.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel



More information about the armedbear-devel mailing list