emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tail-call elimination


From: Chris Gray
Subject: tail-call elimination
Date: Mon, 10 Dec 2012 18:57:05 -0800

Hello,

I have attached a patch that implements tail-call elimination for a subset of emacs lisp.  This will be helpful in allowing coding styles which emphasize tail recursion, such as is usual in languages like Scheme. 
The subset of emacs lisp that is targeted is compiled and lexically bound. 

There are some downsides to tail-call elimination.  The most obvious is that debugging will be more complicated.  Since the memory usage is not allowed to grow because of a tail call, the debug stack will not show the function that was called in the tail call.  I think the benefits outweigh this, but I'm obviously biased. :)

I'm also not a regular contributor to emacs, so please let me know if there is anything I need to do to the patch to get it accepted.

Cheers,
Chris

Attachment: tco.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]