lua-users home
lua-l archive

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


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

One one hand, that trick of using extra loaders is cute.  On the other
hand, it breaks the idea that loaders only return a function that, when
called, opens a module (that is, loaders have no side-effects).

One idea is to have a way for a loader function to "fail" after running
(for instance returning false). Then the "load_ParentSearch" would
return a file, but that file when called would return false, meaning
"keep trying". But that idea subverts the whole current structure
of require ;)

-- Roberto