Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Lua "3"+4 is an error. Concatenation is a different operator than add, specifically to avoid confusing coersions.


Try it:

    Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    > ="3" + 4
    7


Ah. Well at least there isn't a confusion between add and concat

"3"+4 is 7 4.."3" is "43"

"3hello"+4 is an error




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: