[Xotcl] Missing introspection methods for class methods
Gustaf Neumann
neumann at wu.ac.at
Fri May 25 12:19:51 CEST 2012
> as far as I can see, nx is currently missing any methods to introspect
> class level methods. (I know there is info lookup, but that's not exactly
> what I want to do).
one can use "/cls/ class info methods" to introspect class
level methods.
See e.g.
http://next-scripting.org/docs/2.0b3/doc/nx/nx-migration/index1#_introspection
> Also, as classes can be treated as objects, it's confusing that that
> calling `MyClass info methods` returns the instance methods of the class,
> whereas `$my_object info methods` returns the objects callable methods.
keep in mind, that "method" is used to create either class
level methods (available
for instances of the class) and object level methods
(available for objects).
Object level methods are defined by
/obj/ method foo args {....}
/cls/ class method bar args {....}
The latter one defines "bar" as a method of the class object.
"/obj/ info methods" returns always the methods defined by
the entity, where as
"/obj/ info lookup methods ..." returns the methods callable
by the obj (consumer side).
all the best
-gustaf neumann
More information about the Xotcl
mailing list