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

Re: Shared slots, and the generality of WITH-ACCESSORS

> Is there any clear way to refer to a shared slot of a class even
> if an instance of the class is not available, indeed perhaps
> before any instance of that class has been made?  The standard
> referencing mechanism is SLOT-VALUE, but it requires an instance.
> I've heard that the class prototype (if the meta-object protocol
> specifies it) can access a shared slot, but does even the class
> prototype exist if no actual instance of the class has been made?

As I have put to consideration earlier, I would like to support above
notion, and extend it to the access of any slot in classes (I would
like to access default values in the class where I assign those values).
Here is a (moderated) overview of the previous discussions, some of which
may be useful to you:

        Slot descriptions are kept on the class, so you can access the default
        value with something like:

        (defun default-value (slot-name class)
          (slotd-initform (find-slotd 'name (class-slots class))))

-- this works nicely in the case where I used the :initform slot option,
   but slotd-initform does not access default-values (a class-option). Anyway,
   this brought me on the track to a possible route, using the accessor
   class-options on a class-object.

--Peter N. Saurugger
Molecular Biology Computing Center