我正在使用这个Lisp 编译器进行测试
有一件事情我不明白:如果一个空列表()评估自身:
(format t "~:a" ())
;; => ()
Run Code Online (Sandbox Code Playgroud)
为什么评估几个嵌套的空列表()不会评估为空列表?
(format t "~:a" (()))
;; => EVAL: undefined function NIL
;; why not () ?
(format t "~:a" ((())))
;; => EVAL: (NIL) is not a function name; try using a symbol instead
;; why not () ?
Run Code Online (Sandbox Code Playgroud)
从我的角度来看,()和NIL是相同的,所以内部空列表应该首先评估自身,然后外部列表应该“调用”新的内部评估空列表
我的头脑,我认为在进行计算时应该发生这样的情况:(粗体+斜体=当前评估的内容)
(()) => ( () ) => ( () ) => ()
似乎计划也不允许嵌套空列表调用
感谢您的阅读