Artifacts Associated With Ticket 1230597fffffffff
Ticket change [b2e6c236a4] (rid 98420) by dgp on 2005-06-30 21:05:29:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized 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 initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "21. [namespace]"
- title initialized to: "allow [namespace import] of same command"
- type initialized to: "RFE"
Add attachment "import.patch" [7c1616e0e6] (rid 97020) by dgp on 2005-07-01 04:05:30.
Ticket change [37c45a2556] (rid 112087) by dgp on 2005-07-01 04:05:30:
- icomment:
File Added - 140416: import.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [376d4ca70c] (rid 107274) by msofer on 2005-07-01 04:26:19:
- icomment:
Logged In: YES user_id=148712 Patch looks good at first sight. I do not think a TIP is needed, this seems consistent with the following quote from namespace.n: "This command normally returns an error if an imported command conflicts with an existing command." This patch only changes the behaviour in case that there is NO conflict. It could even be argued that it fixes a bug ;) I see that one test was specifically looking for this behaviour. Does itcl test for this too?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [cf6b3447d6] (rid 112973) by dkf on 2005-07-01 04:53:03:
- icomment:
Logged In: YES user_id=79902 I agree with Miguel; fixing this is entirely reasonable. (And who *cares* if this busts itcl?)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "1230597.patch" [feec236ebd] (rid 108670) by dgp on 2005-07-01 21:30:43.
Ticket change [b505ecf7a9] (rid 125163) by dgp on 2005-07-01 21:30:43:
- icomment:
Logged In: YES user_id=80530 Here's the corresponding patch for core-8-4-branch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2ea9898bfb] (rid 92929) by dgp on 2005-07-01 21:30:44:
- icomment:
File Added - 140516: 1230597.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [02189db693] (rid 119588) by dgp on 2005-07-06 00:27:32:
- assignee changed to: "dgp"
- closedate changed to: "2005-07-05T17:27:32"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 committed to both branches.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dgp"