我一直盯着斯蒂尔的Common Lisp 语言,直到我脸色发青,仍然有这个问题。如果我编译:
(defun x ()
(labels ((y ()))
5))
(princ (x))
(terpri)
有时候是这样的:
home:~/clisp/experiments$ clisp -c -q x.lisp
;; Compiling file /u/home/clisp/experiments/x.lisp ...
WARNING in lines 1..3 :
function X-Y is not used.
Misspelled or missing IGNORE declaration?
;; Wrote file /u/home/clisp/experiments/x.fas
0 errors, 1 warning
home:~/clisp/experiments$
很公平。那么如何让编译器忽略函数 y?我试过这个:
(defun x ()
(labels (#+ignore(y ()))
5))
(princ (x))
(terpri)
它奏效了:
home:~/clisp/experiments$ clisp -c -q y.lisp
;; Compiling file /u/home/clisp/experiments/y.lisp ...
;; Wrote file /u/home/clisp/experiments/y.fas
0 errors, 0 warnings
home:~/clisp/experiments$
但不知何故,我认为这不是警告所暗示的。
我该怎么办?