5
我在0.8.12中对变量作用域感到困惑。看起来函数参数与全局变量的范围相同 - 是否可能,或者我做错了什么?什么是qore中的函数参数范围?
3.1.0 [email protected] ~$ cat zk1.q
%new-style
%strict-args
sub fun(string v)
{
print("xxx\n");
}
string v = "zzz";
3.1.0 [email protected] ~$ qore zk1.q
unhandled QORE System exception thrown in TID 1 at 2017-01-30 08:10:32.612137 Mon +01:00 (CET) at zk1.q:4
PARSE-ERROR: local variable 'v' was already declared in the same block at zk1.q:9
感谢解释...