[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LoadLib 5.1 problems and concerns
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 09 May 2005 20:56:33 -0300
> - On platforms without dynamic library loading capabilities, not only
> the "loadlib" function gets disabled, but also "require". The mere
> presence of the C loader voids the functionality of the entire Loadlib.
> This is probably a bug.
Can you give more details? I could not reproduce that behavior.
> Even though the definition for the path delimiter can be overridden,
> I think that Lua should not try to abstract from an underlying
> filesystem in any way -- this task should be left to specialized
> third-party libraries. It seems more appropriate to me if at least
> one function (preferrably "require") is guaranteed to leave the path
> and filename unmodified.
One of the main uses of require is to search for modules. So it cannot
leave the path unmodified. There is one function that leaves all
untouched: loadfile. Actually, you can use it together with require (but
don't have to):
package.preload["modname"] = loadfile("/whole/path/myfile.lua")