Christian Köstlin:

reduce!((int a, int b){return a+b;})(iota(100))
reduce!("a+b")(iota(100))

Today the syntaxes I prefer are:

iota(100).reduce!q{a + b}()

iota(100).reduce!((a, b) => a + b)()

But hopefully in some we'll have an efficient sum() function too in Phobos:

iota(100).sum()

Bye,
bearophile

Reply via email to