  CLASS
    tcl.lang.Interp -- This manual entry contains methods that declare presence of or dependence on a package.
  METHODS
    public final String pkgRequire(String pkgname, String version, boolean exact) throws TclException
    public final void pkgProvide(String pkgname, String version) throws TclException
  OTHER METHODS
  ARGUMENTS
  DESCRIPTION
    pkgRequire
    pkgProvide
  EQUIVALENT C FUNCTIONS
  SEE ALSO
  KEYWORDS

### CLASS

tcl.lang.Interp -- This manual entry contains methods that declare presence of or dependence on a package.

### METHODS

public final String pkgRequire(String pkgname, String version, boolean exact) throws TclException

public final void pkgProvide(String pkgname, String version) throws TclException

### OTHER METHODS

dispose, setVar, traceVar, createCommand, eval,
setResult, backgroundError, getNotifier, setAssocData

### ARGUMENTS

String pkgname ()
  Name of package to require or provide.

String version ()
  A version name consisting of one or more decimal numbers separated by dots, specifying which version of the package pkgname to require or provide; null means use the latest version available.

boolean exact ()
  Specifies whether to use the exact version specified by version or the latest one available whose major version number is the same as that of version.

### DESCRIPTION

These procedures provide Java library interfaces to Tcl's package and version management facilities.

pkgRequire
  The pkgRequire method is called by code that depends on a particular version of the package, pkgname. If the package is not already provided in the interpreter, this method invokes a Tcl script to provide it. If version is not null, and exact is true, then the version specified by version is provided. Otherwise, the lastest available version is provided. If the package is already provided and the presently provided version matches the one specified by the version and exact arguments (as described above), then no conflict exists, and no action is taken.

  If successful, this method returns the version string for the newly (or previously) provided version of the package, which may be different from the "version" argument. If the caller's requirements cannot be met (e.g. the version requested conflicts with a currently provided version, or the required version cannot be found, or the script to provide the required version generates an error), a TclException is thrown.

pkgProvide
  The pkgProvide method declares the presence of a particular version of the package, pkgname, in the interpreter. If there is already another version of the package loaded in this interpreter, then an exception is thrown. Otherwise, the interpreter remembers that this package is available, so that no other version of the package may be provided.

### EQUIVALENT C FUNCTIONS

Tcl_PkgRequire, Tcl_PkgProvide

### SEE ALSO

Interp, package

### KEYWORDS

interpreter, package, provide, require, version

    Copyright © 1994-1998 Sun Microsystems, Inc.
    Copyright © 1995-1997 Roger E. Critchlow Jr.