[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 11:39:03 +0200
>
> No, it is worth converting undefined to error generating illegal.
>
You can't trap repeated keys in e.g.
-- a, b, c have been calculated by some previous code
t = {[a]=1, [b]=2, [c]=3}
cheaply. You can only trap them cheaply when the keys
are constant, i.e. when any idiot could have noticed them
by just staring at the code for five seconds.
We're only talking about table constructors. Nobody forces
you to use mixed table constructors. You can make all
mixed table constructors illegal if you like, yes. Just a
simple patch to the source (start with lparser.c) should
do it.
Go and do it and come tell us all how much improved
your productivity has become for not having to spend all
your time debugging code that relied on undefined
behaviour.