Lambda functions in D

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 9 11:04:27 PDT 2015


On 05/09/2015 10:45 AM, Russel Winder via Digitalmars-d-learn wrote:
> On Sat, 2015-05-09 at 09:49 -0700, Ali Çehreli via Digitalmars-d-learn wrote:
>>
> […]
>> BigInt factorial(size_t n)
>> {
>>       return bigInts(1).take(n).reduce!((a, b) => a *= b);
>> }
>
> I wonder if that should be a * b rather than a *= b?

Yes. :) Luckily, the difference is an unused side-effect to parameter 
'a' in my wrong version.

Ali



More information about the Digitalmars-d-learn mailing list