I'm trying to compile the following code:
(defun nextStates (st)
"generate all possible states"
(setf N 0)
(setf states-list (make-list 9))
(setf list-actions (possible-actions))
(loop for x in list-actions do
(setf aux (nextState st x))
(when (not(member aux (states-list) :test #'equalp))
(progn
(setf (nth N states-list) aux)
(setf N (+ N 1))
)
)
)
(values states-list)
)
nextState is a function and states-list is a list, both of which are defined. I'm getting "undefined reference to states-list". I don't know what I'm doing wrong. Any help will be greatly appreciated
do?(loop :for var :in list :do expr1 expr2...). If you don't have a then clause you should(when (not (member...) expr1 expr2...)doafter(loop for x in list-actionsshould do the trick right? I tried to compile it that way and now I'm getting "Undefined function states-list. Why is is seeing states-list as a function?do:(loop for x in list-actions do (setf aux (nextState st x)) (when (not (member aux states-list :test #'equalp)) (setf (nth N states-list) aux) (setf N (+ N 1))))butNandauxmust exist though or you should add it as variables in the loop.