ooutil

oo::util are utility commands for TclOO, found in the cvs head of tcllib.

This package provides a convenience command for the easy specification of instance methods as callback commands, like timers, file events, Tk bindings, etc.

This package isn't part of the ActiveTcl distribution: you will need to teacup install oo::util it.

mymethod method ?arg...?

This command is available within instance methods. It takes a method name and, possibly, arguments for the method and returns a command prefix which, when executed, will invoke the named method of the object we are in, with the provided arguments, and any others supplied at the time of actual invocation.

Note: The command is equivalent to and named after the command provided by the OO package snit for the same purpose.

Note: Though the description of ooutil::singleton in the documentation is correct, the usage example given is wrong. As of oo::util 1.2, instead use

ooutil::singleton create example {
    method foo {} {self}
}
# -> ::example
[example new] foo
# -> ::oo::Obj66
[example new] foo
# -> ::oo::Obj66