Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating tclIndex files for procs exported from namespaces

Status
Not open for further replies.

crossrad

Programmer
Nov 26, 1999
11
CA
In TCL 8.0, tclIndex files created by auto_mkindex<br>
contained procedure names which were NOT qualified with<br>
their namespace prefixes. Therefore, if these were public,<br>
exported commands then the autoloader worked just fine.<br>
<br>
In TCL 8.1 and 8.2, the tclIndex files contain fully<br>
qualified names and the autoloader does not work. The<br>
following example requires two files:<br>
<br>
File s1.tcl:<br>
<br>
namespace eval n1 {<br>
<br>
namespace export pub1<br>
proc pub1 {} { puts &quot;Executing \&quot;pub1\&quot;&quot; }<br>
<br>
}<br>
<br>
namespace import n1::pub1<br>
<br>
File s2.tcl:<br>
<br>
auto_mkindex . *.tcl<br>
set auto_path .<br>
pub1<br>
<br>
Executing with &quot;tclsh &lt; s2.tcl&quot; successfully executes pub1<br>
in 8.0 but not in 8.1 or 8.2. The 8.0 (working) tclIndex<br>
file is:<br>
<br>
set auto_index(pub1) [list source [file join $dir s1.tcl]]<br>
<br>
and the 8.1 and 8.2 (non-working) one is:<br>
<br>
set auto_index:):n1::pub1) [list source [file join $dir s1.tcl]]<br>
<br>
My systems are currently running only because each line<br>
of all the tclIndex files are munged with:<br>
<br>
regsub {::.*::} $l {} l<br>
<br>
but is there a more elegant solution?<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top