I'm working on a function that will let you measure the run-time of a passed function run-n-time
. It's not close to finished, because while writing the code, I came across a strange error. Note that I'm quite new to common lisp.
Inputting this into my sbcl-repl (version: SBCL 1.3.1.debian
)
(defun run-n-time (fn times argn)
(loop for n from 0 to times
do (apply fn (argn n))))
Gives me this output (unimportant stuff removed)
; caught STYLE-WARNING:
; The variable ARGN is defined but never used.
; in: DEFUN RUN-N-MEASURE
; (ARGN N)
;
; caught STYLE-WARNING:
; undefined function: ARGN
It states that argn
is unused and undefined.
I have no idea what's going on here, it's such a simple piece of code :(