Slots of a slot definition metaobject 
Author Message
 Slots of a slot definition metaobject

I'm trying to get the list of effective slot definitions of (subclasses
of) slot definition metaobjects.

(clos:class-slots
   (make-instance 'clos:standard-effective-slot-definition :name ....))

  (of course the slot metaobject instance gets created by ensure-class
   via a customized defmclass in my code)

Unfortunately clos:class-slots or clos:class-direct-slots are not
specialised for standard-object or slot definition metaobjects.

As a side note, class browsers of both ACL and LispWorks allow me to
introspect slot metaobject slots, that's why I think there has to be a
way.

The reason is that I need to define a compute-effective-slot-definition
method for my new class metaobject class.  Although the slot contents
defined by the standard slot metaobject are copied from the direct slot
to the effective slot, for specialized slot metaobjects it is our task.
It would be better to copy fields programmatically (by finding the slots
of the slot metaobject) than to do it manually.

Thanks,
Robert



Sun, 21 Apr 2002 03:00:00 GMT  
 Slots of a slot definition metaobject

Quote:

> I'm trying to get the list of effective slot definitions of
> (subclasses of) slot definition metaobjects.

...
Being busy with AMOP-definitions, it just occurred to me that the ACL
and LW inspectors obviously use slot-value; now the only question is
whether it's possible to do it in a more platform-independent way.

Thanks
Robert



Sun, 21 Apr 2002 03:00:00 GMT  
 Slots of a slot definition metaobject

Quote:


> > I'm trying to get the list of effective slot definitions of
> > (subclasses of) slot definition metaobjects.
> ...
> Being busy with AMOP-definitions, it just occurred to me that the ACL
> and LW inspectors obviously use slot-value; now the only question is
> whether it's possible to do it in a more platform-independent way.

I disagree that it's obvious - implementors may have used
clos:class-slots :-)

Just to generate some traffic, here's the answer to my question: of
course I need to use class-of to get to the _definition_ of the slot
metaobject first, which is a standard-class:

(clos:class-slots
  (class-of
    (make-instance 'clos:effective-slot-definition :name 'foo)))

(Again, it's not a snippet from my code, just a test case.)

It's as platform-independent as it can get.  Long live MOP!

Robert



Sun, 21 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Structure slot-init accessing previous slot

2. Stump on MOP in re Slot definition

3. Arguments to :writer function in slot definitions.

4. computed types vs. slot definitions

5. C extension tp_getattr slot: structmember interface; new tp_* slots

6. Reading the PC-Card Slots

7. SLOT

8. float slot in Win32forth

9. PCI slot

10. Proposal: Robots with CD-ROM brain slot

11. many slots in realtime

 

 
Powered by phpBB® Forum Software