struct can't be accessed inside loop?
Posted: Fri Feb 12, 2010 7:39 am
Why am I getting this error from running "contains":
"EVAL: undefined function MOVE-X"?
TEST CODE
"EVAL: undefined function MOVE-X"?
Code: Select all
(defstruct move state previous f g h)
(defun contains (list x)
(let ((found nil))
(loop for y in list when (equal (move-x state) (move-y state)) return y)))
Code: Select all
(setf x (make-move :state '(1 2 3 4 - 5 6 7 8) :f 2 :g 0 :h 2))
(contains (cons (cons x nil) nil) x)