Standard Library Tables
Unpack Window
Assign several table values at once with table.unpack.
Unpack Window
unpack_window.lua
local startIndex =
local first, second = table.unpack({"north", "east", "south"}, startIndex, startIndex + 1)
print("startIndex=" .. startIndex)
print("first=" .. first)
print("second=" .. second)
local startIndex =
local first, second = table.unpack({"north", "east", "south"}, startIndex, startIndex + 1)
print("startIndex=" .. startIndex)
print("first=" .. first)
print("second=" .. second)
multiple assignment
`table.unpack` spreads selected array values into ordinary variables.