Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fdbf5814325ff6c0ec7f9deabc90f6116470a2e4
Ticket: 2028793fffffffffffffffffffffffffffffffff
Namespace dependence of interp alias
User & Date: lars_h on 2008-07-26 15:36:10
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    This is probably missing documentation rather than an actual bug, but it's nonetheless rather strange behavior.
    
    % namespace eval test {interp alias {} foo {} list "From foo"; interp alias {} test::foo {} list "From test::foo"}
    test::foo
    % foo
    {From foo}
    % test::foo
    Error: invalid command name "test::foo"
    % info commands test::*
    % namespace children test
    ::test::test
    % info commands test::test::*
    ::test::test::foo
    % ::test::test::foo
    {From test::foo}
    
    The behaviour, which is inherited from Tcl_CreateObjCommand, is:
    
    - aliases whose srcCmd does not contain a namespace separator are created in the :: namespace.
    
    - aliases whose srcCmd contains a namespace separator are created relative to the current namespace context (in the interpreter where the command is being created!). As in the above example, a not fully qualified name is resolved relative to the current namespace (::test) even if the target namespace (::test::test) doesn't exist yet!
    
    This is rather different from [proc], but I notice when experimenting with the issue that [rename] and [namespace ensemble create -command] are similarly capable of creating namespaces.
    
    
    
  4. foundin changed to: "obsolete: 8.5.2"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "lars_h"
  10. subsystem changed to: "20. [interp]"
  11. title changed to: "Namespace dependence of interp alias"
  12. type changed to: "Bug"