lua-users home
lua-l archive

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

> I would second that... it would indeed be rather handy for modules to
> seamlessly know where they where loaded from...

I don't think I'll ever see paths in the core modules (which I don't
mind) since lua tries to be transparent to them and wouldn't know how
to strip the filename out of a filepath in a portable way. But an
opaque filepath as it was given to loadfile() when the module was
require()'d seems reasonable. Since it uses user-supplied information
to find the file, it might as well tell us back which path worked.