Skip to content
Tcl Source Code History Of Ticket 1274916fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1274916fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1274916fffffffffffffffffffffffffffffffff

  1. Ticket change [071f25f6b1] (rid 89333) by msofer on 2005-08-28 01:34:22:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The behaviour of
        upvar otherVar myVar
      is wrong when myVar is a qualified name, as it does not
      follow Tcl's (insane?) variable resolution rules: it
      skips the global lookup upon failure of the local one.
      Witness:
      
      % set x 1
      1
      % namespace eval a {upvar x b::x}
      can't create "b::x": parent namespace doesn't exist
      % namespace eval b {}
      % namespace eval a {upvar x b::x}
      can't create "b::x": parent namespace doesn't exist
      % namespace eval b {variable x 2}
      % namespace eval a {upvar x b::x}
      can't create "b::x": parent namespace doesn't exist
      % namespace eval a {set b::x}
      2
      
      This worked as expected in Tcl8.3.4, and is broken as
      described above in 8.4.7 and HEAD. Breakage was
      probably introduced at some point in the 8.4 line
      (LOOKUP_FOR_UPVAR).
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "8"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "msofer"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "upvar and qualified varNames"
    11. type initialized to: "Bug"
  2. Ticket change [15d65f22cb] (rid 124630) by msofer on 2005-08-28 08:51:53:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Note that this behaviour was introduced as a fix for Bug
      #696893.
      
      Avoiding the global lookup appears not to have been a
      correct reconstruction of Tcl8.3's lookup rules.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [a3411fa5a3] (rid 110022) by msofer on 2005-08-28 19:37:39:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The problem is that [upvar] has different rules for creative
      writing in the not-fully-qualified case. In the example above
        namespace eval a {upvar x b::x}
      the new variable should refer (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 refer to the existence of the
      variables themselves, ie for [namespace eval a {set b::x 1}]
      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"
  4. Ticket change [1f926d9010] (rid 91168) by msofer on 2005-08-28 19:47:17:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The question now is if this behaviour in 8.3 is intended, or
      just an implementation side effect. Ths docs do not even
      mention the possibility of creating anything but a
      proc-local variable via upvar.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  5. Ticket change [43233eb3d4] (rid 116494) by msofer on 2009-05-01 08:21:38:

    1. priority changed to: "7 High"