Skip to content
Tcl Source Code History Of Ticket 219372ffff
Login

History Of Ticket 219372ffff

Artifacts Associated With Ticket 219372ffff

  1. Ticket change [0d47326b85] (rid 114335) by nobody on 2000-10-26 05:11:46:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 5991 Bug
      Version: 8.3.1
      SubmitDate: '2000-07-06'
      LastModified: '2000-10-25'
      Severity: MED
      Status: UnAssn
      Submitter: techsupp
      OS: Windows NT
      OSVersion: Windows NT 4.0 Build 1381 SP6
      Machine: x86 Family 6 Model 5 Stepping 2 AT/AT Compatible
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      David M. Eason
      
      Extensions:
      None
      
      CustomShell:
      No changes
      
      Comments:
      One workaround is to use "global env" and explicitly reference the
          desired element each time it is set.
      
      ReproducibleScript:
      array set inv {1 one 2 two}
      array set env {SSDIR c:/}
      
      proc setinv {n v} {upvar #0 inv($n) x; set x $v}
      proc setenv {n v} {upvar #0 env($n) x; set x $v}
      
      puts [setinv 1 won] ;#Displays "won"
      puts $inv(1) ;#Also displays "won" (this is correct)
      
      puts [setenv SSDIR d:/] ;#Display "d:/"
      puts $env(SSDIR) ;#Displays "c:/" (this is unexpected)
      
      ObservedBehavior:
      It appears that elements of the "env" array cannot be set using the upvar mechanism, but elements of other arrays can.  The documentation states that upvar can be applied to array elements.  Nothing special about "env" is noted on the help pages for array, tclvars, or upvar.
      
      DesiredBehavior:
      I expect to see the new value of the env array element in subsequent references.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.3.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: "69. Other"
    10. title initialized to: "Cannot set env array element via upvar #0"
    11. type initialized to: "Bug"
  2. Ticket change [c7df83405d] (rid 122015) by dkf on 2000-11-13 20:41:14:

    1. icomment:
      This is an unfortunate side effect of the way that variables in arrays are implemented (the contained variables do not know that they are contained within an array) and fixing it will require adding a field to struct Var to refer to the containing variable.  An alternative would be to change the documentation for upvar, but that would be merely enshrining a misfeature in the cloak of "standard documented behaviour".  :^(
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. subsystem changed to: "07. Variables"
    5. username: "dkf"
  3. Ticket change [b74da7e6d9] (rid 125565) by dkf on 2001-02-07 22:48:58:

    1. icomment:
      This is due to an interaction between an environment variable mechanism strangeness (the env array is *different*) and the array-variable mechanism (which currently means that if you upvar a single element of an array, no global traces on that array get called when you get/set that variable) that is unfortunate.  A work-around is to upvar the whole array and set an element of that, which works.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [a4bb95d207] (rid 110254) by msofer on 2001-05-05 05:12:14:

    1. subsystem changed to: "08. Environment Variables"
  5. Ticket change [b34a59ef19] (rid 98507) by andreas_kupries on 2001-09-28 02:11:13:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      David M. Eason = <[email protected]>
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  6. Ticket change [df631715e3] (rid 115009) by dgp on 2001-09-28 02:15:18:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      This bug breaks the Unix URL following of the tkchat client
      program.  Would be nice to get it assigned and fixed.  It's
      been broken since Tcl 8.1.
      
      Here's a quick demo script:
      
      proc bar varName {upvar 1 $varName result; set result value}
      proc foo {} {global env; bar env(TEST); set env(TEST)}
      foo
      
      Andreas tells me the submitter is David M. Eason,
      <[email protected]>.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [ae1210fd8a] (rid 101571) by dkf on 2003-09-15 05:21:40:

    1. assignee changed to: "hobbs"
  8. Ticket change [11f3cf6d3e] (rid 95231) by dgp on 2006-03-10 23:35:17:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      status?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"