[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: Henk Boom <henk@...>
- Date: Wed, 15 Sep 2010 12:27:25 -0400
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
- References:
- Re: Ternary operator patch, Henk Boom
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Geoff Leyland
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Jonathan Castello
- Re: Ternary operator patch, Roberto Ierusalimschy
- Re: Ternary operator patch, Enrico Tassi
- Re: Ternary operator patch, Doug Rogers
- Re: Ternary operator patch, Fabien
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Fabien
- Re: Ternary operator patch, mauro iazzi
- Re: Ternary operator patch, Tony Finch
- Re: Ternary operator patch, Miles Bader