更新时间:2023-12-01 10:36:10
您可以使用环境loadfile("mydata","t",XYZ)
和XYZ
加载文件.参见手册中的 loadfile .
You can load the file with XYZ
as is environment: loadfile("mydata","t",XYZ)
. See loadfile in the manual.
这在Lua 5.2中有效.对于Lua 5.1,请使用loadfile
,然后使用setfenv
.
This works in Lua 5.2. For Lua 5.1, use loadfile
followed by setfenv
.