Re: comma operator
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Fri, 15 May 2009 22:41:12 +0000
Keith Thompson said:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
Willem said:[...]
Richard Heathfield wrote:
) 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.
So, what would you call this then:
((1, 2, 3) + (4, 5, 6))
I would call 1 an expression, which is terminated by a comma
operator.
I would call 1 an expression. But I wouldn't call it "a sequence
of
operators and operands".
I would. It's a sequence of 1 operand and 0 operators. (There was a
discussion along similar lines recently, either here or in
comp.programming - something to do with the difference between zero
hamburgers and no hamburger. I don't recall that a satisfactory
conclusion was reached in that discussion.)
Here it's an operand of the comma
operator, but in isolation:
1;
there are no operators, and therefore 1 is not an operand.
Well, that's certainly a compelling argument. Or at least, it would
be, if you passed it to a function. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- 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
- From: Willem
- Re: comma operator
- From: Richard Heathfield
- Re: comma operator
- From: Keith Thompson
- Re: comma operator
- Prev by Date: Re: comma operator
- Next by Date: Re: comma operator
- Previous by thread: Re: comma operator
- Next by thread: Re: comma operator
- Index(es):
Relevant Pages
|