lua-users home
lua-l archive

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


> But you made me think about a different idea: require() uses hardcoded
> control flow to go through package.loaded, package.preload, package.cpath
> and package.path. Why not use a single 'path table' that holds closures for
> individual loaders (bound to individual path elements):

The use of individual path elements goes a little too far. The concept
of one single string with all path options is strong and useful (e.g., to
change the path through environment variables). But the idea of a loader
table with all available loaders (pre-loaded, loader_c, and loader_lua)
to be iterated is a good one.

-- Roberto