Didier Verna wrote: > Hi again, > > Section "2.23.2 Slot Type Checking" continues to puzzle me, especially > the fact that you have to be within *methods* for the :type slot option > to be taken in consideration when writing something to a slot. For > instance, with: > > (defclass foo () > ((a :type fixnum))) > > (defvar *object* (make-instance 'foo)) > (setf (slot-value *object* 'a) 3.5) ;; this works like a charm > > > but: > > (defmethod setslot ((foo foo) val) > (setf (slot-value foo 'a) val)) > > (setslot *object* 3.5) ;; triggers a type error > > > Can somebody provide a rationale for this ?? > > > Most likely because no got around to doing it. Plus the most interesting/most common case is probably in a method.
I'll see what I can do, but I know very little about the pcl implementation. Ray