lua-users home
lua-l archive

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


nop@nop.com wrote:
> 
> ";" is completely optional; the end of statements in the Lua grammar
> is unambiguous without it.  Newline has no special meaning.  You can
> write
> 
>   print("foo"); print("bar");
> 
> or
> 
>   print("foo") print("bar")

Be careful!  Since Lua 4.1 this is (unfortunately) no longer the
case.  It allows '(' to start statements so

  print("foo"); (print)("foo");

is different to

  print("foo")  (print)("foo")

Ciao, ET.