title: Scheme sum of list
body: <p>First off, this is homework, but I am simply looking for a hint or pseudocode on how to do this.</p>
  
  <p>I need to sum all the items in the list, using <strong>recursion</strong>. However, it needs to return the empty set if it encounters something in the list that is not a number. Here is my attempt:</p>
  
  <pre><code>(DEFINE sum-list
    (LAMBDA (lst)
      (IF (OR (NULL? lst) (NOT (NUMBER? (CAR lst))))
        '()
        (+
          (CAR lst)
          (sum-list (CDR lst))
        )
      )
    )
  )
  </code></pre>
  
  <p>This fails because it can't add the empty set to something else.  Normally I would just return 0 if its not a number and keep processing the list.</p>