lua-users home
lua-l archive

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


I just set package.preload.packagename to the loader function of the extension. Obviously you have to do this after loading the package library. Also this won't set globals, the scripts will still need to require your extension.

I'm pretty much against setting globals, but if you really want to, you can write a c function that basically executes "%s = require(\"%s\")" for a given argument and then lua_call it after you've put the loader in package.preload.

Thanks,
Kev