Why Itcl overrides the auto_import procedure in itcl.tcl ?
From: Moore Y. Cao (yilincao_at_lucent.com)
Date: 02/27/04
- Previous message: Cameron Laird: "Re: I need to call some user init_proc before calling any Tcl or User Defined proc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Cameron Laird: "Re: I need to call some user init_proc before calling any Tcl or User Defined proc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|