>>21 What's wrong with [x:xs]?
It's gay -- use (x:xs).
Name:
Anonymous2008-02-14 10:05
HAY GUYS I WROTE A DEBUGGER IN BBCODE #include <stdio.h> #include <string.h> int main() { int a[200],count=0,i,n=0; FILE *f; f = fopen("42.txt","r"); if(!f) { printf("fopen failed\n"); return 1; } memset(a,0,200); for(i=1;;i++) { n = 0.5 * i * (i+1); if(n>=200) break; a[n] = 1; } while(!feof(f)) { i = fgetc(f); if(i!='\n') n += i - 64; else { if(a[n]) count++; n = 0; } } printf("count=%d\n",count); return 0; }
Name:
Anonymous2008-02-14 10:29
>>23
You're gay, if you want to use lists in Haskell, please be consistent and use [] everywhere, not some tuple-parens.
Name:
Anonymous2008-02-14 10:33
>>25
No you!, use cons-like : constructs everywhere. [] should be exclusively used as the NIL atom.
Name:
Anonymous2008-02-14 11:01
[x:xs] matches a list of lists.
Name:
Anonymous2008-02-14 11:08
>>26
Yes, because, why use syntactic sugar and write '(0 1 2 3)
when we can write (cons 0 (cons 1 (cons 3 (cons 3 '())))),
Eh?
(Or, in 'kell, [0,1,2,3] versus 0 : 1 : 2 : 3 : [].)
Name:
Anonymous2008-02-14 11:10
>>27
No, it doesn't. It matches a list of a car and a cudder.
Name:
Anonymous2008-02-14 15:16
>>28 [0,1,2,3] versus 0 : 1 : 2 : 3 : []
(enumFromTo 0 3), please come up with some real life cases where you need list syntax.