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

Fibonacci

Name: Anonymous 2007-07-24 19:07 ID:DzKI9Xsx


fibs :: [Int]
fibs = 0 : 1 : [ a + b | (a, b) <- zip fibs (tail fibs)]

Fibonacci

Name: Anonymous 2007-07-27 20:11 ID:Heaven

>>29
http://perldoc.perl.org/perlop.html#Named-Unary-Operators-operator%2c-named-unary

and way way way more readable, unless you happen to think dup, swap, rot, tuck and nip are better than lotsa parenthesis
you'd be surprised how many people do.

also, >>30-31 should count every pair of parentheses as a token.

if you're counting characters, that's just stupid. especially when comparing different languages.

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