lua-users home
lua-l archive

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


Hi,

So, it does have an impact (mainly because, with the obvious
implementation, you have to pay it even when requiring an already loaded
module).

What if you implement the parent search as another loader (that always
fails), and place it in the middle of the loaders list?

    loaders = {
        load_Preload,
        load_C,
        load_Lua
        load_ParentSearch,
        load_Preload,
    }

That way the cost will only be paid on first failure. No if's. No cost
for modules that are already loaded.

Regards,
Diego.