lua-users home
lua-l archive

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


On 16/12/2010 17:41, Matthew Wild wrote:
Even the example given by the OP could be ambiguous. Now I finally
have a reason for putting semi-colons in all my Lua code :)

Scala (and probably other languages omitting sentence delimiters other than newline while allowing free-style formatting) have this problem too: most of the time, omitting semi-colons is OK, the compiler is smart about it, but sometime it bites the coder...

Scala see empty lines (after trimming) as sentence delimiter too, so if you want to avoid semi-colons at all costs, you just hit Return twice at ambiguous places... Beside, I find some empty lines can help readability (natural grouping of related lines).

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