lua-users home
lua-l archive

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


On Wed, Nov 30, 2011 at 15:24, Patrick Rapin <toupie300@gmail.com> wrote:
>> All feedback welcome. Thanks.
>
> I don't know if this is wanted or not.
> But the following change in behavior surprised me :
>
> Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>> return string.format("%d", 2.5)
> 2
> Lua 5.2.0  Copyright (C) 1994-2011 Lua.org, PUC-Rio
>> return string.format("%d", 2.5)
> stdin:1: bad argument #2 to 'format' (not an integer in proper range)
> stack traceback:
>        [C]: in function 'format'
>        stdin:1: in main chunk
>        [C]: in ?
>
> Of course, one can replace %d by %.0f.
> But the replacement may be cumbersome (a number of scripts in our
> company may fall in this case.)
> Anyway, in chapter 8 – Incompatibilities with the Previous Version - ,
> there is no mention of this change.

Oh. Thank you for finding this!

To Lua authors: I humbly ask you to at least mention this in the
manual. This will break existing code, so it deserves a word or two to
save time on upgrade.

* * *

For me this issue looks as yet another reason not to think about
upgrading our existing extensive codebase to 5.2. Such small
undocumented breaking changes — especially if there are more of them,
and I'm sure there are — will give us a hard time upgrading,
especially without 100% coverage tests.

But without breaking changes there is no progress. So, I welcome Lua
5.2 as it is (or would be). :-)

I guess, we will treat it as a separate incompatible language for a
while, that's all...

Alexander.