lua-users home
lua-l archive

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


It was thus said that the Great Jerome Vuarand once stated:
> 2013/6/28 Sean Conner <sean@conman.org>:
> >   I'm surprised that Lua doesn't look for just
> >
> >                 luaopen()
> >
> > as part of the search mechanism.
> 
> Putting aside name conflict issues in dynamic libraries (that may not
> apply to your platforms), it's very easy to extend the module system
> to implement the behaviour you describe. I wrote an example binary
> loaded on the Lua wiki a while ago (for 5.1):
> 
>     http://lua-users.org/wiki/BinaryModulesLoader
> 
> Simply replace the package.loadlib second argument with a constant
> string, and voilà, you can move your DLLs around (provided you name
> the entry point with that constant string).

  True enough, but I was just wanting the ability to rename C modules with
the same ease as you can Lua modules (just rename the file, and if the
module starts with "module(...)" It Just Works).

  -spc