[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: List of slots for object?
- To: hall@aplcen.apl.jhu.edu
- Subject: Re: List of slots for object?
- From: Gregor J. Kiczales <gregor@parc.xerox.com>
- Date: Fri, 13 Jul 90 11:09:24 PDT
- Cc: CommonLoops.PA@Xerox.COM
- In-reply-to: Marty Hall's message of Fri, 13 Jul 90 09:52:29 EDT <9007131352.AA18884@aplcen.apl.jhu.edu>
- Line-fold: NO
- Redistributed: CommonLoops.PA
- Sender: gregor@parc.xerox.com
Date: Fri, 13 Jul 90 09:52:29 EDT
From: hall@aplcen.apl.jhu.edu (Marty Hall)
X-Mailer: Mail User's Shell (6.1 4/26/88)
Is there a general (non-PCL specific) way of getting a list of the
slots of an object? In PCL you can do
(pcl::slots-to-inspect (class-of <object>) <object>)
In the metaobject protocol, you can do:
(class-slots (class-of <object>))
to get a list of slot-definition metaobjects. You can convert that to a
list of slot names by doing:
(mapcar #'slot-definition-name (class-slots (class-of <object>)))
Most, but not all, CLOS implementations support this part of the
metaobject protocol.