[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: On Lua and C Modules (was Re: [ANN] luafaq.org source on GitHub)
- From: Sean Conner <sean@...>
- Date: Mon, 1 Jul 2013 02:00:38 -0400
It was thus said that the Great Jerome Vuarand once stated:
> 2013/6/28 Sean Conner <firstname.lastname@example.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):
> 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).