oo::copy man page on Mandriva

Man page or keyword search:  
man Server   17060 pages
apropos Keyword Search (all sections)
Output format
Mandriva logo
[printable version]

copy(n)				TclOO Commands			       copy(n)

______________________________________________________________________________

NAME
       oo::copy - create copies of objects and classes

SYNOPSIS
       package require TclOO

       oo::copy sourceObject ?targetObject?
_________________________________________________________________

DESCRIPTION
       The oo::copy command creates a copy of an object or class. It takes the
       name of the object or class to be copied, sourceObject, and  optionally
       the  name of the object or class to create, targetObject, which will be
       resolved relative to the current namespace if not an absolute qualified
       name.   If  targetObject	 is  omitted, a new name is chosen. The copied
       object will be of the same class as the source object,  and  will  have
       all  its per-object methods copied. If it is a class, it will also have
       all the class methods in the class copied, but it will not have any  of
       its  instances  copied.	The  contents  of  the source object's private
       namespace will not be copied; it is up to the caller to	do  this.  The
       result  of  this	 command  will	be the fully-qualified name of the new
       object or class.

EXAMPLES
       This example creates an object, copies it, modifies the source  object,
       and then demonstrates that the copied object is indeed a copy.

	      oo::object create src
	      oo::define src method msg {} {puts foo}
	      oo::copy src dst
	      oo::define src method msg {} {puts bar}
	      src msg		   → prints "bar"
	      dst msg		   → prints "foo"

SEE ALSO
       oo::class(n), oo::define(n), oo::object(n)

KEYWORDS
       clone, copy, duplication, object

TclOO				      0.1			       copy(n)
[top]

List of man pages available for Mandriva

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net