lua-users home
lua-l archive

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

On Wed, Sep 16, 2009 at 6:58 AM, Jim Jennings wrote:
>> Why isn't the native Lua search path sufficient?
> When I create the user environment, I may want my own search path for
> loading files that is distinct from the Lua package.path.   That gives
> me the opportunity to write structure declarations that load code from
> anywhere in the file system, according to how I've set the Darwin
> path....
> I considered giving Darwin a mirror of Lua's package table (which has a
> wonderfully flexible design) in order to provide the full power of
> loaders, preload, etc.  In the end, I opted for 'keep it simple'
> instead, and just implemented a search path, mainly because my desire
> was only to have my "set up the system" code live in a directory that
> is not on the Lua search path.

True, appending to package.path or loaders is currently a global
change.  Allowing for multiple private, independent instances of
package.path/loaders to co-exist would involve rewriting require.