Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4f05f32554432b0499433e673e7bfe1ad510589c
Ticket: 458892ffffffffffffffffffffffffffffffffff
Legal but irregular names ??
User & Date: msofer on 2001-09-05 20:51:53
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The character ":" is a legal character for variable and
    command names - with the proviso that it cannot appear
    doubled:
       a::b
    is the name of variable (or command) 'a' in the
    namespace 'b'.
    
    Variable and command names that start with ":" are
    legal, but behave differently: the following script
         set a 1 
         set :a 2 
         namespace eval tst {
             proc tst var { 
                 set [uplevel namespace current]::$var 
              }
          }
          puts "($a [set a] [tst::tst a] ${:a} [set :a]
    [tst::tst :a])"
    
    returns (1 1 1 2 2 1) instead of (1 1 1 2 2 2).
    
    I see two possible fixes to this:
      - stop interpreting any sequence of two or more ":"
    as a 
         namespace separator.
      - forbid ":" as first character in a name
    
    Namespace names probably show similar irregularities,
    with a vengeance.
    
  4. foundin changed to: "None"
  5. priority changed to: "3 Low"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "21. [namespace]"
  10. title changed to: "Legal but irregular names ??"
  11. type changed to: "Bug"