lua-users home
lua-l archive

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


Could someone explain if the following is by design:
Lua 5.1.4  Copyright (C) 1994-2008, PUC-Rio
> a={1,2,3}
> b={4,5,6}
> c={unpack(a), unpack(b)}
> print(table.concat(c, ","))

It seems the second unpack starts "writing" its members to position i+1 and thus overwrites the members of the first unpack? Is this really correct behaviour?

Of course:
> c={unpack(a)}
> print(table.concat(c, ","))

Kind regards,
Fredrik Widlund