[Tutor] Ask a class for it's methods

Shrutarshi Basu technorapture at gmail.com
Sat Dec 13 00:06:35 CET 2008

I have a list containing strings like :


I want to turn them into method calls (with numeric or string
arguments) on a supplied object. I'm trying to figure out the best way
to do this. Since these lists could be very big, and the methods could
be rather complex (mainly graphics manipulation) I would like to start
by getting a list of the object's methods and make sure that all the
strings are valid. Is there a way to ask an object for a list of it's
methods (with argument requirements if possible)?
The next question is once I've validated the list, what's the easiest
way to turn the list element into a method call? I'll be parsing the
string to separate out the method name and arguments. If I store the
method name (say func1)  in a variable, say var, could I do
object.var() and have if call the func1 method in object?
Thanks for your help and I'll surely have more questions as I get along,

The ByteBaker :

More information about the Tutor mailing list