Skip to content
Tcl Source Code History Of Ticket 218782
Login

History Of Ticket 218782

Artifacts Associated With Ticket 218782

  1. Ticket change [d1ac289e57] (rid 113395) by nobody on 2000-10-26 01:05:17:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2110 Bug
      Version: 8.1
      SubmitDate: '1999-05-20'
      LastModified: '2000-01-20'
      Severity: LOW
      Status: Released
      Submitter: pat
      ChangedBy: ericm
      OS: All
      FixedDate: '2000-01-20'
      FixedInVersion: 8.3
      ClosedDate: '2000-01-20'
      
      
      Name:
      Greg Orchard
      
      ReproducibleScript:
      proc update {name index op} {
              puts "name $name index $index"
          }
          
          proc getUpdate {inVar} {
              upvar $inVar localVar
              set localVar 100
          }
          
          trace variable somevar w update
          getUpdate somevar(1)
      
      ObservedBehavior:
      The output from the above is:
          
          name localVar index
      
      DesiredBehavior:
      I would expect to see:
          
          name somevar index 1
          
          since "somevar" is the one variable being traced.
      
      
      
      This is actually the designed behaviour.  While it may seem obivously incorrect, consider the case in which there are two levels of upvar, and multiple traces:
      
      proc update {name index op} {
      puts "name $name index $index"
      }
      
      proc getUpdate {inVar} {
      upvar $inVar localVar
      trace variable localVar w update
      getUpdate2 localVar
      }
      
      proc getUpdate2 {inVar} {
      upvar $inVar localVar2
      set localVar2 100
      }
      
      trace variable somevar w update
      getUpdate somevar
      
      Now it is not so clear what the behaviour should be.  Which trace should fire?  what name should it be given?  If there are many levels of indirection, it could be costly to try and determine which trace should be fired with which variable name.  And because all of the variable names actually refer to the same object, it is least confusing to fire all of the traces with the name used to trigger the trace.
      
      - eric
      
      -- 01/20/2000 ericm
      
      
      
    4. foundin initialized to: "obsolete: 8.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "trace variable / upvar problem"
    11. type initialized to: "Bug"
  2. Ticket change [6bfeb875f7] (rid 128424) by welch on 2000-10-26 08:29:14:

    1. closedate changed to: "2000-10-26T01:29:14"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"