[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with CLASS-INSTANCE-SLOTS
- To: commonloops.pa@Xerox.COM
- Subject: problem with CLASS-INSTANCE-SLOTS
- From: Dawn MacLaughlin <dmaclaug@VAX.bbn.com>
- Date: Tue, 24 Mar 87 11:29 EST
- Cc: dmaclaughlin@VAX.bbn.com
There is a problem with the class-instance-slots and
class-non-instance-slots functions. I have defined a new meta-class
which has one extra slot in it (as shown below). This throws off the
class-(non-)instance-slots functions so that they access the wrong
fields in the structure. This is because these functions have the
"position" of this slot wired into them--they return whatever is in the
7th and 8th positions. I read the note in braid.lisp about these
functions, which implies that they have to be redefined to work
correctly for my new meta-class. Is there a good way to make these
functions general enough so that the numbers (7 and 8) are not wired in?
I tried defining class-instance-slots as a method, which really messed
things up. I came up with a kludge which works, but involves using a
different name: REAL-CLASS-(NON-)INSTANCE-SLOTS.
Note: we are using *pcl-system-date* = 1/26/87 on a Symbolics Lisp
Machine. (While I'm at it, make-specializable doesn't work at all. I
sent out a bug report some time ago. Will this be fixed in the new
release?)
(defclass PACKET-HANDLING-MIXIN ()
((packets nil))
(:accessor-prefix nil))
(defclass NEW-META-CLASS
(packet-handling-mixin class)
())
(defmethod check-super-metaclass-compatibility ((class NEW-META-CLASS)
(super class))
(ignore class super)
t)
(defmethod check-super-metaclass-compatibility ((super class)
(class NEW-META-CLASS))
(ignore class super)
t)
(defclass NEW-META-CLASS-CLASS () () (:metaclass new-metaclass)))
(defmeth REAL-CLASS-INSTANCE-SLOTS (class)
(get-slot class 'instance-slots))
(defmeth REAL-CLASS-NON-INSTANCE-SLOTS (class)
(get-slot class 'non-instance-slots))