Is there a way to create a Lua function in Java and pass it to Lua to assign it into a variable?
For example:
In my Java class:
private class doSomething extends ZeroArgFunction { @Override public LuaValue call() { return "function myFunction() print ('Hello from the other side!'); end" //it is just an example } }
In my Lua script:
myVar = myHandler.doSomething(); myVar();
In this case, the output would be: "Hello from the other side!"