lua-users home
lua-l archive

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



On May 05, 2006, at 05:25, konthiga Lee wrote:

First of all, i'm sorry to write this letter to you beacause the question i want to ask maybe is not your responsibility.I have googled for thousands of pages to find out the difference between semicolon and comma in lua,but none of the results answer clearly,will you please do me a favour to show me the very answer: Is there any difference between semicolon and comma in lua?when should i use a comma and when shuold i use a semicolon?

If this semantic question is not your filed, please show me where i can find lua users to ask me.

Always use comma, never use semicolon.

A comma is used to separate arguments in function calls
f(a, b, c)

And in multiple variable assignment:
a, b, c, = 1, 2, 3

And in multiple returns:
return a, b, c, f(a, b, c)

A semicolon is used at the end of statements, but it's entirely optional. Almost no-one uses it routinely.

drj