title: User-friendly wrappings for tail recursive functions
body: <p>I am trying to learn common lisp. I'm familiar with tail recursion, but I'm unfamiliar with the idiomatic way to wrap a tail recursive function in a way that the caller does not have to initialize the accumulator variable(s). Here is an example:</p>
  
  <pre><code>(defun add-em (n s) 
      (if (eql n 0) 
          s 
          (add-em (- n 1) (+ s n))
      )
  ) 
  </code></pre>
  
  <p>Say I wanted to wrap this function so that the user only has to manage inputting <code>n</code> and does not need the full function call <code>(add-em &lt;number&gt; 0)</code>. In other languages, such as scala, I would define an inner function and then at the end of the outer function I would call the tail-recursive inner function to run the algorithm. </p>
  
  <p>In common lisp I could define a lambda in the function and use that, but it seems kind of ugly. I figured there may be a more idiomatic way to do it but googling hasn't really given me any results.</p>
  
  <p>Is there a more idiomatic way to do this other than splitting the functions entirely? Or is that the best way? An example:</p>
  
  <pre><code>(defun add-em-inner (num sum)
         (if (eql num 0)
         sum
         (add-em-inner (- num 1) (+ num sum))
         )
  )
  
  (defun add-em (n) 
    (add-em-inner n 0)
  )
  </code></pre>