来源:Lua
浏览 336
扫码
分享
2020-07-02 07:45:07
8.2 – Incompatibilities in the Libraries
- The function
print
does not call tostring
to format its arguments; instead, it has this functionality hardwired. You should use __tostring
to modify how values are printed. - The pseudo-random number generator used by the function
math.random
now starts with a somewhat random seed. Moreover, it uses a different algorithm. - By default, the decoding functions in the
utf8
library do not accept surrogates as valid code points. An extra parameter in these functions makes them more permissive. - The options “
setpause
“ and “setstepmul
“ of the function collectgarbage
are deprecated. You should use the new option “incremental
“ to set them. - The function
io.lines
now returns four values, instead of just one. That can be a problem when it is used as the sole argument to another function that has optional parameters, such as in load(io.lines(filename, "L"))
. To fix that issue, you can wrap the call into parentheses, to adjust its number of results to one.
当前内容版权归
Lua 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问
Lua .