lua-users home
lua-l archive

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


> On 21 Sep 2021, at 20:48, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> 
>> https://www.lua.org/manual/5.4/manual.html#8 does not say anything about ‘require’ which returns two values since 5.4. it’ll be much better to mention that incompatibility there.
> 
> Why is that an incompatibility? Is there any real code that stopped
> working because of that change?
> 

the real world is mostly complicated.

the best module all over the world looks like

local …
local function ...
return { func1, ……. }

sometimes it might be used like (reduced of course)

return require ‘module’

called from C code. and, yes, C programmers very strong and paranoidal, they check how many results returned from Lua code to minimize stupid unpredictable errors. I’m pretty sure it’s bad idea to ignore extra results, we mustn't to ignore errors.

-- 
Yours sincerely, Eugeny.
+33 6 38 52 27 93