lua-users home
lua-l archive

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


In my implementation, package.alias is only used if the cRoot and RC loaders cannot find a package; in that case it effectively re-tries cRoot and RC with as the filename, again using cpath.

What does the RC loader do? The same as the C loader, but trying to get
the chunk from a resource name that is a function of the subpackage

I have played games with the preload table, but to work in all cases (eg require a.b.c), the preload table needs to be filled in for all sub-modules. I am trying out the alias approach (which can still be an add-on loader) so that package.alias.mime=socket will resolve correctly for require"", without needing a whole slew of entries.

How about playing tricks with the metatable of package.preload? You
should be able use pattern matching to resolve names.