Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
my(n)				TclOO Commands				 my(n)

______________________________________________________________________________

NAME
       my - invoke any method of current object

SYNOPSIS
       package require TclOO

       my methodName ?arg ...?
______________________________________________________________________________

DESCRIPTION
       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 con-
       text 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 unique namespace.

EXAMPLES
       This example shows basic	use of my to use the variables method  of  the
       oo::object class, which is not publically visible by default:
	      oo::class	create c {
		  method count {} {
		      my variable counter
		      print [incr counter]
		  }
	      }
	      c	create o
	      o	count		   -_ prints "1"
	      o	count		   -_ prints "2"
	      o	count		   -_ prints "3"

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

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

TclOO				      0.1				 my(n)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SEE ALSO | KEYWORDS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=my&manpath=FreeBSD+10.3-RELEASE+and+Ports>

home | help