Overview
| Artifact ID: | fdbf5814325ff6c0ec7f9deabc90f6116470a2e4 |
|---|---|
| Ticket: | 2028793fffffffffffffffffffffffffffffffff
Namespace dependence of interp alias |
| User & Date: | lars_h on 2008-07-26 15:36:10 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed to:
This is probably missing documentation rather than an actual bug, but it's nonetheless rather strange behavior. % namespace eval test {interp alias {} foo {} list "From foo"; interp alias {} test::foo {} list "From test::foo"} test::foo % foo {From foo} % test::foo Error: invalid command name "test::foo" % info commands test::* % namespace children test ::test::test % info commands test::test::* ::test::test::foo % ::test::test::foo {From test::foo} The behaviour, which is inherited from Tcl_CreateObjCommand, is: - aliases whose srcCmd does not contain a namespace separator are created in the :: namespace. - aliases whose srcCmd contains a namespace separator are created relative to the current namespace context (in the interpreter where the command is being created!). As in the above example, a not fully qualified name is resolved relative to the current namespace (::test) even if the target namespace (::test::test) doesn't exist yet! This is rather different from [proc], but I notice when experimenting with the issue that [rename] and [namespace ensemble create -command] are similarly capable of creating namespaces. - foundin changed to: "obsolete: 8.5.2"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "lars_h"
- subsystem changed to: "20. [interp]"
- title changed to: "Namespace dependence of interp alias"
- type changed to: "Bug"