The code below keeps throwing the following error:
caught ERROR:
illegal function call
(LET ((SOLUTION 'NIL) (FIRST 0) (SECOND 0))
(DOLIST (EL LST)
(IF (NUMBERP EL)
(PUSH EL SOLUTION)
((SETF #) (SETF #) (PUSH # SOLUTION))))
(CAR SOLUTION))
Can anyone see why? Syntactically I can't see anything wrong with it. Note: I'm using sbcl.
My code:
(defun evalpostfix (lst)
(let ((solution '())
(first 0)
(second 0))
(dolist (el lst)
(if (numberp el) ;if
(push el solution) ;then
((setf second (pop solution)) ;else
(setf first (pop solution))
(push (funcall el first second) solution))))
(car solution)))