1. Interface
The interface component of Mod is designed to handle
automatic generation of an interface or .htcl file for a given
Tcl file. The interface file contains 1 extern for each
exported proc/method.
Interface also
decodes option info from Opts/Vopts.
In addition, when TOD is being used, the entry points
~New and ~Delete are also generated, including
info from ~Opts
Finally, to support Uses, there is for each namespace/file
pair a Mod cmds statement declaring the commands defined therein.
Here is a simple example from Ted.
namespace eval ::pdqi::diff {
Mod export
# Perform diff on two files: options are after file names.
extern diff {file1 file2 args}
# Like diff, but works on data.
extern diffdata {d1 d2 args} {. . . {opts -n}}
# Find longest common sequence.
extern lcs { l1 l2 }
Mod cmds ::pdqi::diff diff.tcl {diff diffdata lcs}
}
© 2008 Peter MacDonald