lua-users home
lua-l archive

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


Hi Edgar,

1) Following Diego's suggestion, require "a.b" would first require "a".

IMHO that would be wrong.  That assumes the "a" is the core of "a.b".

I don't see a semantic problem here. "a" is the parent of "a.b". It
starts making sense to load "a" before "a.b" as soon as you define it as being the standard behaviour.

Semantics apart, the implicit call to require"a" that is generated by a
call to require"a.b" would be there just to give "a" an oportunity to
set hooks in case "a.b" doesn't exist in the filesystem. This is a
common situation for libraries that have several sub-packages and want to
distribute a single file.

It makes it possible to replace

    lib/a.so
    lib/a/b.so
    lib/a/c.so
    lib/a/d.so

with

    lib/a.so

If you think there is another solution for this problem, or you think
this problem is not important, I would like to hear about it.

Regards,
Diego.