Re: Listing slots in CLOS



On Sun, 30 Mar 2008 13:03:59 -0600, Rupert Swarbrick wrote:

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!

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.

Rupert

Ahah. By way of

http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/faq/
lisp_5.faq

I found the mop function (in sbcl) sb-mop:class-slots. Result!

Sorry for the noise,

Rupert
.