[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: pack/unpack
- From: Fredrik Widlund <fredrik.widlund@...>
- Date: Wed, 15 Jun 2011 14:57:28 +0200
Hi,
Could someone explain if the following is by design:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> a={1,2,3}
> b={4,5,6}
> c={unpack(a), unpack(b)}
> print(table.concat(c, ","))
1,4,5,6
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, ","))
1,2,3
Kind regards,
Fredrik Widlund