|
2014-02-19
| ||
| 14:12 | [1230597] Update test comment. check-in: 6deecf6f75 user: dgp tags: trunk | |
| 14:10 | [1230597] Update test comment. check-in: 0392a86d4d user: dgp tags: core-8-5-branch | |
|
2005-07-06
| ||
| 00:27 | • Closed ticket [1230597fff]: allow namespace import of same command plus 8 ... artifact: 02189db693 user: dgp | |
|
2005-07-01
| ||
| 21:30 | • Ticket [1230597fff]: 4 changes artifact: 2ea9898bfb user: dgp | |
| 21:30 | • Add attachment 1230597.patch to ticket [1230597fff] artifact: feec236ebd user: dgp | |
| 21:30 | • Ticket [1230597fff] allow namespace import of same command status still Op... artifact: b505ecf7a9 user: dgp | |
| 04:53 | • Ticket [1230597fff]: 4 changes artifact: cf6b3447d6 user: dkf | |
| 04:26 | • Ticket [1230597fff]: 4 changes artifact: 376d4ca70c user: msofer | |
| 04:05 | • Add attachment import.patch to ticket [1230597fff] artifact: 7c1616e0e6 user: dgp | |
| 04:05 | • Ticket [1230597fff] allow namespace import of same command status still Op... artifact: 37c45a2556 user: dgp | |
|
2005-06-30
| ||
| 21:05 | • New ticket [1230597fff]. artifact: b2e6c236a4 user: dgp | |
allow [namespace import] of same command
Closed / Accepted1230597fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-06-30 21:05:29
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.
dgpplain2005-07-01 04:05:30
File Added - 140416: import.patch
msoferplain2005-07-01 04:26:19
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?
dkfplain2005-07-01 04:53:03
Logged In: YES user_id=79902 I agree with Miguel; fixing this is entirely reasonable. (And who *cares* if this busts itcl?)
dgpplain2005-07-01 21:30:43
Logged In: YES user_id=80530 Here's the corresponding patch for core-8-4-branch.
dgpplain2005-07-01 21:30:44
File Added - 140516: 1230597.patch
dgpplain2005-07-06 00:27:32
Logged In: YES user_id=80530 committed to both branches.
Log in (anonymous is fine) to add a comment.
Attachments:
- 1230597.patch [download] added by dgp on 2005-07-01 21:30:43. [details]
- import.patch [download] added by dgp on 2005-07-01 04:05:30. [details]