README
1###
2## rivet/rivet-tcl - Tcl code for use with the Rivet Apache module.
3##
4## $Id$
5##
6###
7
8This directory contains an individual .tcl file for each proc in Rivet and
9a line in the tclIndex file for each corresponding .tcl file and procedure.
10
11This is done for two major reasons:
12
131) Code is easy to manage. If you want to edit a procedure, you know right
14 which file to look in.
15
162) No code is loaded needlessly into the interpreters. Since each command
17 resides in its own .tcl file, and those files are not sourced until the
18 command is needed, there is no loading of superfluous procs or code
19 when a particular command is needed.
20
21So, basically, if you want to add a single command to the Rivet library,
22you can easily do it by adding it as a .tcl file here. Name the file
23<commandName>.tcl, and then add it to the tclIndex file. You can either
24do this by hand or by Tcl's built-in functions. IE:
25
26$ tclsh
27% auto_mkindex . *.tcl
28
29This should produce the desired result.
30
31This is NOT the directory to add packages or entire libraries of code.
32See the rivet/packages/ directory for that.
33
34There is a small trade-off to all of this. The larger the proc library gets,
35the larger the auto_load array gets, making auto loading procedures take a
36little longer as the functions to load unknown commands have to pull the code
37to load each command from this array. But, the trade-off is really quite
38nominal. It will only even be used once, the first time a command is called.
39Once a command is loaded, none of this code is even called.
40