|
On Thu, Jul 31, 2014 at 1:39 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:You know, maybe the resolution is to define separate move() and copy()
> ---
> 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>
>
functions, where move() doesn't accept a destination, and copy()
requires one.
/s/ Adam