::namespacexhookadd ?namespace? cmdprefix
Adds the cmdprefix to the chain of unknown command handlers that are invoked when the namespace
would otherwise invoke its unknown handler. If namespace is not specified, then cmdprefix is
added to the chain of handlers for the namespace of the caller.
The chain of cmdprefix are executed in reverse order of addition, i.e. the most recently added
cmdprefix is executed first. When executed, cmdprefix has additional arguments appended to it as
would any namespace unknown handler.
::namespacexhookproc ?namespace? argumentsbody
Adds an anonymous procedure to the chain of namespace unknown handlers for the namespace.
If namespace is not specified, then the handler is added to the chain of handlers for the
namespace of the caller.
The arguments and body are specified as for the core proc command.
::namespacexhookon ?namespace? guardcmdprefixactioncmdprefix
Adds a guarded action to the chain of namespace unknown handlers for the namespace.
If namespace is not specified, then the handler is added to the chain of handlers for the
namespace of the caller.
The guardcmdprefix is executed first. If it returns a value that can be interpreted as false, then
the next unknown hander in the chain is executed. Otherwise, actioncmdprefix is executed and the
return value of the handler is the value returned by actioncmdprefix.
When executed, both guardcmdprefix and actioncmdprefix have the same additional arguments appended
as for any namespace unknown handler.
::namespacexhooknextarg...
This command is available to namespace hooks to execute the next hook in the chain of handlers for
the namespace.
::namespaceximportfromnscmdname?newname ...?
Imports the command cmdname from the fromns namespace into the namespace of the caller. The
cmdname command is imported even if the fromns did not originally export the command.
If newname is specified, then the imported command will be known by that name. Otherwise, the
command retains is original name as given by cmdname.
Additional pairs of cmdname / newname arguments may also be specified.
::namespacexinfoallchildrennamespace
Returns a list containing the names of all child namespaces in the specified namespace and its
children. The names are all fully qualified.
::namespacexinfoallvarsnamespace
Returns a list containing the names of all variables in the specified namespace and its children.
The names are all given relative to namespace, and not fully qualified.
::namespacexnormalizenamespace
Returns the absolute name of namespace, which is resolved relative to the namespace of the caller,
with all unneeded colon characters removed.
::namespacexinfovarsnamespace ?pattern?
Returns a list containing the names of all variables in the specified namespace. If the pattern
argument is specified, then only variables matching pattern are returned. Matching is determined
using the same rules as for stringmatch.
::namespacexstategetnamespace
Returns a dictionary holding the names and values of all variables in the specified namespace and
its child namespaces.
Note that the names are all relative to namespace, and not fully qualified.
::namespacexstatesetnamespacedict
Takes a dictionary holding the names and values for a set of variables and replaces the current
state of the specified namespace and its child namespaces with this state. The result of the
command is the empty string.
::namespacexstatedropnamespace
Unsets all variables in the specified namespace and its child namespaces. The result of the
command is the empty string.
::namespacexstripprefixnamespaces
Each item in namespaces must be the absolute normalized name of a child namespace of namespace
prefix. Returns the corresponding list of relative names of child namespaces.