我刚开始学习LISP和我刚开始我的头围绕它的逻辑,但我碰到的一个错误,我不能找到解决办法for..I'm肯定这是因为我误用地方括号或我滥用的功能一般,但我一直在现在凝视了一个小时,也没有取得任何进展!
(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
任何帮助将非常感激!