lua-users home
lua-l archive

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

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!

On Mon, 15 Apr 2019 at 14:45, Roberto Ierusalimschy <> wrote:
I am not sure you are aware that the module itself already gets
this information:

---- file temp.lua

$ lua -l temp
    --> temp    ./temp.lua

Maybe 'require' could simply return this information as a second result?

-- Roberto