Skip to content

dyama/mruby-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mruby-lua

Examples

Lua#dostring method

lua = Lua.new

script =<<"EOF"
  function twice(x)
    return x * 2
  end
  a = 10
  b = 20
  print(a * twice(b))
EOF

lua.dostring script
  => 400

Lua#dofile method

lua = Lua.new
lua.dofile "test/fib.lua"

Lua#[] method

Get global variable from Lua.

lua = Lua.new

lua.dostring "a = 10; b = 20; c = a * b"

lua["a"] # => 10
lua["c"] # => 20
lua["c"] # => 200

About

mruby-lua calls Lua script engine from mruby.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •