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

I C

Name: Anonymous 2010-11-27 21:53

Flipping through a C textbook I have lying around...
Recursion is an important recurring concept in computer science.
:/

Name: Anonymous 2010-11-27 22:41


//non-recursive
void iC(int n){
    int i;
    for(i=0;i<n;++i)
        anus();
}

//recursive
void iC(int n)
{
    iC_r(0,n);
}

void iC_r(int i,int n)
{
    if(i==n)    return;
    anus();
    iC(++i,n);
}

Name: Anonymous 2010-11-27 23:39

>>1
DON'T DO RECURSION IN C.

Name: Anonymous 2010-11-28 0:48

>>3
[b]WHY ON EARTH NOT MY COMPILER HAS TCO AND FOR SOME PROCEDURES THATS IRRELEVANT BECAUSE RECURSION IS A PRETTY GOOD CHOICE REGARDLESS[b]

Name: Anonymous 2010-11-28 0:56

>>4
You fail at BBCode, your argument is invalid.
Also, tail recursion in C is pointless, just use a for loop, and normal recursion blows the stack.

Name: Anonymous 2010-11-28 1:11

>recursion in C is pointless, just use a for loop,

No, thanks. I don't need your stinky loops + 1 level of indentation.

Name: Anonymous 2010-11-28 1:14

>>6
Then, enjoy your stack overflow.

Name: Anonymous 2010-11-28 1:15

>>7
My compiler is smart enough to perform TCO. Enjoy my noko

Name: Anonymous 2010-11-28 1:18

Oh, wait, I just realised that IHBTC.

Name: Anonymous 2010-11-28 5:13

>IHBTCO

BTFY

Name: Anonymous 2010-11-28 7:37

Name: Anonymous 2010-11-28 8:08

IHBTCO

Name: Anonymous 2010-11-28 8:37

>>11
It isn't guaranteed that the compiler is gonna optimize your tail-calls.
I have been tail-call optimized

Name: Anonymous 2010-11-28 9:37

In the most cases TCO isn't even possible.

Name: Anonymous 2010-11-28 9:41

Tails are for furries.
I use penis calls.

Name: Anonymous 2010-11-28 18:21

>>15
That's why those in the know call it tail call elimination.

Name: Anonymous 2010-11-29 0:46

>>15
booty call

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