erluna is Lua bindings for Erlang.
C Erlang C++ Lua
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
c_src
ebin
include
priv/lib
src
test
Makefile
README.markdown
vsn.mk

README.markdown

erluna

erluna is Lua bindings for Erlang.

Building from Source

% cd /path/to
% git clone git://github.com/cooldaemon/erluna.git
% cd ./erluna
% make

How to Use

{ok, Lua} = erluna:start(),
ok = Lua:eval("lua_value1 = 1 + 1"),
{ok, 2} = Lua:get("lua_value1"),
ok = Lua:eval("function lua_fun(x) return x * 2 end"),
ok = Lua:eval("lua_value2 = lua_fun(5)"),
{ok, 10} = Lua:get("lua_value2"),

ok = Lua:set("lua_value3", [1, {foo, bar}, 3]),
{ok, [{1, 1}, {2, 3}, {"foo", "bar"}]} = Lua:get("lua_value3"),

ok = Lua:eval_file("/path/to/foo.lua"),

ok = Lua:eval("function echo(a, b) return a, b end"),
{ok, ["foo", "bar"]} = Lua:apply("echo", {foo, "bar"}),

Lua:stop().