lua-users home
lua-l archive

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


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