On 12/10/2012 6:57 PM, Chris Gray wrote: > 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. Your patch eliminates tail calls only in byte compiled code. Until the interpreter also supports guaranteed tail call elimination or we byte-compile all forms before evaluating them, elisp developers cannot rely on the optimization and cannot write idiomatic tail recursive code. As a purely opportunistic optimization, not as a guaranteed language feature, I doubt tail call elimination is worth the complexity. I also don't particularly like code that relies on tail call elimination. I find it difficult to read, and as you note, the results can be surprising.