lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


---
table.copy (a1, f, e, [a2,] t)

Copies elements from table a1 to table a2. This function performs the
equivalent to the following multiple assignment: a2[t],··· =
a1[f],···,a1[e]. The default for a2 is a1. The destination range can
overlap with the source range. Index f must be positive.
---

I have mixed feelings about this. Last year [1] John Hind and I
wrote a module called "xtable" containing a function block.move
such that when e>=f,
   block.move(a1,f,e,t)
does exactly what the above definition of
   table.copy(a1,f,e,t)
does. So I should be very pleased. However, I am not delighted
by an optional argument preceding a non-optional one. It violates
my sense of conceptual integrity.

[1] <http://lua-users.org/lists/lua-l/2013-04/msg00016.html>



2014-07-31 20:30 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
> Lua 5.3.0 (alpha) is now available for testing at
>         http://www.lua.org/work/lua-5.3.0-alpha.tar.gz
>
> MD5     2922a0c3b64c8a2f678d2510b7a5a336  -
> SHA1    b2f86c16a38310c9e240c70216618308097444f6  -
>
> This is an alpha version. Some details may change in the final version.
>
> The main change in Lua 5.3.0 is the introduction of integers. See also
>         http://www.lua.org/work/doc/#changes
>
> The complete diffs are available at
>         http://www.lua.org/work/diffs-lua-5.3.0-work3-alpha.txt
>
> All feedback welcome. Thanks.
> --lhf
>
>