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

n-breaks?

Name: Anonymous 2017-09-22 2:12

Why can't we just have break accept a number so we can break multiple loops at the same time?


for( /*...*/ ) {
do {
x = f();

switch( x ) {
case Error;
break 3; // was that so fucking hard?
}
} while( /*...*/ );
}


Dare say I should use... EXCEPTIONS?!

Name: Anonymous 2017-09-22 2:23

>>1
Its called goto.

Name: Anonymous 2017-09-22 2:24

>>2
GOTO CONSIDERED HARMFUL, WHAT TEH FUCK IS YOUR PROBLEM

Name: Anonymous 2017-09-22 3:34

>>3
break is just a constrained goto

Name: Anonymous 2017-09-22 3:35

because of undefined behavior

Name: Anonymous 2017-09-22 6:10

WPLIT? if C or Seeples, use goto. if Java, break to label. I don't know if there's a language that supports breaking out of n loops dynamically, that would require more runtime information (loop returns on stack?)

Name: Anonymous 2017-09-22 8:38

>>6
that would require more runtime information (loop returns on stack?)
How about you restrict n-breaks to positive integer literals?

Name: Anonymous 2017-09-22 8:42

>>7
then you can just use labels

Name: Anonymous 2017-09-22 10:55

>>7,8
GOTO 21

Name: Anonymous 2017-09-22 11:01

>>9
goto >>21

Name: Anonymous 2017-09-22 11:02

>>11
goto dubs

Name: Anonymous 2017-09-23 2:29

I found an answer!!!!!!!

for(float a = 0; a < 2.4; a++) {
for (float b = 0; b < 99.3; ++b) {
for (float c = 0; c < 35.16; ++c) {
for (float d = 0; d < 9.1; ++d) {
for (float e = 0; e < 28.3; ++e){
int x = f();
if (x == false) b = 99999999;
}
}
}
}
}

Name: Anonymous 2017-09-23 2:51

>>12
This doesn't stop them.
Although I guess it would if you did the same to the other inner loops.

Name: Anonymous 2017-09-24 1:32

>>12
If you're suggesting that unironically, then no that's not a good idea.

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