Version 6 of namespace upvar

Updated 2012-09-27 14:25:04 by LkpPo
namespace upvar namespace otherVar myVar ?otherVar myVar ...?

The namespace upvar command creates a link (just like upvar) from each of the named otherVars in namespace to the myVars in the current context (i.e., stack frame or namespace). All the otherVars must be unqualified.

Note that these are equivalent:

set ns ::foo
upvar #0 ${ns}::bar boo

and

set ns ::foo
namespace upvar $ns bar boo

However, the second form is more efficient, as requires less string manipulation and parsing.

DKF: This command was created to help accelerate Snit.


See also: