for(int i = 0; i < 10; i++)
{
switch(i)
{
case 0: doFirst();
case 1: doSecond();
case 2: doThird();
case 3: doFourth();
case 4: doFifth();
case 5: doSixth();
case 6: doSeventh();
case 7: doEighth();
case 8: doNinth();
case 9: doTenth();
}
}
>>13
Indeed. Expert schemers such as myself have no need for iteration such as your infantile, ``for-loops.'' I'm sorry if you misinterpreted my post, English is a language far inferior to LISP in terms of expressiveness and concision.
bool isEqual(int a, int b) {
if (a == b) {
return true;
} else if (a != b) {
return false;
} else {
printf("Error");
}
}
Name:
Anonymous2012-10-29 15:03
>>18 not using constant reference params using braces for one-line conditionals bool isEqual(const int &a, const int &b) {
if (a == b)
return true;
else if (a != b)
return false;
else
printf("Error");
}
Name:
Anonymous2012-10-29 15:08
bool isEqual(const int &a, const int &b) { WHAT.THE.FUCK.
using a for instead of a while to demonstrate that a for loop is a specific case of a while loop
You faggots are like people who think using a word's original meaning and its newer meaning together is a ``pun''.
Name:
Anonymous2012-10-29 15:17
>>23
Where do you see a while loop in this thread? Nobody's talking about while loops here.
Name:
Anonymous2012-10-29 15:20
>>18,19
The error branch should also exit the process (or halt the machine in case you're making an OS), since it is obvious that if it's triggered, it must have been caused by a protection fault unless you're writing self-modifying code.
(I sincerely hope you're not writing non-self-modifying code and not protecting the memory.)
>>29
I suppose you can if you do stupid shit like #define int MyOwnSuperGayType
but yeah, this discussion is becoming too pedantic. Why not make your own programming language while you're at it if you want to go full retard.
Holy shit, I was just making fun of the horrible code in this thread. Of course the third branch makes no fucking sense. Here's a hint: the entire function is just an awfully complicated and buggy rewording of a == b.
>>27
Under what circumstances could it possibly be useful to overload the comparison operators in such a way as to render them intransitive? If you've done that you've already blown your leg off and are walking around on the stump.