title: How does recursively iterating through lists with CDR work with Cons in Scheme?
body: <p>Specifically, I have the following function</p>
  
  <pre><code>(define (even-odd-filter x . intlist)   
    (if (equal? '() intlist)
        '()
        (if (equal? (modulo x 2) (modulo (car intlist) 2))
            (cons (car intlist) (even-odd-filter x (cdr intlist)))
            (even-odd-filter x (cdr intlist)))))
  </code></pre>
  
  <p>Can someone please explain why this would break on the second iteration?
  As far as I know, (car list) is meant to refer to the first element of list, however, in the second recursive call</p>
  
  <p><code>(modulo (car int list) 2)</code></p>
  
  <p>causes an error as the interpreter believes that <code>(car intlist)</code> references the whole list as opposed to the first element of said list.</p>
  
  <p>I am quite lost on this, and any help would be appreciated. </p>