Skip to content
Tcl Source Code History Of Ticket 1546833
Login

History Of Ticket 1546833

Artifacts Associated With Ticket 1546833

  1. Ticket change [f1fe9fbd5b] (rid 109452) by msofer on 2006-08-25 18:52:11:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Will Duquette reports by mail that varname resolution
      of [namespace upvar] is failing to do the right thing
      in the (non-fully) qualified case. 
      
      <quote>
      Please consider the code:
      
        namespace eval ::cat:: { }
      
        namespace eval dog:: {
            set dogInfo(a) "A"
            set dogInfo(b) "B"
        }
      
        proc ::cat::TestProc {type} {
            if {![info exists ${type}::dogInfo]} {
                error "no such type: \"$type\""
            }
      
            upvar ${type}::dogInfo dogInfo1
            parray dogInfo1
      
            namespace upvar $type dogInfo dogInfo2
      
            parray dogInfo2
        }
      
        ::cat::TestProc dog
      
      What happens when I run this is it prints the content
      of dogInfo1, but then says there is no array dogInfo2;
      [namespace upvar] is failing to alias dogInfo2 to
      ::dog::dogInfo.
      
      Now, the behavior of [namespace upvar] doesn't surprise
      me; since TestProc is in ::cat::, [namespace upvar] is
      presumably trying to alias dogInfo2 to
      ::cat::dog::dogInfo.  That makes sense to me.
      
      [info exists] and [upvar], on the other hand, are
      finding ::dog::dogInfo; this surprises me.  Do lookups
      of partially-qualified variable names fall back to ::
      if the variable isn't found in the current namespace? 
      If so, [namespace upvar] should undoubtedly do the same
      thing.  I must say, I wasn't expecting them to do that,
      though.
      </quote>
      
      
      
    4. foundin initialized to: "obsolete: 8.5a5"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "msofer"
    10. subsystem initialized to: "21. [namespace]"
    11. title initialized to: "wrong varname resolution in [namespace upvar]"
    12. type initialized to: "Bug"
  2. Ticket change [3e83312f01] (rid 121283) by msofer on 2006-08-26 01:58:52:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      According to the docs, "[namespace upvar $ns a b] has the
      same behaviour as [upvar 0 $ns::a b]. Event though Will's
      example does not test this directly, further tests show that
      this is failing to occur.
      
      The code is buggy, and the testsuite incomplete.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [957e6b1a2b] (rid 106164) by msofer on 2006-08-26 09:30:17:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      I now tend to think that [namespace upvar] is doing the
      right thing, and [upvar] is not. Note that 
         upvar 0 b::x s b:y t
      may create vars that are linked to *different* namespaces;
      we certainly do not want to reproduce that in here. See also
      Bug #1274918
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [949c120e9f] (rid 106022) by msofer on 2006-08-26 19:54:29:

    1. closedate changed to: "2006-08-26T12:54:29"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      [namespace upvar] is doing the right thing: the man page for
      'namespace' clearly states that "Namespace names, on the
      other hand, are always resolved by looking in only the
      current namespace."
      
      So this is actually a doc bug - the parallel to [upvar 0] is
      imperfect. This is now fixed in HEAD.
      
      There was an actual bug in the code (also fixed in HEAD),
      illustrated by
      
      % namespace eval a {
         variable x 2
         proc a {} {namespace upvar fake x w; set w}
         a
      }
      2
      
      This now properly returns an error, with message 
         namespace "fake" does not exist
      (see test upvar-NS-1.9)
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. title changed to: "wrong varname resolution in [namespace upvar]?"
    9. username: "msofer"
  5. Ticket change [fe89d867f3] (rid 108609) by dgp on 2006-08-27 10:49:29:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      upvar-NS-1.3 segfaults.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. resolution changed to: "None"
    6. status changed to: "Open"
    7. username: "dgp"
  6. Ticket change [8a2bd07474] (rid 127350) by dgp on 2006-08-27 11:36:24:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      The segfault appears to be
      in TclFormatObj() which is
      so far not used or tested
      anywhere else. 
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dgp"
  7. Ticket change [8ec06a5bda] (rid 120167) by dgp on 2006-08-28 20:09:32:

    1. assignee changed to: "msofer"
    2. closedate changed to: "2006-08-28T13:09:32"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      TclFormatObj issue is
      now bug 1547681
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dgp"