Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    +1 for specifically mentioning that not all recursion is tail call. Commented Jun 8, 2010 at 1:52
  • Could you write me an example of what to avoid that would negate tail call? Commented Jun 8, 2010 at 1:58
  • @Isaiah: A simple implementation of a factorial does: (defun fact (n) (if (> n 0) (* n (fact (- n 1))) 1)) The reason is that the multiplication is done after the recursive call returns. Commented Jun 8, 2010 at 2:44
  • I would replace "some CL implementations" with "most CL implementations". @Greg Hewgill: just to make it clear, the * invocation would be tail called (but that does not help the recursion). Commented Jun 8, 2010 at 8:05