richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

Re-use existing Lua code or modules with Nyanga #36

Closed shortweekend closed 10 years ago

shortweekend commented 10 years ago

Is there currently an easy way to re-use existing Lua code or modules with Nyanga?

Thanks

richardhundt commented 10 years ago

On 3/2/14 5:43 PM, shortweekend wrote:

Is there currently an easy way to re-use existing Lua code or modules with Nyanga?

Sure, nyanga detects if a file has a .lua extension and if so will load it without trying to parse it first. So if you keep your file extensions as .nga for nyanga and .lua for Lua sources you should be good. It also detects pre-compiled LuaJIT bytecode (via the magic byte sequence at the start), and will load and run that too.

Of course, you still need to tell the VM where to find your Lua modules (via LUA_PATH environment variable, or package.path, etc.).

Thanks

— Reply to this email directly or view it on GitHub https://github.com/richardhundt/nyanga/issues/36.

shortweekend commented 10 years ago

Thanks, I should have noticed ;)