project euler #10: optimization with primes

Robert Fraser fraserofthenight at gmail.com
Wed Apr 1 02:24:06 PDT 2009


bearophile wrote:
> import d.func, d.primes, d.string;
> void main() {
>     const int N = 1_000_000_000;
>     putr( sum(xtakeWhile((int i){ return i < N;}, xprimes(N))) );
> }

Yeah that's shorter (vertically; it's almost as long in characters), but 
how much lisp do you have to smoke to understand it?


More information about the Digitalmars-d-learn mailing list