title: Solving Infix Arithmatic in LISP
body: <pre><code>(defun solve (L)
      (cond
      ((null L) nil)
      (t(eval (list (car (cdr L)) (car L) (car (cdr (cdr L))))))))    
  </code></pre>
  
  <p>The code I have is a simple evaluate program that works fine as long as the input is something like '(5 + 4). However I want to be able to solve other inputs such as <em>'(5 +( 3 - 1))</em> and <em>'(6 + 5)</em> - <em>(4 /2 )</em>. My problem obviously being how to handle the parentheses. I tried comparing the literal value of <em>'(</em> as in <em>((equal (car L) '( ) (solve(cdr L)))</em> but that only throws all of my close parentheses out of whack. Is there a way to check if an atom is a parentheses? </p>