diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2009-06-08 08:13:09 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2009-06-08 08:13:09 +0200 |
commit | 36818817bd61594ea6d106328bb8df0f5a25cfc4 (patch) | |
tree | 58180069c9a32400e7e11ba5bc5c85be2f11f0cc /examples/luaex.nim | |
parent | 4d4b3b1c04d41868ebb58bd9ccba7b303007e900 (diff) | |
download | Nim-36818817bd61594ea6d106328bb8df0f5a25cfc4.tar.gz |
version0.7.10
Diffstat (limited to 'examples/luaex.nim')
-rw-r--r-- | examples/luaex.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/luaex.nim b/examples/luaex.nim new file mode 100644 index 000000000..a71f0fb05 --- /dev/null +++ b/examples/luaex.nim @@ -0,0 +1,15 @@ +# Embedds Lua into a Nimrod application + +import + lua, lualib, lauxlib + +const + code = """ +print 'hi' +""" + +var L = luaL_newstate() +luaL_openlibs(L) +discard luaL_loadbuffer(L, code, code.len, "line") +discard lua_pcall(L, 0, 0, 0) + |