Artifacts Associated With Ticket 218451ffffffffff
Ticket change [4a98e73909] (rid 126563) by nobody on 2000-10-26 01:00:33:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 573 Bug Version: 8.0p2 SubmitDate: '1998-05-21' LastModified: '1999-08-15' Severity: LOW Status: Released Submitter: hershey ChangedBy: hobbs OS: Solaris OSVersion: 2.6 Machine: NA FixedDate: '1999-08-15' FixedInVersion: 8.2 ClosedDate: '2000-10-25' Hi folks, try this... 1. Save this to test.tcl: package provide x 1.0 namespace eval A { namespace export b proc b {} {} } namespace import A::b 2. In tclsh8.0 do this... % source test.tcl % exit 3. So far so good. Now restart tclsh and try this % pkg_mkIndex . test.tcl error while loading or sourcing test.tcl: can't import command "b": already exists % Any idea why? seems like it should be OK to me: The file defines two commands, "A::b" and "b" What I'm trying to do is hide (well, "obfuscate" is probably more accurate I guess) all the implementation details of a package in a namespace, and then import a few of the procs into the global namespace. I can think of some work arounds, but basically they involve writing a proc in the global namespace that uses variables from the package's namespace, and it would be tidier if I could just use 'variable whatever' when I wanted to do this. Details: tcl 8.0p2, Solaris 2.6 Thanks. --------------------------------------------------------------- David Houlder Phone: (06) 249 0668 Centre for Resource and Environmental Studies (+61 6 249 0668) The Australian National University Fax: +61 6 249 0757 This works in 8.2, although maybe not as desired. Before 8.0.5, there was a -verbose switch created to prevent the error, but the indexing wouln't work, because of the use of namespace import without the -force switch in the pkg_mkIndex command. Adding this (which was done before 8.2) will make it work. However, in this automation, the procs are still recognized in their qualified state. So ::A::b will be put in the pkgIndex.tcl file, not 'b'. The user may want to edit the pkgIndex.tcl file by hand in this case. -- 08/15/1999 hobbs - foundin initialized to: "obsolete: 8.0p2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Bug in pkg_mkIndex and namespaces"
- type initialized to: "Bug"
Ticket change [646511348e] (rid 92760) by welch on 2000-10-26 08:22:16:
- closedate changed to: "2000-10-26T01:22:16"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [9fc155d693] (rid 96696) by dgp on 2001-04-16 20:36:45:
- closedate changed to: "2001-04-16T13:36:45"
- closer changed to: "dgp"
- subsystem changed to: "39. Package Manager"