title: 2 tail recursive functions for length [racket]
body: <p>I am trying to write two separate tail recursive functions that compute the length of a list and I am given these limitations:</p>
  
  <ol>
  <li><p>write a version, <code>lengtht</code> that is tail recursive and uses external (non-nested) auxiliary functions as needed</p></li>
  <li><p>write a second version, <code>lengtht2</code> that uses no additional top-level functions. The function should still be tail-recursive, and can use any local bindings that you want</p></li>
  </ol>
  
  <p>I am new to racket and this is what I understand the general form of tail recursion is:</p>
  
  <pre><code>(define (func x)
      (cond (end-test-1 end-value-1)
            (end-test-2 end-value-2)
            (else (func reduced-x))))
  </code></pre>
  
  <p>I am just a little confused about how to do this</p>