lua-users home
lua-l archive

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


Am 28.06.2016 um 08:44 schröbte Tim Hill:

On Jun 27, 2016, at 9:15 PM, Philipp Janda <siffiejoe@gmx.net> wrote:

Mixing `.n` *and* sequence-style `#` will just combine the confusion, ugly corner cases, and undefined behaviors. Functions that take `.n`-style tables should just throw an error if there is no valid `n`.


I agree, and I would prefer to get rid of “.n” asap, but at the same time how much existing code will break?

What I meant is that supporting the current binary length search as a fallback to explicitly array sizes doesn't actually get rid of the undefined behavior that appears to confuse Lua newbies so much. It just adds a bunch of new rules.


—Tim


Philipp