caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Jun 16, 2016 7:17 am Post subject: upvrar in namespace |
|
|
Why can't use upvar on a variable that is defined outside the proc that is in a namespace?
I tried something like:
| Code: |
namespace eval blah {
set foo 1
proc moo {x} {
upvar #0 $x var
puts $var
}
}
|
and other ways but all fail. From what I read a upvar #0 should be the equivalent of a global call but that fails as well, meaning the var variable isn't created.
If I take the code outside the namespace then it's working as expected. What am I doing wrong? _________________ Once the game is over, the king and the pawn go back in the same box. |
|