Skip to content
Tcl Source Code History Of Ticket 218451
Login

History Of Ticket 218451

Artifacts Associated With Ticket 218451

  1. Ticket change [4a98e73909] (rid 126563) by nobody on 2000-10-26 01:00:33:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.0p2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "Bug in pkg_mkIndex and namespaces"
    11. type initialized to: "Bug"
  2. Ticket change [646511348e] (rid 92760) by welch on 2000-10-26 08:22:16:

    1. closedate changed to: "2000-10-26T01:22:16"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [9fc155d693] (rid 96696) by dgp on 2001-04-16 20:36:45:

    1. closedate changed to: "2001-04-16T13:36:45"
    2. closer changed to: "dgp"
    3. subsystem changed to: "39. Package Manager"