Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 98c533a4f5d015792ea2e1263c1762d932ceaf52
Ticket: 559268ffffffffffffffffffffffffffffffffff
incorrect [namespace forget] docs
User & Date: msofer on 2002-05-23 05:14:48
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    
    RFC: Should I document the current behaviour, or rather
    adapt behaviour to the docs? Or both?
    
    The current behaviour is:
    
    1. If the cmd name (or pattern)  is qualified, check for
    existence of a corresponding command in the NS given by the
    qualifier, and remove same-named commands in the local
    namespace if they are imported commands (even if imported
    from somewhere else, see example below)
    
    2. If the cmd name (or pattern) is simple, remove the
    corresponding commands in the local namespace if they are
    imported commands
    
    Prop.1 is (almost) the documented behaviour; Prop.2 is not
    documented - but really useful. So: document and fix 1?
    
    Prop.1 looks buggy and dangerous to me (as implemented): you
    can 'forget' a command imported from somewhere else! Example:
    
    % namespace eval src0 {proc a {} {puts 0}}
    % namespace eval src0 {namespace export a}
    % namespace eval src1 {proc a {} {puts 1}}
    % namespace eval tst {namespace import ::src0::a}
    % tst::a
    0
    % namespace eval tst {namespace forget ::src1::a}
    % tst::a
    invalid command name "tst::a"
    
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. username: "msofer"