【发布时间】:2014-01-01 16:13:10
【问题描述】:
当我在 repl 中使用 setf 时它工作正常,但如果我尝试在文件中使用它然后编译它并将其发送到 repl,它会给出错误。为什么我会看到这种奇怪的行为?
在 repl 中工作正常:
(setf books
'((war-and-peace leo-tolstoy)
(spin charles-wilson)
(harry-potter jk-rowling)
(speaker-for-the-dead orson-scott-card)))
从文件编译时出现此错误:
clagitsc.lisp:187:1:
warning:
BOOKS is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
warning:
in #:|187 193 (SETF BOOKS '(# # # ...))-34| in lines 187..193 : BOOKS is neither
declared nor bound,
it will be treated as if it were declared SPECIAL.
Compilation failed.
我在带有 CLisp 2.49 的 windows 上使用带有 emacs 24.3 的 slime,并且我正在通过 Common Lisp: A Gentle Introduction to Symbolic Computation 工作。
【问题讨论】:
标签: common-lisp clisp