Lua Trivia Answers |
|
It depends what a.b
is!
a = {}; b = {}; c = {} print(a,b,c) --> a,b,c a.b = function(...) print(...) end a:b(c) --> a,c mt = {} mt.__call = function(...) print(...) end a.b = setmetatable(b, mt) a:b(c) --> b,a,c a.b(a,c) --> b,a,c (identical)
Furthermore, a
, c
, and the global environment table could invoke metamethods that call functions too.
2 3 2
1 4 6
--
sign in the third line is not interpreted as a variable decrement, but as the start of a comment... The ++
operator does not exist in Lua either, but does not generate an error here because it is inside that comment!
Note that the lack of syntax highlight in the question was in fact intentional.
Back to LuaTrivia