[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

slot-unbound unbound? <g>



I am having some fun with CLOS, and along the way have found myself trying
to take advantage of some MOP.

Getting #'slot-missing sorted out was a nice leap up the learning curve.

Maybe I'm just tired, but the same trick I used there is not working for
slot-unbound:
---------------------------
(defmethod slot-unbound :around (class obj slot-name)
  (format t "~&hi slot unbound entry ~A ~A" (class-name class) slot-name)
  (if (member (find-class 'rps) (class-precedence-list class))
    (progn (format t "~&unbound object next, slot: ~A" slot-name)
           (print obj)
           (inspect obj)
           (call-next-method))
    (call-next-method)))
---------------------------

The problem is: my method seems not even to be being invoked.

I am doing all this because the nearest object I can find in a backtrace
does indeed have a particular slot bound, on which slot I am getting an
unbound error. The default error on unbound is so unkind as to mention only
the slot, not the instance. Just trying to track down the object truly
unbound.

But even if I work this out another way, i would still like to know why I
am unable to play with slot-unbound as I can with slot-missing.

Cheers,

Ken