Mod /
Interface
Search:  


Table Of Contents (show)

  1. 1. Interface

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

Page last modified on November 15, 2007, at 02:40 PM