6.6 – Table Manipulation

This library provides generic functions for table manipulation. It provides all its functions inside the table table.

Remember that, whenever an operation needs the length of a table, all caveats about the length operator apply (see §3.4.7). All functions ignore non-numeric keys in the tables given as arguments.

table.move()

table.move (a1, f, e, t [,a2]) Moves elements from table a1 to table a2, performing the equivalent to the following multiple assignment: a2[t]

2017-02-21 04:16:16
table.insert()

table.insert (list, [pos,] value) Inserts element value at position pos in list, shifting up the elements list[pos], list[pos+1],

2017-02-21 04:16:15
table.remove()

table.remove (list [, pos]) Removes from list the element at position pos, returning the value of the removed element. When pos is an integer

2017-02-21 04:16:17
table.unpack()

table.unpack (list [, i [, j]]) Returns the elements from the given list. This function is equivalent to return list[i], list[i+1]

2017-02-21 04:16:18
table.concat()

table.concat (list [, sep [, i [, j]]]) Given a list where all elements are strings or numbers, returns the string list[i]..sep..list[i+1] ··· sep..list[j]. The default

2017-02-21 04:16:14
table.sort()

table.sort (list [, comp]) Sorts list elements in a given order, in-place, from list[1] to list[#list]. If comp is given, then

2017-02-21 04:16:18
table.pack()

table.pack (···) Returns a new table with all parameters stored into keys 1, 2, etc. and with a field "n" with the total number of parameters. Note that the resulting

2017-02-21 04:16:16