lua-users home
lua-l archive

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

Hash: SHA1

Shmuel Zeigerman wrote:
> I think no warnings are needed. As in all other cases, it is the
> programmer's responsibility to take the scope into account. E.g., if the
> code says 'until x > 0', and x is not defined in the enclosing scope,
> it'll result in the run-time error "attempt to compare nil with number'.

Ah, but changing this now will break existing, correct code that relies
on this scoping behaviour. This is a Bad Thing. Even the Lua 5.1 -> 5.2
transition managed to keep pretty much all 5.1 code working on 5.2, with
some compatibility tweaks... but I'm not sure how this could be managed
in this case. (With a compiler flag to ask for old behaviour.)

Consider how much grief the equivalent transition caused in C++. I'm
*still* running into cases where code that does 'for (int i = ...)' does
the wrong thing on some production compilers.

- --
┌─── ───── ─────
│ "Wizards get cranky, / Dark days dawn, / Riders smell manky, / The
│ road goes on. / Omens are lowering, / Elves go West; / The Shire needs
│ scouring, / You may as well quest." - John M. Ford
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -