Re: Listing slots in CLOS





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.

class-slots, or the union of class-direct-slots and class-indirect-slots if you are using MCL. This is what we call MOP, not standardized I fear, so it depends on your Lisp.

btw, there might be a lot of output sometimes, but some meta-help:

(apropos "SLOTS")

Use your google foo to think of strings that might be in the name of a function (or macro or method or global or any symbol) you think might exist.

kenny

--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
.