Version 3 of my

Updated 2014-03-01 15:28:45 by pooryorick

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


official reference


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 variable traces or bind event handlers.