[Armedbear-devel] Tail recursion

Vibhu Mohindra vibhu.mohindra at gmail.com
Wed Dec 3 21:45:46 UTC 2014


Hi Erik,

No, no idea or numbers about the fraction that would benefit.

The "optimisation" in TCO is different from its traditional sense, which is
usually "just" to provide a constant factor improvement in speed/memory.
TCO by contrast, allows or doesn't allow a programmer to use a certain
programming technique: recursion.

I use recursion a lot, and when I moved to ABCL, I found that a lot of code
broke on lists as short as a few thousand elements.

So I'm not referring so much to ABCL or its implementation as to a Lisp
program. A portable Lisp programmer can't rely on TCO being available. So
using defun/tro [1] lets them remain portable across Lisps.

It's probably not too hard to also optimise mutual recursion (f->g->f) in a
labels clause using a similar macro to defun/tro.

When I say I'm not referring specifically to ABCL, it means that if ABCL
implemented TCO, everything I wrote would just move over to another
(present or future) non-TCO ANSI Common Lisp's discussion forum when
someone enquired about it :-) .

Sorry about the delay. I haven't yet mastered this newsgroup's
(mailing-list's?) interface, and thought my last message hadn't even gone
through.

[1]: was deftro

Vibhu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20141203/081ddf23/attachment.html>
-------------- next part --------------
_______________________________________________
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