How to "cast" an instance to a subclass?

Viewed 283

I have an instance of class message I'll call "msg". I have defined a class "my-message" and would like instance "msg" to now be of that class.

It sounds to me like it should be relatively straightforward, but I don't know how to do it. change-class gives me an error I don't understand.

(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.
2 Answers
Related