Lambda functions in D

Manfred Nowak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 9 04:49:37 PDT 2015


Dennis Ritchie wrote:
> 	auto fact = function (int x) => x * { if (x) fact(x - 1); };

int fact (int x) { return x * ( x>1 ? fact(x - 1): 1); };

-manfred


More information about the Digitalmars-d-learn mailing list