我有一个我正在尝试编译的函数,但在过去的 30 分钟里我一直在努力弄清楚为什么这段代码会给我一个Undeclared free variable
错误。我正在使用 Emacs,但无法解释为什么会出现此错误。
(defun pretty-all(res diff)
(let* ((v-list (blank-unit-list res))
(c-list (blank-unit-list res)))
(complete-fill c-list v-list res (total-res res) diff)
(format t
"Resistance is ~S~% Voltage is ~S~% Current is ~S~%"
res v-list c-list)))
blank-unit-list
, complete-fill
,total-res
都是我自定义的函数。
我很确定这个错误与我构建代码的方式有关,但正如我之前所说,我不知道是什么。
从 Emacs 复制:
3 compiler notes:
CircuitFunctions.lisp:61:64:
warning: Undeclared free variable RES
CircuitFunctions.lisp:61:70:
warning: Undeclared free variable V-LIST
CircuitFunctions.lisp:61:81:
warning: Undeclared free variable C-LIST
Compilation failed.