News for hackers. Stuff that matters.
Re:Hey, C Is a Functional Language Too by charliesome on Friday November 02, 2012 @05:59AM (#4731916)
GCC can eliminate tail recursion, so does that make C functional?

I don't think the author is seriously of the belief that C is a functional language. This is just a fun little example of writing C in a functional style.

Re:Hey, C Is a Functional Language Too by Jach on Friday November 02, 2012 @07:18AM (#4732083)
GCC can even eliminate non-tail recursion, such as with this piece of black magic:

    int factorial(int x) {
       if (x > 1) return x * factorial(x-1);
       else return 1;
    }
will be optimized by GCC to

    int factorial(int x) {
       int result = 1;
       while (x > 1) result *= x--;
       return result;
    }
(http://ridiculousfish.com/blog/posts/will-it-optimize.html)