lua-users home
lua-l archive

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


On 15 September 2010 07:40, Miles Bader <miles@gnu.org> wrote:
> Tony Finch <dot@dotat.at> writes:
>> A function call statement now maximally munches all trailing argument-like
>> clauses - bracketed expressions, table constructors, and strings - and is
>> terminated by a keyword, a variable name, or a semicolon. Newlines are now
>> treated the same as other white space.
>
> Nice.  I was always vaguely nervous about that case... (sometimes I find
> myself wanting to put the parens down below...)
>
> Are there any gotchas with the new method that are likely to arise in
> practice?

Off the top of my head:

foo(bar)
("string literal"):baz()

Could be useful in either interpretation (assuming you've given the
string's metatable something useful to call as a statement)

Since you can't use string literals directly with :, they need to be
in parentheses (at least in 5.1, don't know if this has changed)

    henk