[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why the dot in package.path? ..and finding the source filename
- From: Cosmin Apreutesei <cosmin.apreutesei@...>
- Date: Thu, 9 Jul 2009 12:26:44 +0300
> 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.