Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 28c0b1b9908ef4f7f9758b7e6cd69f37ebd18b45
Ticket: ba79c2f0ce408c09c8967eb037503251c4b525ac
Use of Itcl with auto load and namespace import result in command errors
User & Date: anonymous on 2017-01-30 20:02:52
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Any command imported (namespace import) from a script that has been auto_loaded fails if used in conjunction with the Iwidgets package.
    
    This is true for 8.5 and 8.6
    
    Consider the following two procs:
    
    src.tcl --------------------------------------
    namespace eval src {
        proc a {} {return "alpha"}
        proc b {} {return "beta"}
        proc etc {} {return "..."}
        namespace export a b
    }
    
    
    dst.tcl -------------------------------------------
    package require Iwidgets
    
    lappend ::auto_path [file dirname [info script]]
    puts $::auto_path
    
    namespace eval dst {
        namespace import ::src::*
        proc c {} {return "Charlie"}
        puts "[a] [b] [c]"
    }
    
    use mk to create a tcl index and run dst.
    
    The result "a" is an invalid command.
    
    Next: comment the package require.
    
    => alpha beta charlie
    
    
    Now, consider the mods to dst.tcl - namespace import commented.
    
    dst.tcl ----------------------------------
    package require Iwidgets
    
    lappend ::auto_path [file dirname [info script]]
    puts $::auto_path
    
    namespace eval dst {
        #namespace import ::src::*
        proc c {} {return "Charlie"}
        puts "[::src::a] [::src::b] [c]"
    }
    
    => alpha beta charlie
    
  5. foundin changed to: "8.6.4"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "96d40012292bbe2f33abb1ebc8a4a02fc9de73ff"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "38. Init - Library - Autoload"
  15. title changed to:
    Use of Iwidgets with auto load and namespace import result in command errors
    
  16. type changed to: "Bug"