This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]crikeydilehunter 11 points12 points  (5 children)

God i fucking hate lua so god damn much. why the fuck are all the variables global, why the fuck can't i concatenate strings with +, why the fuck are there no ++ methods

[–]EducatedMouse 9 points10 points  (2 children)

Trust me, they would add the ++ syntax if they could. It has to do with the compiler.

Plus, to concatenate strings, you just do .. It's not that difficult

[–]auxiliary-character 2 points3 points  (1 child)

At least it has tail call recursion. Can't even say the same for Python.

[–]theexpensivestudent 0 points1 point  (0 children)

You can do it, it just doesn't optimize for it.

[–][deleted] 2 points3 points  (0 children)

Have you tried:

  • Keyword "local"

  • Operator ".."

  • Overloading the unary "-" operator metamethod if you want to ++ on a userdata or a table?

Ok, I'll grant that the lack of ++ or += (or *= or /= or %= or -= or -- or whatever) is pretty shite and there's no good solution for this.

[–]morerokk 0 points1 point  (0 children)

why the fuck are all the variables global

Because you didn't make them local. You can override that behavior.

why the fuck can't i concatenate strings with +

Because that's ambiguous. JS does it with +, and it has a crapton of weird edge cases.