[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: Ricardo Ramos Massaro <ricardo.massaro@...>
- Date: Wed, 15 Sep 2010 16:00:51 -0300
On Wed, Sep 15, 2010 at 8:41 AM, David Kastrup <dak@gnu.org> wrote:
> While this more or less tells us that Lua is indeed a mess, it does not
> tell us what the above input will give. "Lua would see that" does not
> suggest that Lua would actually throw an error. Indeed, "Lua would see
> that" suggests that _if_ you want to have Lua see that as a single
> statement, writing it like that should work, on contradiction to the
> last sentence of the quote (which turns out more correct).
I'm not sure I understand what you're saying, but there's no reason to
throw an error at all, and I don't see the manual as
self-contradicting (maybe a little confusing).
The whole point the manual is trying to make is that both
a = f(g).x(a) -- [A] meaning "a = (f(g).x(a))"
a = f; (g).x(a) -- [B]
are valid (different) expressions, and without the "no line break
before `(' for function call" rule, the following two lines:
a = f
(g).x(a)
would be *apparently* [B] (to a human user), but would actually be
"seen" by Lua as [A] (because line breaks are usually ignored by the
parser).
- Ricardo
- 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, David Kastrup
- Re: Ternary operator patch, Juris Kalnins
- Re: Ternary operator patch, David Kastrup