【发布时间】:2018-03-11 23:02:26
【问题描述】:
我的超类定义如下:
(defclass missionary-state (state)
((missionary-left :initarg :missionary-left :initform nil :accessor missionary-left
:documentation "the number of missionaries on the left side of the river")
(missionary-right :initarg :missionary-right :initform nil :accessor missionary-right
:documentation "the number of missionaries on the right side of the river")
(cannibal-left :initarg :cannibal-left :initform nil :accessor cannibal-left
:documentation "the number of cannibals on the left side of the river")
(cannibal-right :initarg :cannibal-right :initform nil :accessor cannibal-right
:documentation "the number of cannibals on the right side of the river")
(boat-pos :initarg :boat-pos :initform nil :accessor boat-pos
:documentation "the side the boat is on")))
这是我尝试加载后收到的错误消息:
Error: Class #<STANDARD-CLASS MISSIONARY-STATE>
can't be finalized because superclass STATE
is not defined yet
【问题讨论】:
-
defclass missionary-state (state)应该做什么? -
定义传教士国家阶层。
标签: class common-lisp superclass clos