is there a difference between those two notations

Christian Köstlin christian.koestlin at gmail.com
Wed May 2 04:02:15 PDT 2012


On 04/30/2012 11:03 PM, bearophile wrote:
> 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
thanks for this tip.
i always forget about this nice d feature :)

regards

christian



More information about the Digitalmars-d-learn mailing list