Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: efe4a39e9a3808cfdd8436ce10324180797b7385
Ticket: 218334ffffffffffffffffffffffffffffffffff
namespace import command causes one Tclx command to not be f
User & Date: nobody on 2000-10-26 00:56:22
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3947 Bug
    Version: 8.0.3
    SubmitDate: '1999-12-27'
    LastModified: '2000-06-27'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: ericm
    RelatedBugIDs: 3531
    OS: Linux-Red Hat
    OSVersion: Linux 5.2
    Machine: PC with Pentium II 400/256 MB RAM
    FixedDate: '2000-10-25'
    ClosedDate: '2000-06-27'
    
    
    Name:
    Charles Shartsis
    
    Extensions:
    Tclx 8.0.3 patchlevel 0
    
    CustomShell:
    No modifications or patches
    
    ReproducibleScript:
    Run the below script with and without the namespace import command commented out.
    
    #!/bin/sh
    # Run tclsh from the PATH  exec tclsh "$0" "$@"
    
    package require Tclx
    
    puts "Tcl version is [info tclversion] (my system is 8.0)"
    puts "Tcl patchlevel is [info patchlevel] (tried it with 8.0.3 and 8.0.5)"
    puts "TclX version is [infox version] (my system is 8.0.3)"
    puts "Tclx patchlevel is [infox patchlevel] (my system is 0)"
    
    namespace eval Lib {}
    
    proc Lib::Aproc {} {
    
       translit a b c
       set a(1) 1
       for_array_keys key a { puts "It works" }
    
    }
    
    # It works with next line commented out.  Why?
    namespace import Lib::Aproc
    
    Lib::Aproc
    
    ObservedBehavior:
    I frankly don't know whether this is a problem with Tcl or extended Tcl.  Then again, maybe there is no problem and I am extremely confused.
    
    Refer to the above script (which is an extremely simplified version of the script which originally manifested the problem).  Note that both translit and for_array_keys are extended tcl commands.  If you comment out the namespace import command, the script runs fine and prints "It works".  If you run the script with the namespace import command not commented out, you get the following stack trace:
    
    invalid command name "for_array_keys"
        while executing
    "for_array_keys key a { puts "It works" }"
        (procedure "Lib::Aproc" line 5)
        invoked from within
    "Lib::Aproc"
        (file "./bug.tcl" line 25)
    
    DesiredBehavior:
    I have two observations:
    
    1) With or without the namespace import command, there should be no error
    2) If extended Tcl commands cannot be found in Lib::Aproc, then it seems to me that the failure should occur at the translit command which precedes the for_array_keys command.  Both are extended Tcl commands.
    
    
    
    I am unable to duplicate this behavior with Tcl 8.0.5/Tclx 8.0.3, or with Tcl 8.4a1/Tclx 8.2, on Redhat 6.0.  Perhaps it was a problem with the libraries on Redhat 5.2.
    
    - eric
    
    -- 06/27/2000 ericm
    
    
    
  4. foundin changed to: "obsolete: 8.0.3"
  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:
    namespace import command causes one Tclx command to not be f
    
  11. type changed to: "Bug"