Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ed9edd96c4a22c0ba12338779de60d73fe6bd296
Ticket: 559268ffffffffffffffffffffffffffffffffff
incorrect [namespace forget] docs
User & Date: dgp on 2002-05-22 16:44:48
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The documentation of
    
    namespace forget ?pattern ...?
    
    claims that each "pattern" must be a qualified
    name.  That is, it must contain a "::".  It further
    claims that everything to the left of the rightmost
    "::" must be a literal name of an exporting namespace,
    while everything to the right of it can be a pattern
    for matching against exported commands of that
    namespace.
    
    In fact, simple names are permitted as arguments
    to [namespace forget] and that can be quite
    useful.
    
      namespace eval importer {
    namespace import ::exporter::foo
    namespace forget foo
      }
    
    will work fine to undo the import.  In this example,
    it would be just as easy to explicitly repeat
    
    namespace forget ::exporter::foo
    
    but consider the case where the exporting namespace
    is actually an argument passed into a proc, and 
    the [namespace forget] comes at a later time.  It
    would be a real pain to have to store which exporting
    namespace the command was imported from, just so you
    could successfully [namespace forget] it later.
    
    (Hmmm... I guess it's not so bad, becuase
    
    namespace forget [namespace origin foo]
    
    should always work, but why the extra scoping if
    it's not really necessary?)
    
    Anyhow, the simple case does work, so that
    should be documented.
    
    It appears it will even work with a [rename]d
    imported command:
    
    namespace eval importer {
        namespace import ::exporter::foo
        rename foo bar
        namespace forget bar
    }
    
    Someone more familiar with the internals of 
    [namespace] than I am should update the docs, so
    the exact requirements and capabilities can be
    documented correctly.
    
  4. foundin changed to: "obsolete: 8.4a5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "21. [namespace]"
  10. title changed to: "incorrect [namespace forget] docs"
  11. type changed to: "Bug"