Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The x-Done Loop

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-01-07 7:58

This is a construct that is very useful to avoid either a redundant check or a goto. This...
for(a;b;c) {
 expr1;
 if(d) {
  expr4;
  goto done;
 }
 expr2;
}
 expr3;
done:

...becomes...
for(a;b;c) {
 expr1;
 if(d) {
  expr4;
  break;
 }
 expr2;
} done {
 expr3;
}


where the intent is for statements in a done clause immediately following a loop to be executed if and only if the loop was exited via its termination condition being reached. This also generalises for while() and do-while, here using some common examples.

while(*j) {
 if(*j++ == k) {
  u = v + k;
  break;
 }
} done
 u = v - k;


do {
 if(f(a[i]))
  break;
} while(a[i++]) done {
 g();
}


Discuss.

Name: Anonymous 2013-01-09 9:38

It would be great if Cudder killed himself out of 4chan forever.

Name: Anonymous 2013-01-09 13:50

>>40
Culver easily, even though she supports kike languages (FIOC, javashit), that can be easily ignored. Cudder's rabid fanboy support of kike chip architecture on the otherhand is seriously harmful, also unacceptable.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List