title: Writing flatten method in Scheme
body: <p>I have been working on the following function flatten and so far have it working for just lists. I was wondering if someone could provide me with some insight on how to get it work with pairs? For example (flatten '(a .a)) would return (a a). Thanks.</p>
  
  <pre><code>(define (flatten list)
     (cond ((null? list) null)
           ((list? (car list)) (append (flatten (car list)) (flatten (cdr list))))
           (else
            (cons (car list) (flatten (cdr list))))))
  </code></pre>