Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c9cda2537e7c7bd094d7da37813778a950f88af9
Ticket: 959831ffffffffffffffffffffffffffffffffff
doc: global and qualified varNames?
User & Date: msofer on 2004-05-25 01:44:07
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The manual pages for global and upvar commands do not
    explain the behaviour when the variable names contain
    namespace qualifiers.
    
    This is not so bad for upvar, as the behaviour is quite
    intuitive. Not the same for global ...
    
    One possibility is to explain global's behaviour, and
    show that it could be defined as
      
       proc global args {
           if {[info level] < 2} {
               return
           }
           set cmdName [namespace tail [lindex [info level
    -1] 0]]
           if {[info procs $cmdName] eq {}} {
               return 
           }
           set cmd [list upvar 0]
           foreach var $args {
               lappend cmd ::$var [namespace tail $var]
           }
           uplevel 1 $cmd
           return
        }
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "07. Variables"
  10. title changed to: "global.n, upvar.n: qualified varNames?"
  11. type changed to: "Bug"