I'm writing a function in Common Lisp, but I'm getting this error I mentioned in the title.
(defun sample (graph-id vertices)
(cond
((null vertices) nil)
(t
(and
(setf
(gethash (list graph-id (first vertices)) *keys*)
MOST-POSITIVE-DOUBLE-FLOAT)
(sample graph-id (rest vertices))))))
In particular, when the compiler reaches the (gethash (list graph-id (first vertices)) *vertex-keys*)
line, if I swap graph-id (first vertices)
with (first vertices) graph-id
, the error disappears. It also disappears if I use second
, third
or any other nth
functions rather than first
, I can't understand why it happens.
vertices
is a list like (A B C D E F)