Skip to content
disruptekPublic

About

a hack to let me work with some lua data more naturally

Resources

Stars

8 stars

Watchers

1 watching

Forks

Latest commit

 

History

44 Commits

Folders and files

Repository files navigation

lunacy

Test Matrix GitHub release (latest by date) Minimum supported Nim version License Matrix

We're aiming for a high-quality integration with Lua, but it might take a little time to get there; point being, this API is a work in progress...

Usage

--define:lunacyLuaJIT to use luajit.so; else we'll use a 5.[01] library.

# instantiate a lua virtual machine
let vm =
  # the lua just returns a table
  lua:
    return {
      foo = "bar",
      bif = "baz",
      bam = 34,
    }

# pop the table from the lua vm
var s = popStack vm

# we can index it as a table, render it as Lua, etc.
assert s["foo"] == "bar"
assert s["bam"] == 34
assert s["bam"] == 34.0
assert $s == """{bif = "baz", foo = "bar", bam = 34}"""

Installation

$ nimph clone disruptek/lunacy

or if you're still using Nimble like it's 2012,

$ nimble install https://github.com/disruptek/lunacy

Documentation

See the documentation for the lunacy module as generated directly from the source.

License

MIT

About

a hack to let me work with some lua data more naturally

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages