lua-users home
lua-l archive

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

>Regardless, one *should* be able to have:
>    function(a) return a end (123)

This does not work because it requires 2 lookaheads. It could be made to work,
of course. However, instead of trying to cater for all possible combinations,
we decided that anything can be used for calling, but complex things must be 
inside parentheses. So these work:
    (function(a) return a end) (123)
(the second one gives a runtime error, not a compilation error.)

We think this is a simple rule that makes it possible to write complex things
while not complicating too much the rest of the syntax.