lua-users home
lua-l archive

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


on 1/5/04 8:57 AM, Roberto Ierusalimschy at roberto@inf.puc-rio.br wrote:

> a = x
> (print or write)(x, y, z)
> 
> actually means "a = x(print or write)(x,y,z)", which is hardly the
> intended behavior. To avoid such misuses, Lua forbids the parentheses
> in a different line from the function.

Does the Lua grammar manage to handle this or is this something handled
outside the EBNF grammar?

This is, of course, why some languages use semicolons. ;-) You essentially
get your choice: semicolons or whitespace restrictions. Python is way over
on the whitespace restrictions side of things. Lua seems to have managed to
avoid semicolons through a small set of whitespace restrictions.

Mark