title: Searching for a integer in a list (Lisp)
body: <p>I cannot think of a way to search a list to make sure it has all integers. I want to immediately return <code>nil</code> if there is non-integer data, and continue my function if there is not.</p>
  
  <p>The recursive function I am trying to make will <code>cons</code> the <code>car</code> with the <code>cdr</code> of the list. With the attempts I have made, I am not able to return <code>nil</code>. I have only been able to ignore the non-integer data.  E.g., <code>(add-1-all '(1 2 3 a))</code> will return <code>(2 3 4)</code> after adding one to each number.</p>
  
  <pre><code>    (defun add-1-all (L) 
              (if (null L) 
                  L
                (if (integerp (car L))
                    (cons (+ (car L) 1) (add-1-all (cdr L)))
                    nil)))
  </code></pre>
  
  <p>I do understand that the cons is making this happen, as the recursion is adding on to the list.</p>