info object methods

info object methods object ?option...?

Returns a list of public (i.e., exported) methods defined on the named TclOO object. The exact results can be modified via the options; these are:

-all — causes the methods defined by the class(es) of the object to be also returned.
-private — causes the private (i.e., non-exported, callable via my only) methods to also be returned.

Using both -all and -private causes all methods on the object, however defined, to be returned.

This word, -all, doesn't seem to mean what one might think it means.

Take this sentence:

Using both -all and -private causes all methods on the object, however defined, to be returned.

If using both -all and -private returns more methods than -all by itself, the -all wasn't really all after all.

Looking at the possible methods that might be returned, there are the object's public methods, the object's private methods, and the methods that the object inherits from its class(es).

It seems like -all should return all three, -private should return the private only, -public should return the object's public methods only, -class should return the methods defined by the class(es) of the object only, and -all would then just be shorthand for -public, -private, and -class. All public methods would be -public and -class. Maybe there should be an option -allpublic to get the common function.

I also wish there was a way to test if an object implements a specific method directly. One can query an object using info object methods and then checking to see if a particular method is on the list. I'd like to see something more like

info object understands object methodname

That would return a 1 if the object has a public method methodname and 0 if not.

That might be a more common use case.