[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: requiring modules with a C and Lua part
- From: Diego Nehab <diego@...>
- Date: Wed, 1 Nov 2006 14:03:07 -0500 (EST)
Hi,
What's common practice in the case that a module has both a C and Lua
component?
Is there a standard neat way out?
I don't know how common it is, but I love doing it.
LuaSocket, the MIME module, and LuaThread all do it. There
is a socket.lua file. This is what is require()d by the
user, so it is in the LUA_PATH. It in turn require()s
"socket.core". There is a core.so inside a socket/ directory
in the LUA_CPATH. Both export symbols into the socket
namespace.
There might be better ways, but this has worked well for me.
[]s,
Diego.