lua-users home
lua-l archive

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


Hi,
I'm anoyed with the amount lua extensions out there. With lua extensions I
mean lua binaries that are linked with different libraries. The problem with
this approach is that you cannot use lua with two different libraries at the
same time. The only solution is to build your own lua, and that's only
possible if the source code of the libraries is publically available.
To solve that I would like to see a standard mechanism to write dinamic
libraries for lua. The requierements of that mechanism are very simple:

- A single entrypoint in the library: (i.e. Register(lua_State *) ) where
all the lua functions are exported.
- A new function in iolib (i.e. loadlib )

so you could do:

> loadlib "wxlua"

and that would load the library, call the Register function, and add the
library to a table of loaded libraries, so that multiple calls to loadlib do
not load the library multiple times.

- A tag method to unload the library.
- Alternatively the library can also export an 'Unregister' function to
remove the exported functions from lua.


Is there a mechanism like this in lua?
I would like to hear others opinions about this proposal, specially about
how would it interact with multiple lua states.

Thanks in advance,

Ignacio Castaño
castano@asidesoft.com



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com