Posted to tcl by kbk at Sun Jan 17 23:12:08 GMT 2010view raw

  1. rename proc hiddenProc
  2. hiddenProc proc {name arglist body} {
  3. set newbody [linsert $::superglobals 0 global]\;$body
  4. hiddenProc $name $arglist $newbody
  5. }
  6. set superglobals {fred barney}
  7. set fred Hello
  8. set barney world
  9. proc test {} { puts "$fred, $barney!" }
  10. test