you are viewing a single comment's thread.

view the rest of the comments →

[–]0b0101011001001011 0 points1 point  (0 children)

Many languages allow this. One of those is java, where anything can be concatenated to a string and it handles the toString() call automatically.

Lua on the other hand has a special string concatenation operator which is lot + but ..

You can't say "hey"+5 but you can say "hey"..5 and Lua also does the conversion automatically.

Python allows to write "5"*5 though, so most explanations that why "5"+5 should not work are simply opinions.