getting slots and methods of an object



Hello,

Is there a clean way to get a list of all the slots, accessors, and specializing methods defined on an object instance? If there's not a clean, implementation-independent way to do it, is there a hairy way to do it in SBCL or CMUCL?

When I asked about this on #cl-gardeners, I was told it required using the meta-object protocol, which for me is synonymous with dark, dangerous, implementation-specific black magic. But maybe I'm being too fearful...

The motivation is that I'm writing a small note and a little bit of code to introduce python users to Lisp. I'm trying to write a function which mirrors the generality of the python function dir(), which returns symbols defined within the namespace of modules, classes, objects, or functions.

Thanks,
alexis
.