I get a warning from the sbcl compiler that the variable is defined but not used. And the compiler is right. I want to get rid of the warning, but I donβt know how to do it. Here is an example:
(defun worker-1 (context p) ;; check context (make use of context argument) (if context (print p))) (defun worker-2 (context p) ;; don't care about context ;; will throw a warning about unused argument (print p)) ;; ;; calls a given worker with context and p ;; doesn't know which arguments will be used by the ;; implementation of the called worker (defun do-cmd (workerFn context p) (funcall workerFn context p)) (defun main () (let ((context ())) (do-cmd
The do-cmd function expects worker workers implementing a specific interface f (context p).
The sbcl compiler generates the following warning:
in: DEFUN WORKER-2 ; (DEFUN WORKER-2 (CONTEXT P) (PRINT P)) ; ; caught STYLE-WARNING: ; The variable CONTEXT is defined but never used. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition
source share