Posted to tcl by mjanssen at Fri May 08 14:46:51 GMT 2009view raw

  1. % proc f x {puts [info globals x*] ; upvar #0 [lindex $x 0] local ; if {![info exists local]} {set local "" ; puts "set to default"}}
  2. (bin) 58 % f x1
  3. x1 x2
  4. (bin) 59 % f x2
  5. x1 x2
  6. (bin) 60 % f x3
  7. x1 x2
  8. set to default
  9. (bin) 61 % f x4
  10. x1 x2 x3