Why Itcl overrides the auto_import procedure in itcl.tcl ?

From: Moore Y. Cao (yilincao_at_lucent.com)
Date: 02/27/04

  • Next message: Cameron Laird: "Re: expect + TCL problem with send on underscore character"
    Date: Fri, 27 Feb 2004 09:45:25 +0800
    
    

    Folks,

    We run into an namespace issue when we using tclsh (tcl8.4) and identified it
    is's due to itcl overides the auto_import proc.

    I need your help to know why itcl overrides it and and whether the Itcl
    development group has a fix for this !!

    Here is how to reproduce this issue:

    We created two tcl files: name1 and name2.
    The contents of name1 are:

    namespace eval ::NAME1 {
            namespace import ::NAME2::otherdoit
            proc doit {} {
                    puts "Doing it"
                    otherdoit

            }
    }
    ::NAME1::doit

    The contents of name2 are:

    namespace eval ::NAME2 {
            namespace export otherdoit
            proc otherdoit {} {
                    puts "Doing it another way"

            }
    }

    When we attempt to execute NAME1::doit from the tcl shell, it works. However, it
    is failed in Itcl shell:

    itclsh
    % set auto_path ". $auto_path"
    . /ofc/tcl/tcl8.4/sol25/tcl20031119e-g/library
    /ofc/tcl/tcl8.4/sol25/tcl20031119e-g/lib
    % ::NAME1::doit
    Doing it
    invalid command name "otherdoit"
    % exit

    Thanks in advance any help is appreciated.
    Moore


  • Next message: Cameron Laird: "Re: expect + TCL problem with send on underscore character"

    Relevant Pages

    • Re: OO vs. namespaces - doubts
      ... Where can I find this chat? ... When closing the window, I destroy the namespace. ... Itk, the megawidget extension to Itcl, has a mechanism for that. ... can connect the widgets in an Itk class to object variables with the ...
      (comp.lang.tcl)
    • Tcl 8.6 & IncrTcl...
      ... It seems that Tcl 8.6 & Itcl do not cooperate any more, so I am puzzled whether applications that use Itcl are upgradable to Tcl 8.6 :-( ... package require Itcl;# Itcl adds object-oriented facilities to Tcl. ... I know that I tried to use an Itcl namespace as a normal namespace (i.e. as expected by "Nub domain", but again tclsh crashes instead of returning an error. ...
      (comp.lang.tcl)
    • Re: Whats the magic to using Incr Tcl
      ... I must use a "package require Itcl" in my script to load the ... then the interpreter bails saying that the command "class" ... All of the itcl commands are kept in an "itcl" namespace. ...
      (comp.lang.tcl)
    • Re: Invisible variable problem in itcl inheritance
      ... > following code in itcl 3.3 environment. ... > it (E.g. the variable is inherited from the base class and is created ... you are trying to access it unqualified from the "c" namespace ...
      (comp.lang.tcl)
    • Re: Can I reference 1 instance of an object by more names ? rephrase
      ... print name1, name2 # test ok ... name2 # both references are OK ... Assignments modify namespaces, not objects. ... The first statement modifies the namespace by binding the name "name1" ...
      (comp.lang.python)