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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where does tclIndex file go?

Status
Not open for further replies.

tomdagliusa

Programmer
May 31, 2000
34
US
If I don't explicitly do a make, is no tclIndex file created, and tcl just runs interpreted each time? I ask
because I made some changes to code, and it doesn't seem to have taken affect.

Tom
 
Hm. Based on your question, I'm not able to figure out what problem you're actually experiencing. Could you provide more details, please?

I can address some of the issues that I did see, though. First of all, Tcl scripts are always interpreted; Tcl is an interpreted language, period. So, I don't quite understand what you were asking in that regard.

Second, unless you're 1) building Tcl from the C source files, 2) building a C-based Tcl extension from its source files, or 3) using make in some way to manage a particularly complex application that you're building in Tcl, I don't see anywhere where make comes into the mix. In virtually all Tcl development situations I've seen, people just use a text editor or IDE to create their Tcl scripts, and then run them with a Tcl interpreter. There's no compilation required unless they are integrating some custom C code.

Third, I'm not sure where a tclIndex file would come into play in your situation, unless you are creating your own auto-loaded libraries of Tcl code for use in your applications. A tclIndex file is used by an auto-loaded library of Tcl code to "advertise" the procedures that it implements and to describe how to load the procedures into an application. It is generated by the Tcl auto_mkindex command, and must be regenerated whenever a developer makes changes to the library. However, unless you're creating an auto-loaded library, you shouldn't have to deal with tclIndex files.

The only other possibility that I can think of is that you might be running an interactive Tcl interpreter to test out your code as you edit it. If you explicitly source a file into the interpreter, and then use your editor to make changes to the code afterward, the Tcl interpreter doesn't "see" those changes automatically. You'd have to explicitly save the file from the editor, and then source the file again into the Tcl interpreter for it to re-read and re-execute the commands in that file. Of course, if the code in that file creates widgets, you might experience trouble, because you might end up trying to create another set of widgets with the same names, which Tcl doesn't allow. For interactive testing of GUI code like that, it's easiest to start a fresh Tcl interpreter and try out your new code there.

So, there's my grasping at straws. If you can provide more information about your situation, we might be able to offer more help.

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Ken,

Thanks for the reply. No, no C files or any of that stuff. Just plain old tcl text files. I believe the problem may have been caused by emacs leaving around versions of files. If I edit aFile.tcl in vi, and save it, only one version of that file exists. If I edit aFile.tcl in emacs, and save it, I now have aFile.tcl and aFile.tcl~. Whatever procs, methods, and classes I have in each file I believe are available to the process name space, and may confuse the interpretor. That's my guess. I deleted all the ~ files, and my problem went away.

Does that make sense?
Tom
 
Interesting. Were you making use of Tcl's auto-loading features (trying to tie this into your previous mention of the tclIndex file)? If so, that might have caused the problem, depending on how you generated the tclIndex file. If you were to edit files in your auto-loaded library with Emacs, so that there were the backup files present, and then used a glob pattern in your auto_mkindex command that picked up the backup files for indexing as well, I could see how the conflict could occur. Depending on the order in which Tcl indexed the file, you could end up with the old definitions from the backup file overwriting the new definitions in the new file.

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Ken,

I'm not doing an auto_mkindex, or any other compile like constructs. I'm merely running tcl files from the shell. I believe the issue was the existence of multiple files with the same procs, methods, and classes. As soon as I got rid of the ~ files, my code started acting as it should.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top