TODOs de Maikel: Flag de resuelto en el foro

TODOs de Maikel: Flag de resuelto en el foro

Flag de que un post fue resuelto en el foro de Clab



Comments

By griNtAQGGnivbFXXaNc
gravatar image
5 years ago

Ne3o, verifiquem na Wikipedia por D (programming laguagne), vere1 que ne3o e9 igual!Exemplo de linguagem D:import std.concurrency, std.stdio, std.typecons;int main(){ auto tid = spawn(&foo); // spawn a new thread running foo() foreach(i; 0 .. 10) tid.send(i); // send some integers tid.send(1.0f); // send a float tid.send( hello ); // send a string tid.send(thisTid); // send a struct (Tid) receive( (int x) { writeln( Main thread received message: , x); } ); return 0;}void foo(){ bool cont = true; while (cont) { receive( // delegates are used to match the message type (int msg) { writeln( int received: , msg); }, (Tid sender) { cont = false; sender.send(-1); }, (Variant v) { writeln( huh? ); } // Variant matches any type ); }}


Name

E-mail

Comments