Re: [poll] require & binary module interfaces
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [poll] require & binary module interfaces
- From: Etan Reisner <deryni@...>
- Date: 2010年10月21日 00:27:59 -0400
On Wed, Oct 20, 2010 at 09:12:27PM -0700, Wesley Smith wrote:
<snip>
> This makes a big difference to
> how require works, since for binary modules, I can't
> require("space.vec3") without first requiring space since
> space.vec3.so or some variation thereof doesn't actually exist and Lua
> won't load the module just to check for a function pointer. Any
> thoughts?
require("space.vec3") should work fine by itself using the all-in-one
loader if your module is space.so and has both luaopen_space and
luaopen_space_vec3 functions exported. See the refman entry for
package.loaders for details.
It won't (on its own) load the space module though so you'll need to make
sure your luaopen_space_vec3 function requires the space module if it
needs it.
> wes
-Etan