(defpackage :winner
(:use :cl)
(:export e1))
(in-package :winner)
(define-condition e1 ()
((name
:initform "e1"
:reader name)
(package
:initform "winner"
:reader related-package)))
(defmethod print-object ((err e1) stream)
(FORMAT stream "~a~%~a~%" (name err) (related-package err)))
(defpackage :loser
(:use :cl :winner)
(:export e2))
(in-package :loser)
(define-condition e2 (e1)
((name
:initform "e2")
(package
:initform "loser")))
我现在期望:
(make-instance 'e1)
e1
winner
(make-instance 'e2)
e2
loser
但相反我得到
(make-instance 'winner:e1)
e1
winner
(make-instance 'loser:e2)
e1
loser
这是非常出乎意料的。我犯了什么错误?