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

Re: Adding new slot-options to defclass?

At 12:56 PM 3/28/94 -0700, Shannon V Spires wrote:
>I need to add a new slot option (like :accessor, :initarg, etc.)
>to certain slots in a defclass. The idea is that I would
>do some "special" processing as the class is being defined
>whenever a new slot option, like :foo, appeared in a slot
>What's the best way to do this? Ideally, one could write a method
>on make-instance, allocate-instance, initialize-instance, etc.,
>but I cannot find any evidence that MCL calls these functions
>when it's creating an instance of a metaclass (that is, doing
>a defclass). Is there any other way, or must I just rewrite
>the defclass macro?

The metaobject protocol specified how to extend DEFCLASS as
you desire. Unfortunately, MCL implements only a small subset of
the introspective MOP. DEFCLASS is hard-wired. You'll have to
rewrite it to get what you want.