Adds a new API function call_function!/3 which executes Lua functions inside the passed environment. Allows for calling functions by keys (fully qualified name), references, and direct function callbacks
Also adds the encode!/1 function for encoding values
Usage
defmodule MyAPI do
use Lua.API, scope: "example"
deflua foo(value), state do
Lua.call_function!(state, [:string, :lower], [value])
end
end
lua = Lua.new() |> Lua.load_api(MyAPI)
{["wow"], _} = Lua.eval!(lua, "return example.foo(\"WOW\")")
Adds a new API function
call_function!/3
which executes Lua functions inside the passed environment. Allows for calling functions by keys (fully qualified name), references, and direct function callbacksAlso adds the
encode!/1
function for encoding valuesUsage