Re: Listing slots in CLOS
- From: tar@xxxxxxxxxxxxx (Thomas A. Russ)
- Date: 31 Mar 2008 10:01:14 -0700
Rupert Swarbrick <rswarbrick@xxxxxxxxx> writes:
Hi,
Is there a function, which will return a list (or whatever) of the slots
in a class that I've got an instance of? I'm working with a weird auto-
generated binding library, which I don't really understand... and I'd
like to be able to eyeball the fields I can play with!
Well, for eyeballing, you could try:
(describe my-insance)
or for interactive use
(inspect my-instance)
The only things I can find are slot-exists-p and slot-bound-p, which of
course aren't quite what I'm after. If there's not a portable way to do
this, I'm using sbcl.
This starts to get into MOP territory (MOP = MetaObject Protocol), which
has accessors that allow you to get the slots for a class. You can get
the class from the instance.
--
Thomas A. Russ, USC/Information Sciences Institute
.
- References:
- Listing slots in CLOS
- From: Rupert Swarbrick
- Listing slots in CLOS
- Prev by Date: Appropriate case for a macro?
- Next by Date: Re: Two questions about eq
- Previous by thread: Re: Listing slots in CLOS
- Next by thread: cheap wholesale, air max,90,87 ( paypal accept ) ( www. top-saler.com )
- Index(es):