Changeset 123


Ignore:
Timestamp:
Aug 6, 2002, 5:26:15 AM (17 years ago)
Author:
landonf (Landon Fuller)
Message:

remove global manipulation procedures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Tcl/port1.0/portutil.tcl

    r119 r123  
    33package require Pextlib 1.0
    44
    5 global globals targets
     5global targets
    66
    77########### External High Level Procedures ###########
     
    2525        set $option $args
    2626    }
    27 }
    28 
    29 # globals
    30 # Specifies which keys from an array should be exported as global variables.
    31 # Often used directly with options procedure
    32 proc globals {array args} {
    33     foreach option $args {
    34         globalcreate $array $option
    35     }
    36 }
    37 
    38 ########### Global Variable Manipulation Procedures ###########
    39 
    40 proc globalcheck {array key op} {
    41     upvar $array uparray
    42     upvar \#0 $key upkey
    43     global globals
    44 
    45     if [tbool globals $key] {
    46         if ![info exists upkey] {
    47             trace vdelete ${array}(${key}) rwu globalcheck
    48             unset ${array}(${key})
    49             return
    50         }
    51     }
    52     switch $op {
    53         w { set upkey $uparray($key)
    54             set globals($key) yes}
    55         r { if {$upkey != $uparray($key)} { set uparray($key) $upkey } }
    56         u { unset upkey
    57             unset globals($key)}
    58     }
    59 }
    60 
    61 proc globalcreate {array key} {
    62     if {[trace vinfo ${array}(${key})] != ""} {
    63         error "Re-exporting global $key"
    64     }
    65     trace variable ${array}(${key}) rwu globalcheck
    6627}
    6728
Note: See TracChangeset for help on using the changeset viewer.