[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [BUG] Table constructor not equivalent to left-to-right assignment (Was: Testing for a sequence ...)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 22 Apr 2012 21:18:18 +0200
> The example in the 5.2
> manual page 18 implies this but it is never explicitly stated.
>
That example actually spells out clearly what you should do
do if you feel uncomfortable with the undefined property
of duplicate table keys in a table constructor. So:
(a) Making it deterministic will ruin optimization of sequences
in table constructors .
(b) It's easy to avoid the problem at the Lua source code level.
This discussion is not going anywhere. It's been honored
by a contribution from Roberto himself, from which it is
quite clear that the Lua designers are not going to
ditch the optimization of sequence constructors.
I forked this thread originally, but I accept that duplicate
keys in a constructor is never going to be good Lua with
predictable behaviour.
Signing off this thread,
Dirk