How does one get the value back from a Lua function call in LuaJava.
Lets say I have calc.lua:
function foo(n) return n*2 end
I call the function in Java as follows:
LuaState luaState;
this.luaState = LuaStateFactory.newLuaState();
this.luaState.openLibs();
this.luaState.LdoFile("calc.lua");
this.luaState.getGlobal("foo");
this.luaState.pushNumber(5.0);
int retcode=this.luaState.pcall(1, 1,0);
Now what do I have to call on LuaState object to get the result of this last function call foo(5)?
Is there an example somewhere showing Java->Lua invocation with return values from the call?