Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ac60cb8bdbb83a0f8953f9fa8bb8ac424722a603
Ticket: 786187ffffffffffffffffffffffffffffffffff
proc requires a namespace to exist but rename doesn't
User & Date: muonics on 2003-08-10 08:31:48
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I found this comment in TclRenameCommand while poking
    through the sources, which made me curious:
    
    "Make sure that the destination command does not
    already exist.  The rename operation is like creating a
    command, so we should automatically create the
    containing namespaces just like Tcl_CreateCommand would."
    
    I found this interesting, because I often wind up doing
    an namespace eval "" just to make a namespace exist
    because I don't usually define my procs within the
    eval.  So I ran a test:
    
    % namespace children ::
    ::tcl
    % proc ns::test {} {}
    can't create procedure "ns::test": unknown namespace
    % proc test {} {}
    % rename test ns::test
    % namespace children ::
    ::ns ::tcl
    
    Shouldn't proc be able to do the same?  It would be
    quite handy.
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "muonics"
  9. subsystem changed to: "22. [proc] and [uplevel]"
  10. title changed to:
    proc requires a namespace to exist but rename doesn't
    
  11. type changed to: "Bug"