Calling anonymous delegate recursively ?

Pelle pelle.mansson at gmail.com
Sat Jan 8 08:00:29 PST 2011


On 01/08/2011 04:45 PM, tsukikage wrote:
> eg. to return a fibonacci delegate:
>
> return (ulong m) {
> if(m < 2) return m ;
> return _self_ref(m-1)+_self_ref(m-2) ;
> } ;
>
> Is it possible? Thank you!

http://en.wikipedia.org/wiki/Fixed_point_combinator#Y_combinator

I don't think there's a built in way to self-recurse.


More information about the Digitalmars-d-learn mailing list