Re: comma operator
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 15 May 2009 08:47:01 -0700
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
Keith Thompson said:
luserXtrog <mijoryx@xxxxxxxxx> writes:
[...]
I find it easier to think of the comma as a semicolon without
a period. It terminates the expression without terminating the
statement.
Ah, but it doesn't terminate the expression; it only terminates a
subexpression.
Yes, it does. An expression is "a sequence of operators and operands
that specifies computation of a value, or that designates an object
or a function, or that generates side effects, or that performs a
combination thereof". A comma operator always terminates such a
sequence.
You're right, of course. (The standard's definition of "expression"
is broken, but that's a separate point.)
Incidentally, that's true only because the comma operator has a lower
precedence than any other operator.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: comma operator
- From: Keith Thompson
- Re: comma operator
- References:
- Re: comma operator
- From: Keith Thompson
- Re: comma operator
- From: James Dow Allen
- Re: comma operator
- From: luserXtrog
- Re: comma operator
- From: Keith Thompson
- Re: comma operator
- From: Richard Heathfield
- Re: comma operator
- Prev by Date: Re: Float comparison
- Next by Date: Re: [re-post] why no output
- Previous by thread: Re: comma operator
- Next by thread: Re: comma operator
- Index(es):
Relevant Pages
|