Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
列表应该是lambda表达式_Lambda_Lisp - Fatal编程技术网

列表应该是lambda表达式

列表应该是lambda表达式,lambda,lisp,Lambda,Lisp,我刚开始学习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) (

我刚开始学习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

任何帮助都将不胜感激

如果你想编程,你需要学习编程语言的语法

有关公共Lisp语法,请参阅。每个函数/宏/特殊运算符/。。。Common Lisp的语法在Common Lisp Hyperspec中进行了描述

如果需要,请参阅LET的语法

LET
需要一个绑定列表

如果
SETF
是一个表单。需要用括号括起来


NOT
只接受一个参数。

括号太多。在
之前删除一个,而不是
,否则它看起来像一个函数应用程序。你在
let
中缺少了括号。谢谢:)我知道,这是一个学习曲线,我的讲师在语法方面几乎什么都不做,他只给出了一个如何使用它的基本示例,其余的取决于你@用户1693910:幸运的是,有很多学习资源。Hyperspec描述了这种语言,有免费的书籍,好的编译器(如Clozure CL和SBCL)。。。