我刚刚开始学习 LISP,我只是在思考它的逻辑,但是我遇到了一个错误,我找不到解决方案..我确定这是因为我误用了某处的括号,或者我一般滥用了一个函数,但我已经盯着它看了一个小时,还没有取得任何进展!
(defun not-touching (pos player move)
(let (legal? t)
if ((not (eq (member move '(0 1 2 3 4 7 8 11 12 13 14 15)) nil))
(mapcar #'(lambda(x) (if (not (member move x) nil)
(cond ((and (eq (nth (- (position move x) 1) x) nil)
(not (eq (nth (+ (position move x) 1) x) player))) t)
((and (not (eq (nth (- (position move x) 1) x) player))
(not (eq (nth (+ (position move x) 1) x) player))) t)
((and (not (eq (nth (- (position move x) 1) x) player))
(eq (nth (+ (position move x) 1) x) nil)) t)
(t setf legal? nil))
nil)) *outside-lines*))
legal?))
我得到的错误如下所示:
SYSTEM::%EXPAND-FORM: (NOT (EQ (MEMBER MOVE '(0 1 2 3 4 7 8 11 12 13 14 15)) NIL)) should be
a lambda expression
任何帮助将非常感激!