我想编写这个程序来在列表中查找关键字。如果找到,则打印列表。但是出现错误,我无法解决。请给我一些建议。我是lisp的新手。
主程序是两个dolist(C中的两个)和一个list列表中的find关键字(二维数组)。
(defun kanna_find (key)
(let (
(result 0)
(kanna-table (list
(list "あ" "ア" "a")
(list "い" "イ" "i")
)
) ;; End of kanna table
) ;; End of let var define
(dolist (result kanna-table)
(dolist (item result)
(if (string= item key)
(print result))
) ;; End of the second dolist
) ;; End of the first dolist
) ;; End of let
)
(kanna_find "あ")
以下是调试信息
Debugger entered--Lisp error: (void-variable )
(list "い" "イ" "i")
(list (list "あ" "ア" "a") (list "い" "イ" "i"))
(let ((result 0) (kanna-table ...)) (dolist (result kanna-table) (dolist ... ...)))
kanna_find("あ")
eval((kanna_find "あ"))
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)
recursive-edit()