lua-users home
lua-l archive

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


Did not realise that - very useful to know!

(Seems that if the module comes from package.loaded, the second return value is nil - is that the only way nil can happen?)

I switched all my own work to 5.4 a while ago, mainly for the reason of a decent PRNG by default. Strange reason to choose, but it was mine. (I subsequently swapped out xoshiro256** for Jenkins-7,13,37 which was a simple change because they both have 4x64-bit internal state variables. Similar code in both cases but different design justifications by the creators.)

On 15 Aug 2019, at 22:43, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

>> 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 is already implemented in Lua 5.4 alpha.
> See https://www.lua.org/work/
> 
> -- Roberto
>