Version 2 of namespace upvar

Updated 2010-10-21 09:45:35 by dkf
namespace upvar namespace otherVar myVar ?otherVar myVar ...?

The namespace upvar 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.