Recursive lambda functions?

lomereiter lomereiter at gmail.com
Mon Dec 30 13:40:05 PST 2013


On Monday, 30 December 2013 at 21:15:43 UTC, Ilya Yaroshenko 
wrote:
> I want something like
>
> enum factrorial5 = (a => a == 0 ? 1 : a * __lambda(a-1))(5);
> //Recursive pure lambda function

That isn't supported in D. And cases where this would be useful 
are too rare to add complexity to the language. Just use a 
regular function, it's not much more code.


More information about the Digitalmars-d-learn mailing list