[slime-devel] Slime support for metaclasses

Ian Eslick eslick at csail.mit.edu
Tue Jan 24 02:39:35 UTC 2006


Slime's default inspector won't show slot values for metaclasses that 
override
the default storage locations for objects slots (i.e. where the default 
slot-boundp
returns nil).  The elephant interface to Berkeley-DB is one such 
system.  The

(defmethod inspect-for-emacs ((o standard-object) inspector)
  (declare (ignore inspector))
  (values "An object."
          `("Class: " (:value ,(class-of o)) (:newline)
            "Slots:" (:newline)
            ,@(loop
                 for slot in (swank-mop:class-slots (class-of o))
                 for slot-def = (find-effective-slot o slot)
                 for slot-name = (swank-mop:slot-definition-name slot-def)
                 collect `(:value ,slot-def ,(string slot-name))
                 collect " = "
                 collect (if (swank-mop:slot-boundp-using-class 
(class-of o) o slot)
                             `(:value ,(swank-mop:slot-value-using-class 
(class-of o) o slot-def))
                              "#<unbound>")
                 collect '(:newline)))))

If you add the two calls to slot-boundp-using-class and 
slot-value-using-class as shown
above you get the expected proper behavior for lisps that don't call the 
-using-class
mop functions from the slot-value and slot-boundp functions.  (I ran 
into this on Allegro 7.0
under Mac OS X).

The other change is to add these two functions to the swank-mop package 
exports.

It's a minor enough change I figured someone who checks in regularly can 
update this and
provide some judgement on whether there are likely to be any problems.

Regards,
Ian




More information about the slime-devel mailing list