1package provide tmp 1.0
2
3namespace eval tmp {
4  variable VAR    ;  array set VAR {}
5  namespace export -clear tset texists tunset
6
7  proc tset { var args } {
8    variable VAR
9    if { [llength $args] > 0 } {
10      set VAR($var) [lindex $args 0]
11      return $VAR($var)
12    } else {
13      if [info exists VAR($var)] {
14        return $VAR($var)
15      } else {
16        return -code error
17      } ;# if-else
18    } ;# if-else
19  } ;# proc SET
20
21  proc texists { var } {
22    variable VAR
23    return [info exists VAR($var)]
24  } ;# proc EXISTS
25
26  proc tunset { args } {
27    variable VAR
28    foreach { var } $args {  catch { unset VAR($var) }   }
29  } ;# proc UNSET
30} ;# namespace tmp
31