Overview
| Artifact ID: | e83d8ddb575e922292f4949fef1e566e22790918 |
|---|---|
| Ticket: | 2673163fffffffffffffffffffffffffffffffff
Unwanted integer affinity of [upvar] |
| User & Date: | ferrieux on 2009-03-08 21:40:01 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
The documentation for [upvar] says: upvar ?level? otherVar myVar ?otherVar myVar ...? which makes it pretty clear that the presence of a level is determined by the parity of the number of args: odd means level, even means no level. However, "upvar 1 x" raises a "wrong # args" error ! This is due to the fact that the implementation ascribes higher priority to the value of the first argument ("integer affinity") than to positional criteria. This is Bad Thing (1) as it doesn't work as documented and (2) as it induces more verbose style, nullifying the intention of the "default level 1": programmers now routinely write "upvar 1 $x y" instead of the equivalent "upvar $x y" in fear of the above, insane behavior for an incoming integer-named variable. So I post this report proposing, as a fix, to just do as documented. That is, "upvar 1 x" should have the same effect as "upvar 1 1 x". Prio 8 as "low-hanging fruit" since (1) the patch is trivial and (2) the fix turns error cases into valid behavior in a way that really cannot harm a sane program. Patch to be shortly uploaded. - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "8"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "ferrieux"
- subsystem changed to: "18. Commands M-Z"
- title changed to: "Unwanted integer affinity of [upvar]"
- type changed to: "Bug"