News for hackers. Stuff that matters.
Re:Nymph: A slightly different version of C by kazinator on Friday August 18, 2017 @01:47PM (#15048240)
The comma operator has more uses than that. One of them is to introduce some needed side effect in a sequence of definitions, without introducing a statement (out of esthetics, or C90 compatibility concerns):

  {
    int x = (side_effect(), initializing_expr());
    int y = x + 42;
From C99 onward, this could be:

  {
    side_effect();
    int x = initializing_expr();
    int y = x + 2;
We use the comma operator in for loops because it has places in its syntax which take one expression. This limitation can arise in other contexts, like some macro MAC(E) where E must be a single expression. If want to to have two sequenced effects in there, we can use MAC((eff1, eff2)).

There are no comments on this comment yet.