Luaj/Java:我们如何将数据返回到Java?
我正在学习Lua和LuaJ Java库。我了解了如何创建和运行脚本:Luaj/Java:我们如何将数据返回到Java?,java,lua,luaj,Java,Lua,Luaj,我正在学习Lua和LuaJ Java库。我了解了如何创建和运行脚本: String script = "message = 'Hello World!'"; InputStream input = new ByteArrayInputStream(script.getBytes()); Prototype prototype = LuaC.compile(input, "script"); LuaValue globals = JsePlatform.standardGlobals(); Lua
String script = "message = 'Hello World!'";
InputStream input = new ByteArrayInputStream(script.getBytes());
Prototype prototype = LuaC.compile(input, "script");
LuaValue globals = JsePlatform.standardGlobals();
LuaClosure closure = new LuaClosure(prototype, globals);
LuaValue value = closure.call();
如何将Lua变量的值
消息
返回Java,并通过LuaValue
访问它?这可能吗?将返回消息
添加到脚本末尾?噢,是的,就是这样。谢谢