lua-users home
lua-l archive

Re: Luaj is not Invocable

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


My question about Invocable is still pending, but I found an answer about how to call a Lua function:
CompiledScript script = ((Compilable) scriptEngine).compile(reader);
Bindings sb = new SimpleBindings();
script.eval(sb);
LuaFunction luaFun = (LuaFunction) sb.get("calledByJava");
luaFun.call(param);
The script flow must reach the function definition, of course.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

AltStyle によって変換されたページ (->オリジナル) /