Mar. 27th, 2006
functional java again
Mar. 27th, 2006 03:40 pmI know already that in Haskell, the language of the future, it is all expressed as a one-liner.
But there are 2 million poor old Java programmers that are having hard time reading even this; we have to be kind to them. I am one of them.
So, I rewrote sieve again, this time it is a little bit more beautiful.
Note that if sieve() could return a pair (prime, itsnumber), life would be easier. But returning tuples is something Java will never do (probably). (Instead, it has NavigableMap now.)
( Read more... )
But there are 2 million poor old Java programmers that are having hard time reading even this; we have to be kind to them. I am one of them.
So, I rewrote sieve again, this time it is a little bit more beautiful.
Note that if sieve() could return a pair (prime, itsnumber), life would be easier. But returning tuples is something Java will never do (probably). (Instead, it has NavigableMap now.)
( Read more... )
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999 - what is it?
( Read more... )
( Read more... )