C is a purely functional language
Name:
Anonymous
2007-10-12 13:56
int pow2(int x) __attribute__ ((pure)) {
return x * 2;
}
Name:
Anonymous
2007-10-12 14:16
>pow2(int x)
>x * 2
wait what?
Name:
Anonymous
2007-10-12 14:32
In C, that translates to x * 2 = xx = x^2
Name:
Anonymous
2007-10-12 14:33
move along
Name:
Anonymous
2007-10-12 14:36
Name:
Anonymous
2007-10-12 21:08
(define pow2 (lambda(x) (* x x)))
Name:
Anonymous
2007-10-12 21:29
HERE'S MY IMPRESSION OF A STACKFAG IMPLEMENTING POW2:
dup swap
THANK YOU AND GOODNIGHT.
Name:
Anonymous
2007-10-12 21:49
pow2() ->
{pow, pow}.
Name:
Anonymous
2007-10-13 6:30
x * 2 = x + x = (2sqrt(x))^2 = (2sqrt(x))(2sqrt(x)) = 2sqrt(x)[(1)(1)] = 2sqrt(x)
2x = 2sqrt(x)
x = sqrt(x)
simple.
Name:
Anonymous
2007-10-13 7:03
1. My other
pow2 is a
sqr
2. Lisp is a toy language
3. OP is right
4.
>>6 needs to learn how to /
[code]
5. With Jews you lose.
Name:
Anonymous
2007-10-13 7:06
>>7
I guess that's why they call this forum /prog/, rofl, xd.
Name:
G. J. Freeman
2007-10-13 10:24
>>10
I don't accept that you call lisp a toy language, I'm gonna hit you with my crowbar.
Name:
Anonymous
2007-10-13 12:23
>>12
or better yet, shoot your crowbar at him with your gravity gun
Name:
Anonymous
2007-10-13 18:23
*ptr++
Name:
Anonymous
2011-02-04 11:58