Return
Styles:
Pseud0ch
,
Terminal
,
Valhalla
,
NES
,
Geocities
,
Blue Moon
.
Entire thread
(´∀`) Prime numbers (,,゚Д゚)
1
Name:
Anonymous
2007-04-15 11:11
ID:00E9fssW
|code]isPrime x = (filter (0 ==) (map (mod x) [2..x-1])) == []
[/code]
41
Name:
Anonymous
2007-05-15 15:33
ID:Heaven
>>40
Oh, I just realized it really isn't a function. I'd like to know the reason, too.
42
Name:
Anonymous
2007-05-15 15:38
ID:fB6+u2Vv
>>40
I think it's because if-then-else looks nice than any real reason. Reasonable name for your function there could be ifte.
43
Name:
Anonymous
2007-05-15 15:41
ID:Heaven
>>42
But is there a need for `then' and `else'? Lisp does just fine without them.
44
Name:
Anonymous
2007-05-15 18:46
ID:Heaven
>>43
No, there is no need for it. It just looks nice.
45
Name:
Anonymous
2009-01-14 14:11
Satori
47
Name:
Anonymous
2011-02-02 23:09
48
Name:
Anonymous
2011-02-04 13:36