auto_load -- attempt to load the specified command from a loadable library


auto_load [command]


Attempts to load the specified command from a loadable library, loading the package containing the procedure. If the package indexes have not been loaded for all package libraries in auto_path, they are loaded. Out-of-date library indexes are rebuilt if they are writable. The procedure returns 1 if the command was successfully loaded, or 0 if it was not.

Duplicated package names are skipped; the first package of a given name found in the path is loaded. If the auto_path has changed since the last load, indexes are reloaded (duplicate packages are not redefined).

If command is not specified, the indexes are loaded, if they have not already been loaded or if the auto_path variable has changed, but no command is loaded.

This command overrides the standard Tcl procedure of the same name.