![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.tcl archiveRe: catch and eval
From: mark anthony <koyama80@gmail.com>
Date: Wed Dec 21 2005 - 11:53:33 CET
why catch it at all? puts wont fail you
your foo is nothing more then puts -nonewline with more arguments
so this would do the same
use eval and expr with care and love your curly brace.
what happend ?
[catch "eval puts $args" msg]
"eval puts $args" will be subst'ed to "eval puts hi there"
catch is catch skript ?varName?
so your "eval puts hi there" will be executed like
eval { eval puts hi there }
ok that the eval is useless was pointed out already but
as said dont use " but { and }, i hope you see now
so conclusion just write your normal code that might
::if {[::catch {
in some cases you might rather use if {[info .... ]} then { code }
cheers,
|