lua-users home
lua-l archive

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


> 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.