nanos world API Reference Unofficial documentation
Static function Shared Native

table.move

Moves elements from the <code>source_table</code> to the <code>dest_table</code>, performing the equivalent to the following multiple assignment: <code>dest_table[dest], ··· = a1[from], ···, source_table[to]</code>.<br /><br />The destination range can overlap with the source range. The number of elements to be moved must fit in a Lua integer.

Syntax

Lua
table.move(source_table, from, to, dest, dest_table = source_table)

Parameters

Name Type Default Description
source_table table The source table from which the elements are to be moved.
from number The start index of the source range from which the elements are to be moved.
to number The end index of the source range until which the elements are to be moved.
dest number The index within the destination table where the moved elements should be inserted. If this is not specified, the moved elements will be inserted at the end of the table.
dest_table optional table source_table The destination table to which the elements are to be moved. By default, this is the same as the source table.

Returns

  • table