The package Command

The package command has several operations that are used primarily by the pkg_mkIndex procedure and the automatic loading facility. These operations are summarized in Table 12-2.

Table 12-2. The package command.
package forget packageDeletes registration information for package.
package ifneeded package ?command?Queries or sets the command used to set up automatic loading of a package.
package namesReturns the set of registered packages.
package provide package versionDeclares that a script file defines commands for package with the given version.
package require package ?version? ?-exact?Declares that a script uses package. The -exact flag specifies that the exact version must be loaded. Otherwise, the highest matching version ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.