Posted to tcl by oldlaptop at Sat Nov 06 17:40:38 GMT 2021view raw

  1. % proc p1 {} {array set foo {}; p2; parray foo}
  2. % proc p2 {} {upvar foo(key) var; set var hello; puts $var; puts [array get foo]}
  3. % p1
  4. hello
  5.  
  6. foo(key) = hello
  7. %