Overview
| Artifact ID: | 0d47326b851df08579380f7f20b2b48d0058e182 |
|---|---|
| Ticket: | 219372ffffffffffffffffffffffffffffffffff
Cannot set env array element via upvar #0 |
| User & Date: | nobody on 2000-10-26 05:11:46 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed 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. - foundin changed to: "obsolete: 8.3.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "Cannot set env array element via upvar #0"
- type changed to: "Bug"