Dynamic loading of the scotty 2.1.0 extension

Graeme McKerrell (graemem@pdd.3com.com)
Thu, 13 Jun 1996 18:44:25 +0100

This is a multi-part message in MIME format.

--------------167EB0E72781E494446B9B3D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Having compiled and got scotty I have come accross what I consider
to be an inconsistancy in the release.

TCL 7.5 provides quite a neat system of registering packages such that they
can be dynamically loaded as required. However the code as it stands is not
quite bullet proof on this account.
if the scotty package has been set up to auto load using the
pkg_mkIndex procedure found in "init.tcl"of the TCL7.5 distribution,

"package require scotty" correctly reports the version of the module and sets up
the autoloading scripts BUT when one of the new commands is executed it fails
to load the module.

The reason for this is because the "load $WHERE_EVER/tnm.a scotty" command
loads in the module then tries to call the Scotty_Init C-Function, which
doesn't exist!! There should be a consitancy between the package name registered
with the Tcl_PkgProvide call and the registered initialisation function. i.e
Tnm_Init should be called Scotty_Init if we are going to register a package name
of "scotty" changing this C-function to this name solves the
problem.
This now means that there is NO NEED to have a separate "scotty" executable as
all the fucntionality can be acheived from within a standard "tclsh" or "wish"
(I haven't tried a "wish" yet) shell.

Looking at the naming conventions within the "tnm/generic/tnmInit.c" file it
whould have made more sense to let the package be known as "Tnm" instead of
"scotty" but for some reason the dynamic loading of the module was trying to
find scotty when I tried it.(I must of missed something somewhere)

Hope this is of some use

Yours
Graeme

--------------167EB0E72781E494446B9B3D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=".sig2"

_______________________________________________________
/ ___ | \
| ,' ` | """ |
| | ;--, .~~~, .~~~, .~~,~~. .~~~, | O O |
| | ``; | | | |---' | ! | |---' | ` ^ ' |
| `.__,' .!. `._.'. `._.' `. .' `._.' | (\_/) |
| | \_/ |
| graemem@pdd.3com.com | |
| | |
\_______________________________________________|________/
--------------167EB0E72781E494446B9B3D--