If you have a complete list of all the procs and variables created by
the "source" command, then you can do ... something with that. Use of
namespaces may also help.
See "info commands" and "info globals", plus whatever yuou have to do to
do things like that in namespaces.
Assume we have a command we created called "listDiff" which returns the
"xor" of two lists - all elements that are in one or the other but not
both.
Then:
set Cmds [ info commands ]
set Glob [ info globals ]
source "somefile.tcl"
set dCmds [ listDiff [ info commands ] $Cmds ]
set dGlob [ listDiff [ info commands ] $Glob ]
Now you have two lists - one of globals to be deleted,
one of procs to be renamed to ""
You'd have to do something about renamed proc-s. And any state
of anything else changed by the source command would still
be changed.
--
Les Cargill