Unpack

From OpenEUO
Revision as of 18:27, 7 October 2010 by 76.184.213.234 (Talk) (Created page with " unpack (list [, i [, j]]) Returns the elements from the given table. This function is equivalent to return list[i], list[i+1], ···, list[j] except that the above code ...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
unpack (list [, i [, j]])

Returns the elements from the given table. This function is equivalent to

    return list[i], list[i+1], ···, list[j]

except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator (see §2.5.5).

Lua Manual - The length operator #