Tcl Library Source Code


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


namespacex - Namespace utility commands

Table Of Contents


package require Tcl 8.5 9
package require namespacex ?0.4?

::namespacex hook add ?namespace? cmdprefix
::namespacex hook proc ?namespace? arguments body
::namespacex hook on ?namespace? guardcmdprefix actioncmdprefix
::namespacex hook next arg...
::namespacex import fromns cmdname ?*newname ...?*
::namespacex info allchildren namespace
::namespacex info allvars namespace
::namespacex normalize namespace
::namespacex info vars namespace ?pattern?
::namespacex state get namespace
::namespacex state set namespace dict
::namespacex state drop namespace
::namespacex strip prefix namespaces


This package provides a number of utility commands for working with namespaces. The commands fall into four categories:

  1. Hook commands provide and manipulate a chain of commands which replaces the single regular namespace unknown handler.

  2. An import command provides the ability to import any command from another namespace.

  3. Information commands allow querying of variables and child namespaces.

  4. State commands provide a means to serialize variable values in a namespace.


Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category namespacex of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


extended namespace, info, namespace unknown, namespace utilities, state (de)serialization, unknown hooking, utilities


Copyright © 200? Neil Madden (
Copyright © 200? Various (
Copyright © 2010 Documentation, Andreas Kupries