Compiler errors Lisp非法函数调用,

Compiler errors Lisp非法函数调用,,compiler-errors,lisp,common-lisp,Compiler Errors,Lisp,Common Lisp,下面的代码不断抛出以下错误: 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

下面的代码不断抛出以下错误:

 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))
有人知道为什么吗?从语法上看,我看不出有什么问题。 注意:我使用的是sbcl

我的代码:

(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)))
setf第二个pop解决方案-两个圆括号?为什么?IF与else表单的语法为:

(if test-form then-form else-form)
表单不能以两个括号开头-只有一个例外:lambda x+x12

如果您想对多个表达式进行分组,请使用类似progn a b c。。。z、 设置第二个pop解决方案-两个圆括号?为什么?IF与else表单的语法为:

(if test-form then-form else-form)
表单不能以两个括号开头-只有一个例外:lambda x+x12


如果您想对多个表达式进行分组,请使用类似progn a b c。。。z、

实际上,要将多个表单分组在一起,请使用特殊运算符

您可以进一步将Consequitive呼叫分组:

(setf second (pop solution)
      first  (pop solution))

实际上,为了将多个窗体组合在一起,请使用特殊运算符

您可以进一步将Consequitive呼叫分组:

(setf second (pop solution)
      first  (pop solution))