[Arjen Markus] (13 february 2009) Just another page containing some tips and tricks, this one is about [package]s. Whether you get a package from the [teapot] repository or from the distribution directly or ..., normally all you need to do is: ====== package require NAME ====== to load all parts of a package NAME and start using it. Sometimes, however, you may want a bit of introspection: * Where is the package installed? * What DLLs or shared objects are involved? * What version have I loaded? Here are some answers: ****Where does Tcl look for a package?**** Tcl uses the variable ''[auto_path]'' to look for a package. auto_path contains a [list] of directories to search. So if you want Tcl to look in other directories as well, simply [lappend] these directories to this variable. ****Where is a particular package installed?**** Here is a trick [Andreas Kupries] came up with to find out just where the files are located: ====== package ifneeded NAME [package require NAME] ====== This command will return the exact ''command'' to get the package. It works regardless of the type of package: a Tcl-only package, a binary extension, or a Tcl module. You need to interpret the command yourself, but it contains the exact location. (If you want to find where a particular version of the package is located, add the version information to the "package require" part) ****What DLLs or shared objects are involved?**** The following command returns information about the various DLLs/shared objects you currently have loaded into the interpreter: ====== info loaded ====== ****What version have I loaded?**** The simplest way to find out what version you have loaded is to repeat the "package require" command. As it has been loaded already, nothing in particular is done, but you do get the version number. ---- !!!!!! %| [Category Introspection] |% !!!!!!