lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:

[snip]
> But expressions beginning with brackets introduce ambiguity:
> 
>         a=b
>         (f)(2)
> 
> The code above is parsed as a=b(f)(2) not as a=b;(f)(2).
> Some languages have a rule that newlines end statements if it makes 
> sense to do so, but isn't that confusing too? Plus I don't think it 
> would be easy to add this feature to the Lua parser.

I may be stepping on language designers' toes here, but I always wanted
to ask this: (regardless of the functional programming examples), why
isn't it the case that a semicolon must always be present to end the
statement? I know that a change like this isn't feasible now, with all
the code that would be broken, but I just wanted to hear about the
rationale of this choice.

Cheers,
Nikos