Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bb63b5bb2fb17841902bdcad0170cea87bd7594f
Ticket: 449279ffffffffffffffffffffffffffffffffff
[namespace which -var] ignores aliases
User & Date: dgp on 2001-08-08 20:35:15
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    % namespace eval foo variable x 1
    % namespace eval bar variable x 2
    % proc bar::test {} {
          variable ::foo::x;# 'x' is now an alias for
    ;# ::foo::x
          set x 3;# sets ::foo::x
          puts "x is [namespace which -variable x]"
      }
    % bar::test
    x is ::bar::x
    % set bar::x
    2
    % set foo::x
    3
    
    This is not what I expect.  I expect
    [namespace which -variable x] to tell
    me something about what "x" refers to
    in the current context.  But [namespace which]
    is completely ignoring the local alias "x"
    and telling me how it would resolve "x"
    looking in the current and global namespaces
    only.  That has nothing to do with how operations
    on "x" will behave, which is what I really want
    to know.
    
    Here the local variable alias was created with
    [variable], but the same problem exists when
    local variables are created with [upvar] or
    just by creating a local variable.
    
    As is, [namespace which] is not the tool I need.
    The tool I need appears to be missing.  What
    I need is the analog of [namespace origin] for
    variables.
    
    
    
  4. foundin changed to: "obsolete: 8.4a3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "21. [namespace]"
  10. title changed to: "[namespace which -var] ignores aliases"
  11. type changed to: "Bug"