Re: getting slots and methods of an object
- From: "Tayssir John Gabbour" <tayss_temp2@xxxxxxxxx>
- Date: 28 Feb 2006 09:27:51 -0800
Alexis Gallagher wrote:
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.
There's a nice two-part tutorial, where the author inspects classes at
the repl using handy tools like DESCRIBE...
http://blogs.bl0rg.net/netzstaub/archives/000507.html
http://blogs.bl0rg.net/netzstaub/archives/000510.html
Tayssir
--
http://wiki.alu.org/Metaobject_Protocol
.
- References:
- getting slots and methods of an object
- From: Alexis Gallagher
- getting slots and methods of an object
- Prev by Date: Re: Sudoku Solver
- Next by Date: Re: Sudoku Solver
- Previous by thread: Re: getting slots and methods of an object
- Index(es):