title: Scheme: how to split a list into two lists of odd-numbered entries and even-numbered entries?
body: <p>I am implementing merge sort in scheme, and I must do it by defining two helper methods: merge and split. </p>
  
  <p>Merge takes two lists (already in increasing order) and merges them together. I have done this as follows:</p>
  
  <pre><code>(define merge 
     (lambda (list1 list2)
         (if (null? list1)
            list2
               (if (null? list2)
                  list1
                     (if (&lt; (car list1) (car list2))
                        (cons (car list1) (merge (cdr list1) list2))
                        (cons (car list2) (merge (cdr list2) list1)))))))
  </code></pre>
  
  <p>The split method has me stumped though. I've found an example that accomplishes this in two separate methods ('odd-numbers' and 'even-numbers'), but I was wondering if there was a way to combine these into one method called 'split'?</p>
  
  <p>Example found here: <a href="http://www.cs.uc.edu/~franco/C511/html/Scheme/mergesrt.html" rel="nofollow">merge sort in scheme</a></p>
  
  <p>I am obviously quite new to scheme, can anyone help me understand how to do this?</p>