Overview
| Artifact ID: | b2e6c236a43b7dbc5f2493dd6ae80e774b7bfe85 |
|---|---|
| Ticket: | 1230597fffffffffffffffffffffffffffffffff
allow [namespace import] of same command |
| User & Date: | dgp on 2005-06-30 21:05:29 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Consider the Tcl script: namespace eval ::foo { proc foo {} {} namespace export foo } namespace eval ::bar { namespace import ::foo::foo } This script can only be eval'd one time. (If it's in a file, that file can only be [source]d one time). The second attempt will throw an error from the [namespace import] attempt. The error is meant to warn us that the [namespace import] is overwriting an existing command. In examples like this one, though, that warning is wrong-headed. We're "overwriting" an import with itself, something perfectly safe. Worse, the import implementation code has all the info it needs to check and verify that this is perfectly safe, yet fails to do so. Much, much worse, the existing "fix" for this problem is to add "-force" to the [namespace import] which loses all safety, even that which would be useful. Here's a patch to make [namespace import] stop raising errors on "overwrites" of an import over itself. This is obviously a good idea. Less obvious whether a TIP is required. This patch is all that's needed to fix Tk Bug 1230576. - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "21. [namespace]"
- title changed to: "allow [namespace import] of same command"
- type changed to: "RFE"