lua-users home
lua-l archive

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


2008/11/17 Tim Michals <tcmichals@msn.com>:
> When would this feature be out? What I'm looking for is a method what would
> allow a search path for loading the shard library or DLL. right now, the
> only way I know is use a static path,
> package.cpath.
>
> There was a posting for this at
> http://lua-users.org/lists/lua-l/2008-02/msg00720.html
>
> for example in a lua script require("module")
>
> Is there another method? So some simple way to do this?

You can implement a custom module searcher to have whatever lookup
mechanism you want to find shared libraries. I updated the wiki with a
Lua implementation of the default binary loader provided with Lua [1].
You can start from there and add a more complex search path mechanism.
I think the example is pretty straightforward, but feel free to ask
for explanations.

[1] http://lua-users.org/wiki/BinaryModulesLoader