Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e07f0a194ceed6ef1130beb8d87b569a9280f8c0
Ticket: 218146ffffffffffffffffffffffffffffffffff
the "variable" command doesn't always initialize properly.
User & Date: nobody on 2000-10-26 00:53:44
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2122 Bug
    Version: 8.1
    SubmitDate: '1999-05-24'
    LastModified: '1999-08-08'
    Severity: MED
    Status: Closed
    Submitter: pat
    ChangedBy: hobbs
    OS: Windows 95
    OSVersion: 8.1 and 8.0.4
    Machine: X86
    FixedDate: '2000-10-25'
    ClosedDate: '1999-08-08'
    
    
    Name:
    John Baxter
    
    ReproducibleScript:
    The following are commands typed in wish and the responses (on Windows
        95).
        
        % variable x ""
        % puts $x
        
        % variable y "a"
        % puts $y
        a
        % namespace eval foo variable z ""
        % puts ${foo::z}
        can't read "foo::z": no such variable
        % namespace eval foo variable w "a"
        % puts ${foo::w}
        a
        %
    
    ObservedBehavior:
    The behavior with respect to the variable foo::z seems inconsistent with
        the other cases as well as with the man page on the "variable" command.
    
    DesiredBehavior:
    Initializing a variable with a value should make it readable.
    
    
    
    This is a conceptual error, and the result is as expected and
    documented.  The namespace eval, like normal eval, will concat
    the args together.  This causes an empty string ("") to just
    disappear.  The command doesn't fail because variable with just
    one arg is acceptable.  The safer way to call namespace eval is:
       namesapce eval foo { variable z "" } 
    -- 08/08/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    the "variable" command doesn't always initialize properly.
    
  11. type changed to: "Bug"