lua-users home
lua-l archive

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


On 07/07/2009 09:47, Nick Gammon wrote:
I was recently thrown by a complaint from a user that my examples on my web site are "wrong" because I gave examples like:

print ("Hello World")

instead of:

print("Hello World"")

Now we all know that both forms work (with or without the space before the bracket).

Indeed.
Personally, I am too used to x() syntax so I frown when I see x () (but I separate keywords like if/for -- in C or Java) but I wouldn't have the idea to call that "wrong"!
At least as long as the lexer is pleased...

I noticed that Roberto and Luiz declare functions with the space before the opening parenthesis, but call them without.

As said, as long as you are consistent... Because if you write either way, it makes harder to find a call (or definition) with a simple editor.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --