...used in vararg functions . Its value is a list of all the "extra" arguments (i.e. those that follow the last named argument of the current function.)
(...) (like any other expression in parentheses) sets the result to one value (the first in the list).
, if " false nil."
:
local function f1(...)
if (...) then
return true
else
return false
end
end
local function f2(x, ...)
if (...) then
return true
else
return false
end
end
print(f1()) -- false
print(f1(1)) -- true
print(f1(1, 2)) -- true
print(f1(1, nil)) -- true
print(f1(nil, 2)) -- false
print(f2()) -- false
print(f2(1)) -- false
print(f2(1, 2)) -- true
print(f2(1, nil)) -- false
print(f2(nil, 2)) -- true
(.. function . . . end) - , (.. script .)
, (...) . if(...) , .
script, (...) ( if(...) , - .)