[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Differences between lua 4 and 5?
- From: Mark Hamburg <mhamburg@...>
- Date: Mon, 05 Jan 2004 10:06:52 -0800
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