NAME

copy - Copy an object

SYNOPSIS

copy target source

DESCRIPTION

The copy command allows you to make a copy of source onto target.  If neither object has any class in common, no action is taken.
target
The result of a reference call.
source
The result of a reference call.
The default constructor:
proc classname_tail {{obj {}}} {

    if {[regexp {^[:]{2}} $obj]} {
        if {[::cTCL::objects::is $obj]} {
            ::cTCL::objects::copy [this] $obj
        } else {
            set errmsg {Unknown parameter to default constructor}
            error $errmsg $errmsg
        }
    }
}

It acts as a copy constructor, allowing you to do something like:

object myclass myobject [myotherobject]

Here, [myotherobject] returns the namespace which houses the member data, which is $obj within the default constructor.