我正在尝试编译以下代码:
make.
nextState是一个函数,states-list是一个列表,两者都是定义的。我得到了"未定义的对state-list"的引用。 我不知道自己做错了什么。 任何帮助将不胜感激
答案 0 :(得分:1)
将严重的骆驼案件重命名为lisp案例我还剩下这个。
(defun next-states (st)
"generate all possible states"
(loop :for action :in (possible-actions)
:for aux := (next-state st action) :then (next-state st action)
:when (not (member aux states-list :test #'equalp))
:collect aux :into states-list
:finally (return states-list)))
这里的测试就是我所拥有的:
(defun possible-actions ()
"have duplicates to see not member in action"
'(0 1 3 3 4))
(defun next-state (st action)
"Simple version for test"
(+ st action))
(next-states 3) ; ==> (3 4 6 7)