Newbie: how to enumerate methods in a class

Syver Enstad <[email protected]> 08 Dec 2002 20:11:53 +0100
Newsgroups gmane.emacs.eieio
Message-ID <[email protected]>
"Eric M. Ludlam" <[email protected]> writes:

> >  I think some code like this can wipe out old methods though:
> >
> >(fset 'dead-method nil)
> >(put eieio-method-obarray nil)
>   [ ... ]
> 
> Oops, forgot my `put' syntax.  Try this insead:
> 
> (put 'dead-method 'eieio-method-obarray nil)

Thanks I'll look into it. I decided to port Kent Beck's xUnit (Unit
testing framework) as a project to help me learn more about elisp and
eieio. I already have a simple port finished, but I'd like to know how to
enumerate the methods of a class, given the class.

Pseudo code:

testMethods = []
for method in class:
    if method.asString().beginsWith('test-'):
       testMethods.append(method)



I'll enclose the work so far if anyone is interested in looking at it.

 

-- 

Vennlig hilsen 

Syver Enstad
(unnamed) (application/octet-stream, 6.1 KB) - not displayed