On Sep 9, 2012, at 18:46, Pascal Costanza pc@p-cos.net wrote:
Another issue that I'm currently fighting with is initialization of class slots for classes for which I never create any instances:
(defclass test () ((slot :initform 42 :allocation :class)))
(slot-value (class-prototype (find-class 'test)) 'slot) will report an unbound slot. This is probably defensible based on the HyperSpec and the CLOS MOP specification, but I doubt its useful. I believe that class slots should be initialized in finalize-inheritance the latest, and not only in shared-initialize on instances, to be useful for such scenarios. (But it's fine if you disagree, then I have to live with that and find a different solution…)
I'm a bit slow with the fixes these days, but this should now be implemented in r14153.
Note that the related form
(defclass test () ((slot :initarg :slot :allocation :class)) (:default-initargs :slot 42))
currently still has the old behavior (unbound slot until the first instance is created). Do you think this should be fixed as well?
Rudi