1 2 3 4 5 6 7
-- script.lua -- Receives a table, returns the sum of its components. x = 0 for i = 1, #foo do x = x + foo[i] end return x