Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4bd9a39c78fc2393feb9cc23573d94c8dcaef6c3
Ticket: 1274918fffffffffffffffffffffffffffffffff
doc: upvar and qualified varNames
User & Date: msofer on 2006-08-26 02:45:32
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    
    Note that the issue for qualified otherVar is not quite trivial:
    % namespace eval a {}; namespace eval a::b {}; namespace
    eval b {}
    % set b::x ::b
    ::b
    % namespace eval a {upvar 0 b::x w; set w}
    ::b
    % set a::b::x ::a::b
    ::a::b
    % namespace eval a {upvar 0 b::x w; set w}
    ::a::b
    
    In the example above
      namespace eval a {upvar 0 b::x w}
    the new variable should(?) be linked (in order) to:
    
      (1) ::a::b::x if the namespace ::a::b exists
      (2) ::b::x     if the namespace ::b     exists
    
    Note that this refers to the existence of namespaces; the
    usual resolution rules (and the actual upvar behaviour)
    refer to the existence of the variables themselves, the
    reference is to:
    
      (1) ::a::b::x if the variable ::a::b::x exists
      (2) ::b::x     if the variable ::b::x     exists
      (3) ::a::b::x otherwise (even if ::b exists but ::a::b
    does not)
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. username: "msofer"