package require Configuration
Configuration::Set configname value
Configuration::get configname ?default?
Configuration::readEnvironment confname envname ?default?
This package maintains a set of configuration variables. The configuration variables are maintained in a separate namespace so that they cannot accidently collide with other existing global variables.
In addition to simple set and get operations environment variables can be checked for existence and used to set the value of variables. Configuration files can also be read and written, however it would probably be better to use the StateManager package for that instead.
The Configuration package provides procs in the ::Configuration:: namespace:
The configuration file at
read in with the namespace set to the configuration variable
namespace. The file is sourced into the current
interpreter (one reason that
StateManager is a better
The source is done at the global level.
The configuration file is presumed to only contain set commands. This is not enforced however.
confname envname ?default?
If the environment variable
is defined, the variable
the configuration namespace is set to the value of
envname does not exist,
confname is set to
default. If the
default parameter is not supplied,
envname is not defined,
the variable is defined, but set to the empty string.
Sets the configuration variable named
has not yet been defined this will create it.
confname is already a defined
configuration parameter its value is returned. If
not, the value of
default is returned.
If not supplied
be the empty string.
Writes the configuration out to the open
What this means is that a .tcl script consisting of simple
set commands will be written that can
be read in with
to restore the state of all defined configuration variables
as they are defined at the time