lua-users home
lua-l archive

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

> Is there a reason 5.3 lost this flexibility?

Automatic coercion from numbers to strings is already considered bad
by many people. Lua usually avoids this coercion when it can lead to
confusion (e.g., 10 == "10"). In this case, as your example shows,
it sounds quite weird:

> tonumber(100, 4)  --> 16

100 is already a number! "Converting" it to a number should not change
its value.

-- Roberto