lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Apr 10, 2013 at 10:50 PM, Pierre-Yves Gérardy <pygy79@gmail.com> wrote:

http://getmoai.com/wiki/index.php?title=Concatenate_your_Lua_source_tree


Cool, but what when you want to concatenate some one else's Lua source tree?  That's when the fun starts. Lua 5.1 works fine, since module() can be put into a function (a feature that Petite Abeile was a big fan of); 'no magic' style is never a problem.  When you're packing for 5.2, then you hit some ... interesting problems.  The module() that still exists in a 'compatible' Lua 5.2 cannot be put into a function - so I had to write my own.  And  '_ENV = {}...' modules can't be put into functions without a rather important 'local'. Currently sorting out these issues for luabuild, which (after all) is about making custom Lua executables with embedded source code. And that code can use any style... e.g. lpeg's re uses _ENV and luasocket still uses module().