title: general recursion in scheme
body: <p>I am having a bit of problems with recursion. Just want to make sure I get better. Let's say I want to see if a n number is in a list. If it is, it returns true, otherwise, false. </p>
  
  <pre><code>(define (contains? n lst)
    (cond
      [(empty? lst) false]
      [(cons? lst)
     .....  (first lst)
        (contains? (rest lst)
  </code></pre>
  
  <p>the recursion part always tricks me. Is it necessary to call <code>cons?</code> here?  Because if you are just looking for the first of a list, it isn.t</p>
  
  <pre><code>(define (contains? n lst)
    (cond
      [(empty? lst) false]
     [(= n (first lst)) true]))
  
  (check-expect (contains? 1 (list 1 2)) true)
  (check-expect (contains? 1 empty) false)
  </code></pre>