lua-users home
lua-l archive

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

On Thu, Feb 10, 2011 at 11:42 AM, Axel Kittenberger <> wrote:
> function for the current core, but the implicity of stuff happening
> and the bugs that can spawn, like number string conversations is
> pretty bad.

They _are_ bad if '+' is overloaded to mean both concatenation and
addition, as in JavaScript.

For Lua, the coercions in a..b and a+b are pretty well defined, but of
course they may throw an error, and that's when explicit
tonumber/tostring is useful.

Even strong typed languages know the wisdom of automatic coercion to
string when the context demands it (e.g. string + in Java)

steve d.