|
发表于 2006-6-1 18:05:09
|
显示全部楼层
关于constant function 这是老外的jass手册上的介绍:
原地址 http://jass.sourceforge.net/doc/
If a function declaration is prefixed with constant, like the following:
constant function const_func takes integer a returns nothing
...
endfunction
then you can not call non-constant functions within the function body. (Nevertheless, note that you can still use the set statement in the body to alter function arguments, so it is not really \"constant\" in the typical sense; it is more of a hint to the programmer than anything else)
它的意思应该是说constant function 里可以调用别的constant function 但不能调用非constant function 也可以在constant function里对参数直接使用set语句 所以这个constant function 主要是对编程者一个提示的作用
[ 本帖最后由 illlusion 于 2006-6-1 18:12 编辑 ] |
|