diff options
author | dgp <dgp@users.sourceforge.net> | 2003-11-14 20:44:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-11-14 20:44:43 (GMT) |
commit | 17f540b256d78b8a6fc8bd9121a633dac6c23b19 (patch) | |
tree | 1abdc7a020d4095171e8cb7f16def9be025cb664 /library/safe.tcl | |
parent | f745c9aa31bbdf8f71589fa25d30ce50cad94652 (diff) | |
download | tcl-17f540b256d78b8a6fc8bd9121a633dac6c23b19.zip tcl-17f540b256d78b8a6fc8bd9121a633dac6c23b19.tar.gz tcl-17f540b256d78b8a6fc8bd9121a633dac6c23b19.tar.bz2 |
* doc/ParseCmd.3: Implementation of TIP 157. Adds recognition
* doc/Tcl.n: of the new leading {expand} syntax on words.
* generic/tcl.h: Parses such words as the new Tcl_Token type
* generic/tclBasic.c: TCL_TOKEN_EXPAND_WORD. Updated Tcl_EvalEx
* generic/tclCompile.c: and the bytecode compiler/execution engine
* generic/tclCompile.h: to recognize the new token type. New opcodes
* generic/tclExecute.c: INST_LIST_VERIFY and INST_INVOKE_EXP and a new
* generic/tclParse.c: operand type OPERAND_ULIST1 are defined. Docs
* generic/tclTest.c: and tests are included.
* tests/basic.test:
* tests/compile.test:
* tests/parse.test:
* library/auto.tcl: Replaced several [eval]s used to perform
* library/package.tcl: argument expansion with the new syntax.
* library/safe.tcl: In the test files lindex.test and lset.test,
* tests/cmdInfo.test: replaced use of [eval] to force direct
* tests/encoding.test: string evaluation with use of [testevalex]
* tests/execute.test: which more directly and robustly serves the
* tests/fCmd.test: same purpose.
* tests/http.test:
* tests/init.test:
* tests/interp.test:
* tests/io.test:
* tests/ioUtil.test:
* tests/iogt.test:
* tests/lindex.test:
* tests/lset.test:
* tests/namespace-old.test:
* tests/namespace.test:
* tests/pkg.test:
* tests/pkgMkIndex.test:
* tests/proc.test:
* tests/reg.test:
* tests/trace.test:
* tests/upvar.test:
* tests/winConsole.test:
* tests/winFCmd.test:
Diffstat (limited to 'library/safe.tcl')
-rw-r--r-- | library/safe.tcl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index 541bdec..9420186 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.11 2003/07/16 22:49:12 hobbs Exp $ +# RCS: @(#) $Id: safe.tcl,v 1.12 2003/11/14 20:44:45 dgp Exp $ # # The implementation is based on namespaces. These naming conventions @@ -525,7 +525,7 @@ proc ::safe::interpDelete {slave} { # remove the hook now, otherwise if the hook # calls us somehow, we'll loop Unset $hookname - if {[catch {eval $hook [list $slave]} err]} { + if {[catch {{expand}$hook $slave} err]} { Log $slave "Delete hook error ($err)" } } @@ -636,15 +636,15 @@ proc ::safe::setLogCmd {args} { } # set/get values proc Set {args} { - eval [list Toplevel set] $args + Toplevel set {expand}$args } # lappend on toplevel vars proc Lappend {args} { - eval [list Toplevel lappend] $args + Toplevel lappend {expand}$args } # unset a var/token (currently just an global level eval) proc Unset {args} { - eval [list Toplevel unset] $args + Toplevel unset {expand}$args } # test existance proc Exists {varname} { @@ -691,7 +691,7 @@ proc ::safe::setLogCmd {args} { proc Log {slave msg {type ERROR}} { variable Log if {[info exists Log] && [llength $Log]} { - eval $Log [list "$type for slave $slave : $msg"] + {expand}$Log "$type for slave $slave : $msg" } } @@ -856,7 +856,7 @@ proc ::safe::setLogCmd {args} { proc Subset {slave command okpat args} { set subcommand [lindex $args 0] if {[regexp $okpat $subcommand]} { - return [eval [list $command $subcommand] [lrange $args 1 end]] + return [$command $subcommand {expand}[lrange $args 1 end]] } set msg "not allowed to invoke subcommand $subcommand of $command" Log $slave $msg @@ -891,8 +891,8 @@ proc ::safe::setLogCmd {args} { set subcommand [lindex $args 0] if {[regexp $okpat $subcommand]} { - return [eval ::interp invokehidden $slave encoding $subcommand \ - [lrange $args 1 end]] + return [::interp invokehidden $slave encoding $subcommand \ + {expand}[lrange $args 1 end]] } if {[string match $subcommand system]} { |