[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared slots, and the generality of WITH-ACCESSORS
- To: firstname.lastname@example.org (Lawrence G Mayka +1 708 713 5166)
- Subject: Re: Shared slots, and the generality of WITH-ACCESSORS
- From: "Peter N. Saurugger" <email@example.com>
- Date: Fri, 23 Mar 90 14:23:18 CDT
- Cc: commonloops.pa@Xerox.COM
- In-reply-to: <900321-161053-6016@Xerox>; from "Lawrence G Mayka +1 708 713 5166" at Mar 21, 90 5:40 pm
- Redistributed: commonloops.pa
> 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