Tcl Library Source Code

namespacex - Namespace utility commands
Login

[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

namespacex(n) 0.1 tcllib "Namespace utility commands"

Name

namespacex - Namespace utility commands

Description

This package provides a number of utility commands for working with namespaces.

API

::namespacex hook add ?namespace? cmdprefix
::namespacex hook proc ?namespace? arguments body
::namespacex hook on ?namespace? guardcmdprefix actioncmdprefix
::namespacex hook next arg...
::namespacex info allchildren namespace

Returns a list containing the names of all child namespaces in the specified namespace and its children. The names are all fully qualified.

::namespacex info allvars namespace

Returns a list containing the names of all variables in the specified namespace and its children. The names are all relative to namespace, and not fully qualified.

::namespacex info vars namespace ?pattern?

Returns a list containing the names of all variables in the specified namespace.

::namespacex normalize namespace

Returns the absolute name of namespace, which is resolved relative to the namespace of the caller, with all unneeded colon characters removed.

::namespacex state get namespace

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.

::namespacex state set namespace dict

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.

::namespacex state drop namespace

Unsets all variables in the specified namespace and its child namespaces. The result of the command is the empty string.

::namespacex strip namespace namespaces

Each item in namespaces must be the absolute normalized name of a child namespace of prefix. Returns the corresponding list of relative names of child namespaces.