関数 ローカル変数 可変引数
-- 関数 ローカル変数 可変引数 -[[ ... 可変を表す ]] function sum(...) local a = {...} local total = 0 for i = 1, #a do total = total + a[i] end return total end print(sum(2, 5)) print(sum(2, 5, 7, 4)) print(sum(2, 5, 1, 3, 4))