Hello,

I would like to know, why the module std.concurrency use function()
parameter in lieu of delegate ? 

Delegate would be usefull for example to pass Function Member to
spawn().

Example :

class Foo
{
        void test() 
        {       
                for(;;)
                {
                        receive(
                                (string s) { writeln("string"); }
                        );
                }
        
        }
}

void main()
{
        Foo l = new Foo();
        void delegate() dg;

        dg = &l.test;
        auto a = spawn(dg);

        a.send("test");
}

I have tested and it worked.

Reply via email to