Version 4 of my

Updated 2014-06-09 11:27:03 by pooryorick

my ,a [Tcl another method of the same object.

Documentation

official reference

Description

my invokes any method, including non-exported methods, defined by current object, i.e., the object that the method which calls my is bound to.

my is actually a separate command that is created in each object's namespace, so it can be invoked from outside the object if you know the name of the namespace or if you use namespace code inside the object to wrap the invocation. This is useful for callbacks like variable traces or bind event handlers, and also for oo::objdefine foward and oo::define forward.