subst or eval command is not working in my case ..
% proc sum {a b} {
return [expr $a+$b]
}
%
% set a 1
1
% set b 2
2
% sum $a $b
3
%
% sum {$a} {$b}
can't use non-numeric string as operand of "+"
%
% subst [sum {$a} {$b}]
can't use non-numeric string as operand of "+" >>>>>>>>> Why i am unable to substitue the value
%
% eval [sum {$a} {$b}]
can't use non-numeric string as operand of "+" >>>>>>>>> Why i am unable to substitue the value
%
我想知道为什么上述情况对我不起作用.. subst 命令应该执行变量和命令替换。但是为什么我的变量没有替代。
任何人都可以请解释发生了什么吗?