小编Kos*_*lon的帖子

Common Lisp 似乎不能理解脚本中的 cdr 请求,但可以理解 REPL 中的它

下午好。

我正在自学 Common Lisp,但在我的代码中遇到了特定行的问题。

这是一个在竞技场中进行战斗的两室冒险 - 整个目标是一次性编写提示命令,因此我必须为 Common Lisp 设置一种方法来查看一行文本并确定哪个是房间,这是进入的方向。

我决定将其编码为:


(defparameter  *world* '(room  direction))

Run Code Online (Sandbox Code Playgroud)

然后像这样分开房间和方向:


(defparameter *direction* (cdr *world*))

Run Code Online (Sandbox Code Playgroud)

和


(defparameter *room* (car  *world*)

Run Code Online (Sandbox Code Playgroud)

普通的lisp好像看不懂


(defparameter *direction* (cdr *world*))

Run Code Online (Sandbox Code Playgroud)

并告诉我:


Unhandled SB-C::INPUT-ERROR-IN-LOAD in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                 {10010B0523}>:
  READ error during LOAD:

    end of file on #<SB-SYS:FD-STREAM for "file C:\\Users\\micha\\common_lisp\\arena.lisp" {10022F4C23}>

    (in form starting at line: 169, column: 41, file-position: 4438)

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10010B0523}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-C::INPUT-ERROR-IN-LOAD {10024CEF73}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK …
Run Code Online (Sandbox Code Playgroud)

common-lisp

1
推荐指数
1
解决办法
71
查看次数

标签 统计

common-lisp ×1