Skip to content

cooldaemon/erluna

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 

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().

About

erluna is Lua bindings for Erlang.

Resources

Stars

Watchers

Forks

Packages

No packages published