Skip to content
Tcl Source Code History Of Ticket 535709
Login

History Of Ticket 535709

Artifacts Associated With Ticket 535709

  1. Ticket change [e93ba08584] (rid 104784) by muonics on 2002-03-27 13:30:42:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Allow the "package require" command to take an 
      argument for asserting control over the placement of 
      loaded namespaces that are defined with relative names 
      (ie., not explicitly off the root namespace as 
      in ::MyNamespace).
      
      For example, if you know that a particular package's 
      Tcl code is written in a namespace-placement-safe 
      manner (e.g., through applicable use of "namespace 
      code", etc.), it should be possible to have an 
      application that is using that package place it 
      wherever it wants in the namespace heirarchy, to avoid 
      namespace collision without modifying the source code 
      of the package.
      
      For example, if my application uses two packages that 
      both want to define the namespace "tools", your 
      options are either:
      
      1. Edit the source code to rename their namespaces to 
      e.g. "contrib1::tools" and "contrib2::tools" 
      or "tools1" and "tools2".
      
      2. Use "namespace eval contrib1 { source 
      package1/tools.tcl" (likewise for package 2), instead 
      of the package mechanism.
      
      Instead, it would be useful to use a command such as:
      
      package require package1 -in contrib1
      package require package2 -in contrib2
      
      Then, if package1 and package2 are both written to 
      define the "tools" namespace, they'd automatically be 
      placed within the desired parent namespace.
      
      The following does not work...
      
      namespace eval contrib1 {
          package require package1
      }
      namespace eval contrib2 {
          package require package2
      }
      
      ...because through package ifneeded etc. the files 
      listed in pkgIndex.tcl will be sourced in the global 
      context.
      
      This would be particularly useful in cases where a 
      package contains multiple namespaces, or in re-
      packaging a set of packages as a single package.  In 
      the latter case, some namespace-like heirarchy to 
      package names might also be useful.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "muonics"
    9. subsystem initialized to: "39. Package Manager"
    10. title initialized to: "[package] ctrl over namespace placement"
    11. type initialized to: "RFE"
  2. Ticket change [352f760e60] (rid 106877) by dgp on 2002-03-28 01:09:12:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      The ideas in this request are interesting,
      but I think they bump up against
      the design in [package] that at most one
      version of each package can be loaded at
      one time in each interpreter.
      
      Since I can only have one version of the
      package "foo" loaded, even though many 
      other packages might want to make use of
      it, then it is important that the commands
      of "foo" are defined in a well-known place,
      conventionally, the ::foo namespace.
      
      So, I believe that attempting to fulfill
      this request would require a pretty fundamental
      re-thinking of how [package] works.  Not
      likely to happen soon.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "2"
    5. username: "dgp"