我有一个类消息的实例,我将称之为“味精”。我定义了一个类“my-message”,并希望实例“msg”现在成为该类。如何将一个实例“投”到一个子类?
这听起来像它应该是相对简单的,但我不知道该怎么做。改变班给了我一个我不明白的错误。
(defclass my-message (message)
((account-name :accessor account-name :initform nil :initarg :account-name)))
(change-class msg 'my-message :account-name account-name)
ERROR :
While computing the class precedence list of the class named MW::MY-MESSAGE.
The class named MW::MESSAGE is a forward referenced class.
The class named MW::MESSAGE is a direct superclass of the class named MW::MY-MESSAGE.
你说你有一个'msg'类的实例。在你的代码中,你使用了一个类“消息”。这个类的消息是在哪里定义的? –