lua-users home
lua-l archive

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


2009/9/4 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> I have a module that has a mymodule.lua file and a mymodule.dll.  I want
>> to require 'mymodule' and have it load both mymodule.lua and
>> mymodule.dll.  Instead, I have to have mymodule.lua require
>> 'mymodule.core' (or something similar) and change the exported symbol to
>> luaopen_mymodule_core, so that mymodule.dll can be loaded.
>>
>> Is there a better way?
>
> Write your own loader and add it to package.loaders before everything.
> In this loader, you call the C loader and then the Lua loader.

To do that you can combine [1] and [2]. If you need more help on that
matter maybe you should create another topic in the mailing list.

[1] http://lua-users.org/wiki/BinaryModulesLoader
[2] http://lua-users.org/wiki/LuaModulesLoader