Overview
| Artifact ID: | b903551bcaa2427da9e295b093fe6b45c4735e3b83ea38d8438859b7f4723501 |
|---|---|
| Ticket: | 63806646d2436e674070c90bd3e89e1cbc1c0edd
Cannot create array in namespace if it already exists in base |
| User & Date: | jal_frezie on 2024-09-09 15:47:05 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed to:
If an array exists in the base namespace, then you add elements to it in a child namespace, they are added to the base namespace version only. Trying to read the array in the child namespace reads the base namespace version. On the other hand if you create the array in the child namespace, then add elements to it in the base namespace, the two arrays remain distinct and each reads correctly in its own namespace. Example: $ tclsh % info patchlevel 8.6.14 % array set foo {qaz 1 wsx 2 edc 3 rfv 4} % namespace eval bar {array set foo {tgb 5 yhn 6 ujm 7}} % array get foo ujm 7 edc 3 qaz 1 tgb 5 rfv 4 wsx 2 yhn 6 % namespace eval bar {array get foo} ujm 7 edc 3 qaz 1 tgb 5 rfv 4 wsx 2 yhn 6 % array get bar::foo % % namespace eval bar {array set xyzzy {tgb 5 yhn 6 ujm 7}} % array get xyzzy % namespace eval bar {array get xyzzy} ujm 7 tgb 5 yhn 6 % array set xyzzy {qaz 1 wsx 2 edc 3 rfv 4} % array get xyzzy edc 3 qaz 1 rfv 4 wsx 2 % namespace eval bar {array get xyzzy} ujm 7 tgb 5 yhn 6 % array get bar::xyzzy ujm 7 tgb 5 yhn 6 % - foundin changed to: "8.6.14"
- is_private changed to: "0"
- login: "jal_frezie"
- priority changed to: "5 Medium"
- private_contact changed to: "21e680c66afc6863cbbaf0aa5b26c9e8a4429339"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "jal_frezie"
- subsystem changed to: "21. [namespace]"
- title changed to:
Cannot create array in namespace if it already exists in base
- type changed to: "Bug"