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)
(sample 0 '(A B C D E F))with*keys*defined to be an empty hash table, and i get no errors on CLISP or SBCL. How are you calling this, and what's the value of the relevant global variable?(sample id '(A B C D E F)), whereidis equal to'grafo. TheMOST-POSITIVE-DOUBLE-FLOATis a constant defined in Lisp I guess, as it says here linkcond(for instance by something like((t ...)