Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你好,谁能帮帮我?
(defun f(x) (LIST ((* 2 x) (* 3 x))) ) (f 1)
我明白了,Illegal argument in functor position: (* 2 X) in ((* 2 X) (* 3 X)).
Illegal argument in functor position: (* 2 X) in ((* 2 X) (* 3 X))
它应该是:
(defun f (x) (list (* 2 x) (* 3 x)))
您在 的参数周围有一组额外的括号list。当表达式是列表时,首先应该是要调用的函数,所以
list
((* 2 x) (* 3 x))
不是一个有效的表达式,因为(* 2 x)它不是一个函数。
(* 2 x)