Skip to main content

tmove

Function tmove 

Source
pub fn tmove(state: &mut LuaState) -> Result<usize, LuaError>
Expand description

table.move(a1, f, e, t, [a2]). Copies a1[f..e] into a2[t..] (or a1[t..] if a2 is absent), reading source slots through __index and writing destinations through __newindex one element at a time. To survive an overlapping in-place range, it copies FORWARD (increasing index) when the destination is clear of the source’s tail (t > e || t <= f, or a distinct destination table) and BACKWARD (decreasing) otherwise — the order pinned by v53_plus_move_*. Returns the destination table. A 5.3 addition.