my − invoke any method of current object


package require TclOO

my methodName ?arg ...? ___________________________


The my command is used to allow methods of objects to invoke any method of the object (or its class). In particular, the set of valid values for methodName is the set of all methods supported by an object and its superclasses, including those that are not exported. The object upon which the method is invoked is always the one that is the current context of the method (i.e. the object that is returned by self object) from which the my command is invoked.

Each object has its own my command, contained in its instance namespace.


This example shows basic use of my to use the variables method of the oo::object class, which is not publicly visible by default:

oo::class create c {
method count {} {
variable counter
print [incr counter]
c create o
o count → prints "1"
o count → prints "2"
o count → prints "3"


next(n), oo::object(n), self(n)


method, method visibility, object, private method, public method

More Linux Commands

ldap_search_ext_s(3) - Perform an LDAP search operation.....
These routines are used to perform LDAP search operations. The ldap_search_ext_s() routine does the search synchronously (i.e., not returning until the operatio

XChangeSaveSet(3) - change a client's save set (Man Page)...
Depending on the specified mode, XChangeSaveSet either inserts or deletes the specified window from the clients save-set. The specified window must have been cr

Tcl_ParseQuotedString(3) - parse Tcl scripts and expressions
These procedures parse Tcl commands or portions of Tcl commands such as expressions or references to variables. Each procedure takes a pointer to a script (or p

fs(5) - Linux file-system types: minix, ext, ext2, ext3, ext
When, as is customary, the proc filesystem is mounted on /proc, you can find in the file /proc/filesystems which filesystems your kernel currently supports; see

dracut.conf(5) configuration file(s) for dracut (Man Page)
dracut.conf is loaded during the initialisation phase of dracut. Command line parameter will overwrite any values set here. *.conf files are read from /usr/lib/

glutSetMenu(3) - sets the current menu; glutGetMenu - return
glutSetMenu sets the current menu; glutGetMenu returns the identifier of the current menu. If no menus exist or the previous current menu was destroyed, glutGet

sbrk(2) - change data segment size - Linux manual page......
brk() and sbrk() change the location of the program break, which defines the end of the processs data segment (i.e., the program break is the first location aft

XpCreateContext(3x) - Creates and initializes a new print co
XpCreateContext creates a new print context that is initialized with the default printer attributes and other information available for printer_name on display.

FcConfigSubstitute(3) - Execute substitutions (Man Page)....
Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns FcFalse if the substitution cannot be performed (due to allocation failure). Otherwise returns Fc

snmpgetnext(1) - communicates with a network entity using SN
snmpget is an SNMP application that uses the SNMP GETNEXT request to query for information on a network entity. One or more object identifiers (OIDs) may be giv

mbtowc(3) - convert a multibyte sequence to a wide character
The main case for this function is when s is not NULL and pwc is not NULL. In this case, the mbtowc() function inspects at most n bytes of the multibyte string

glFogiv(3gl) - specify fog parameters - Linux manual page...
Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. To enable and disable fog

We can't live, work or learn in freedom unless the software we use is free.