summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-11-05 19:47:17 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-11-05 19:47:17 (GMT)
commitac577f7e11a3948b96350bf08a039dccc4c0f84c (patch)
treed22b47e62a0da80789d1d27bd2cce0a4e4cce646 /library
parent8f57a0b74ebdd06b863f18306f18ff4790020cf6 (diff)
downloadtcl-ac577f7e11a3948b96350bf08a039dccc4c0f84c.zip
tcl-ac577f7e11a3948b96350bf08a039dccc4c0f84c.tar.gz
tcl-ac577f7e11a3948b96350bf08a039dccc4c0f84c.tar.bz2
* library/safe.tcl: A series of patches which bring the SafeBase
up to date with code guidelines, Tcl's features, also eliminating a number of inefficiencies along the way. (5) Moved the argument parsing setup into a procedure called when the code is loaded. Easier management of temporary data.
Diffstat (limited to 'library')
-rw-r--r--library/safe.tcl22
1 files changed, 14 insertions, 8 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index b6622cf..9914759 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: safe.tcl,v 1.23 2009/11/05 19:35:21 andreas_kupries Exp $
+# RCS: @(#) $Id: safe.tcl,v 1.24 2009/11/05 19:47:17 andreas_kupries Exp $
#
# The implementation is based on namespaces. These naming conventions are
@@ -1003,9 +1003,7 @@ proc ::safe::AliasEncoding {slave args} {
}
-namespace eval ::safe {
- # internal variable
- variable Log {}
+proc ::safe::Setup {} {
####
#
@@ -1013,10 +1011,6 @@ namespace eval ::safe {
#
####
- # Make sure that our temporary variable is local to this namespace. [Bug
- # 981733]
- variable temp
-
# Share the descriptions
set temp [::tcl::OptKeyRegister {
{-accessPath -list {} "access path for the slave"}
@@ -1031,6 +1025,7 @@ namespace eval ::safe {
::tcl::OptKeyRegister {
{?slave? -name {} "name of the slave (optional)"}
} ::safe::interpCreate
+
# adding the flags sub programs to the command program (relying on Opt's
# internal implementation details)
lappend ::tcl::OptDesc(::safe::interpCreate) $::tcl::OptDesc($temp)
@@ -1039,9 +1034,20 @@ namespace eval ::safe {
::tcl::OptKeyRegister {
{slave -name {} "name of the slave"}
} ::safe::interpIC
+
# adding the flags sub programs to the command program (relying on Opt's
# internal implementation details)
lappend ::tcl::OptDesc(::safe::interpIC) $::tcl::OptDesc($temp)
+
# temp not needed anymore
::tcl::OptKeyDelete $temp
+
+ return
}
+
+namespace eval ::safe {
+ # internal variable
+ variable Log {}
+}
+
+::safe::Setup