Re: Non-uniqueness of module names
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Non-uniqueness of module names
- From: Chris Jones <cmsj@...>
- Date: 2019年8月15日 22:38:14 +0200
Apologies for resurrecting this months-old thread, but I would like to chime in to support the idea of `require` returning a second result of the path+filename where the module was found. This would be incredibly helpful for me in a plugin loader I'm working on in Hammerspoon. For now I'll go with Sean's ideas further down the thread (thanks Sean!), but having `require` do it for free would be a very welcome convenience!
I am not sure you are aware that the module itself already gets
this information:
---- file temp.lua
print(...)
$ lua -l temp
--> temp ./temp.lua
Maybe 'require' could simply return this information as a second result?
-- Roberto
--