次の 2 つの関数を読み込むと、clisp
成功します。
(defun func1 (l)
(defvar *count* nil)
(setq count 1)
(cond ((null l) 0)
((atom l) (+ count 1))
((atom (car l)) (+ count (func1 (cdr l))))
((listp (car l)) (+ (func1 (car l)) (func1 (cdr l))))
(t nil)) )
(defun func2 (l)
(defvar *resLis* nil)
(setq resLis '((0 0)))
(anotherFunc l resLis)
)
ただし、sbcl
エラーが発生します:
warning: undefined variable: COUNT
warning: undefined variable: RESLIS
Compilation failed.
sbcl
私は(私だけがうまくいくので)使用することを好みslime
ますが、上記のコードの何が問題になっていますか?
環境: Ubuntu 11.10、GNU CLISP 2.49、SBCL 1.0.50.0.debian