lua – 最新版本中的Loadstring函数替换

我从lua 5.1更新到5.3.2,我的一个脚本无法工作导致尝试调用nil值(全局’loadstring’)那么,他们是否用新函数替换它?

在那里你可以找到功能https://www.lua.org/pil/8.html
在那里你可以测试它(不起作用)http://www.lua.org/cgi-bin/demo

解决方法

从Lua 5.2开始,loadstring已被 load取代.

Lua 5.2 reference manual开始:

Function loadstring is deprecated. Use load instead; it now accepts string arguments and are exactly equivalent to loadstring.

相关文章

1.github代码实践源代码是lua脚本语言,下载th之后运行thmai...
此文为搬运帖,原帖地址https://www.cnblogs.com/zwywilliam/...
Rime输入法通过定义lua文件,可以实现获取当前时间日期的功能...
localfunctiongenerate_action(params)localscale_action=cc...
2022年1月11日13:57:45 官方:https://opm.openresty.org/官...
在Lua中的table(表),就像c#中的HashMap(哈希表),key和...